ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From veit...@apache.org
Subject svn commit: r1849791 - in /webservices/axiom/trunk: pom.xml systests/eclipse-tests/pom.xml systests/wildfly-tests/pom.xml
Date Thu, 27 Dec 2018 09:29:31 GMT
Author: veithen
Date: Thu Dec 27 09:29:31 2018
New Revision: 1849791

URL: http://svn.apache.org/viewvc?rev=1849791&view=rev
Log:
Use a Maven plugin to compute a security policy to enforce test hermeticity.

Modified:
    webservices/axiom/trunk/pom.xml
    webservices/axiom/trunk/systests/eclipse-tests/pom.xml
    webservices/axiom/trunk/systests/wildfly-tests/pom.xml

Modified: webservices/axiom/trunk/pom.xml
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/pom.xml?rev=1849791&r1=1849790&r2=1849791&view=diff
==============================================================================
--- webservices/axiom/trunk/pom.xml (original)
+++ webservices/axiom/trunk/pom.xml Thu Dec 27 09:29:31 2018
@@ -579,7 +579,7 @@
                              the data instead of loading it into memory). Obviously, the
execution time of
                              these tests also are proportional to the heap size. To accelerate
the execution
                              of the tests, we should use a heap size as small as possible.
-->
-                        <argLine>${argLine} -Xms16m -Xmx48m ${securityManagerArgs}</argLine>
+                        <argLine>${argLine} -Xms16m -Xmx48m</argLine>
                         <trimStackTrace>false</trimStackTrace>
                         <systemProperties>
                             <property>
@@ -619,7 +619,6 @@
                     <artifactId>maven-failsafe-plugin</artifactId>
                     <version>2.19</version>
                     <configuration>
-                        <argLine>${argLine} ${securityManagerArgs}</argLine>
                         <trimStackTrace>false</trimStackTrace>
                         <systemProperties>
                             <property>
@@ -938,51 +937,6 @@
                         </configuration>
                     </execution>
                     <execution>
-                        <id>generate-policy-file</id>
-                        <phase>generate-test-resources</phase>
-                        <goals>
-                            <goal>execute</goal>
-                        </goals>
-                        <configuration>
-                            <scripts>
-                                <script><![CDATA[
-                                    import static groovy.json.StringEscapeUtils.escapeJava
-                                    
-                                    if (project.packaging != 'pom' && project.properties['hermeticTests']
== 'true') {
-                                        new File(project.build.directory, "test.policy").withWriter
{ out ->
-                                            out.println "grant {"
-                                            out.println """  permission java.io.FilePermission
"${escapeJava(System.properties.'java.home')}\${/}-", "read";"""
-                                            out.println """  permission java.io.FilePermission
"${escapeJava(session.settings.localRepository)}\${/}-", "read";"""
-                                            session.sortedProjects.each({
-                                                out.println """  permission java.io.FilePermission
"${escapeJava(it.build.directory)}\${/}*", "read";"""
-                                            })
-                                            out.println """  permission java.io.FilePermission
"${escapeJava(project.basedir.absolutePath)}\${/}-", "read";"""
-                                            out.println """  permission java.io.FilePermission
"${escapeJava(project.build.directory)}", "read,write";"""
-                                            out.println """  permission java.io.FilePermission
"${escapeJava(project.build.directory)}\${/}-", "read,write,delete";"""
-                                            out.println """  permission java.lang.RuntimePermission
"*";"""
-                                            out.println """  permission java.lang.management.ManagementPermission
"monitor";"""
-                                            out.println """  permission java.lang.reflect.ReflectPermission
"*";"""
-                                            out.println """  permission java.net.NetPermission
"*";"""
-                                            out.println """  permission java.net.SocketPermission
"localhost", "connect,listen,accept,resolve";"""
-                                            out.println """  permission java.security.SecurityPermission
"*";"""
-                                            out.println """  permission java.util.PropertyPermission
"*", "read,write";"""
-                                            out.println """  permission javax.management.MBeanPermission
"*", "*";"""
-                                            out.println """  permission javax.management.MBeanServerPermission
"*";"""
-                                            out.println """  permission javax.management.MBeanTrustPermission
"*";"""
-                                            out.println """  permission javax.xml.ws.WebServicePermission
"publishEndpoint";"""
-                                            out.println """  permission org.osgi.framework.AdminPermission
"*", "*";"""
-                                            out.println """  permission org.osgi.framework.ServicePermission
"*", "register,get";"""
-                                            out.println "};"
-                                        }
-                                        project.properties['securityManagerArgs'] = '-Djava.security.manager
-Djava.security.policy=' + project.build.directory.replace('\\', '/') + '/test.policy'
-                                    } else {
-                                        project.properties['securityManagerArgs'] = ''
-                                    }
-                                ]]></script>
-                            </scripts>
-                        </configuration>
-                    </execution>
-                    <execution>
                         <id>check-tmp-dir</id>
                         <phase>verify</phase>
                         <goals>
@@ -1051,6 +1005,18 @@
                 </configuration>
             </plugin>
             <plugin>
+                <groupId>com.github.veithen.maven</groupId>
+                <artifactId>hermetic-maven-plugin</artifactId>
+                <version>0.1.0-SNAPSHOT</version>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>generate-policy</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
                 <groupId>org.codehaus.mojo</groupId>
                 <artifactId>animal-sniffer-maven-plugin</artifactId>
                 <version>1.17</version>

Modified: webservices/axiom/trunk/systests/eclipse-tests/pom.xml
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/systests/eclipse-tests/pom.xml?rev=1849791&r1=1849790&r2=1849791&view=diff
==============================================================================
--- webservices/axiom/trunk/systests/eclipse-tests/pom.xml (original)
+++ webservices/axiom/trunk/systests/eclipse-tests/pom.xml Thu Dec 27 09:29:31 2018
@@ -33,7 +33,7 @@
 
     <properties>
         <!-- TODO -->
-        <hermeticTests>false</hermeticTests>
+        <nonHermeticTests>true</nonHermeticTests>
     </properties>
 
     <repositories>

Modified: webservices/axiom/trunk/systests/wildfly-tests/pom.xml
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/systests/wildfly-tests/pom.xml?rev=1849791&r1=1849790&r2=1849791&view=diff
==============================================================================
--- webservices/axiom/trunk/systests/wildfly-tests/pom.xml (original)
+++ webservices/axiom/trunk/systests/wildfly-tests/pom.xml Thu Dec 27 09:29:31 2018
@@ -35,7 +35,7 @@
         <wildfly.version>14.0.1.Final</wildfly.version>
         <wildfly.home>${project.build.directory}/wildfly-${wildfly.version}</wildfly.home>
         <wildfly.jigsawArgs></wildfly.jigsawArgs>
-        <hermeticTests>false</hermeticTests>
+        <nonHermeticTests>true</nonHermeticTests>
     </properties>
 
     <dependencies>



Mime
View raw message