1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.carrotsearch.randomizedtesting</groupId>
<artifactId>randomizedtesting-parent</artifactId>
<version>2.7.9</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<artifactId>randomizedtesting-security-manager-example</artifactId>
<name>RandomizedTesting Security Manager Example</name>
<description>
Simple use-case running with security manager
</description>
<properties>
<maven.deploy.skip>true</maven.deploy.skip>
</properties>
<dependencies>
<dependency>
<groupId>com.carrotsearch.randomizedtesting</groupId>
<artifactId>randomizedtesting-runner</artifactId>
<version>${project.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.carrotsearch.randomizedtesting</groupId>
<artifactId>junit4-ant</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>compile</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<executions>
<execution>
<id>default-test</id>
<phase>none</phase>
</execution>
</executions>
</plugin>
<!--
Set property of the url to each dependency
We use antrun to turn path into a proper URL (for windows with spaces etc)
-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>run</goal>
</goals>
<phase>pre-integration-test</phase>
<configuration>
<exportAntProperties>true</exportAntProperties>
<tasks>
<makeurl file="${junit:junit:jar}" property="junit.jar.url"/>
<makeurl file="${com.carrotsearch.randomizedtesting:junit4-ant:jar}" property="junit4.jar.url"/>
<makeurl file="${com.carrotsearch.randomizedtesting:randomizedtesting-runner:jar}" property="randomizedtesting.jar.url"/>
</tasks>
</configuration>
</execution>
</executions>
</plugin>
<!-- fail build in a clean way, if something gets screwed up -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<executions>
<execution>
<id>enforce-urls-were-set</id>
<goals>
<goal>enforce</goal>
</goals>
<phase>pre-integration-test</phase>
<configuration>
<rules>
<requireProperty>
<property>junit.jar.url</property>
<property>junit4.jar.url</property>
<property>randomizedtesting.jar.url</property>
</requireProperty>
</rules>
</configuration>
</execution>
</executions>
</plugin>
<!-- Run tests with JUnit4 under security manager -->
<plugin>
<groupId>com.carrotsearch.randomizedtesting</groupId>
<artifactId>junit4-maven-plugin</artifactId>
<version>${project.version}</version>
<executions>
<execution>
<id>junit4-tests</id>
<goals>
<goal>junit4</goal>
</goals>
<!-- run in integration-test phase, so jars are "like production" for permission -->
<phase>integration-test</phase>
<configuration>
<leaveTemporary>false</leaveTemporary>
<haltOnFailure>true</haltOnFailure>
<!-- Our tests are in primary classes folder. -->
<!-- <testClassesDirectory>${project.build.outputDirectory}</testClassesDirectory> -->
<!-- Attach a simple listener. -->
<listeners>
<report-text
showThrowable="true"
showStackTraces="true"
showOutput="onerror"
showStatusOk="true"
showStatusError="true"
showStatusFailure="true"
showStatusIgnored="true"
showSuiteSummary="false">
<filtertrace enabled="false"/>
</report-text>
<!-- JSON report with HTML scaffolding. -->
<report-json file="${project.build.directory}/result-json/results.html" />
</listeners>
<assertions>
<enable package="com.carrotsearch"/>
</assertions>
<!-- do all system properties here, to avoid policy hell! -->
<jvmArgs>
<param>-Djava.security.manager</param>
<param>-Djava.security.policy==${project.basedir}/security.policy</param>
<param>-Djava.security.debug=all</param>
<param>-Djunit.jar.url=${junit.jar.url}</param>
<param>-Djunit4.jar.url=${junit4.jar.url}</param>
<param>-Drandomizedtesting.jar.url=${randomizedtesting.jar.url}</param>
</jvmArgs>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
|