I'm trying to run mvn test on a submodule from the parent module, specifying the tests (actually 1 test) that I want to run.
the command:
mvn -pl :tika-parsers test -DfailIfNoTests=false -Dtest=org.apache.tika.detect.TestContainerAwareDetector
The problem is that for some reason no test is running.
The build report:
...
...
...
[INFO] --- maven-surefire-plugin:2.12:test (default-test) # tika-parsers ---
[INFO] Surefire report directory: C:\Users\user\Code\Python\BugMiner\tested_project\tika\tika-parsers\target\surefire-reports
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Results :
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
[INFO] ------------------------------------------------------------------------
... ... ...
When Im running:
mvn -pl :tika-parsers test
All the tests are running including the one I specified
The build report:
...
...
...
[INFO] --- maven-surefire-plugin:2.12:test (default-test) # tika-parsers ---
[INFO] Surefire report directory: C:\Users\user\Code\Python\BugMiner\tested_project\tika\tika-parsers\target\surefire-reports
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running org.apache.tika.detect.TestContainerAwareDetector
Tests run: 15, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 3.293 sec
Running org.apache.tika.embedder.ExternalEmbedderTest
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.015 sec
Running org.apache.tika.mime.MimeTypesTest
Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.016 sec
Running org.apache.tika.mime.MimeTypeTest
...
...
...
Can anyone show me what is the proper command?
This is a surefire version 2.12 bug.
Upgrade the surefire plugin in the pom.xml file:
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.0</version>
<configuration>
...
</configuration>
</plugin>
I think your command is good and shall work, try downgrading OR upgrading your surefire version and this shall solve the problem for you.
Related
Env
java
$ java -version
java version "1.8.0_241"
Java(TM) SE Runtime Environment (build 1.8.0_241-b07)
Java HotSpot(TM) 64-Bit Server VM (build 25.241-b07, mixed mode)
maven
$ mvn -version
Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Maven home: C:\Program Files\JetBrains\IntelliJ IDEA 2019.2.3\plugins\maven\lib\maven3
Java version: 1.8.0_231, vendor: Oracle Corporation, runtime: C:\Program Files\Java\jdk1.8.0_231\jre
Default locale: zh_CN, platform encoding: GBK
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"
pom.xml -- Forked from spockframework/spock-example
Problem
I forked spockframework/spock-example add java test directory and HelloJUnitTest.java => sunzy/spock-exmaple
the Spock Tests can execute,but JUnit Tests can't
Snapshots
mvn clean test
only spock tests!
mvn clean test -Dtest=HelloJUnitTest
JUnit Test had generate in target/test-classes*
mvn clean test -Dtest=HelloSpocSpec
mvn -X include test-clasess
Okay, I have taken a look at your project. As you said, it is just the Spock sample project, upgraded to run Spock 2 tests. BTW, it still should be upgraded further, because in the current configuration compilation does not work with current Java versions, but that is off topic here, I am just mentioning it because I ran into a problem and then downgraded to Java 8 in order quickly reproduce your actual problem. The JUnit test's package name is not the problem either, even though the default package is always ugly, just like for the Spock tests.
Spock 1.x is based on JUnit 4, but Spock 2.x is based on JUnit 5 platform. This is also the one automatically found by Surefire when analysing the project dependencies. If you want Surefire to run multiple engines in parallel, you need to configure the corresponding providers as plugin dependencies, as mentioned here.
In your case, just add this to the POM:
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M4</version>
<configuration>
<useFile>false</useFile>
<includes>
<include>**/*Test.java</include>
<include>**/*Spec.java</include>
</includes>
</configuration>
<!-- Run Spock 2 and JUnit 4 tests in parallel -->
<dependencies>
<dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>surefire-junit47</artifactId>
<version>3.0.0-M4</version>
</dependency>
<dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>surefire-junit-platform</artifactId>
<version>3.0.0-M4</version>
</dependency>
</dependencies>
</plugin>
It also makes sense to explicitly add a test-scoped dependency to JUnit 4.12 or 4.13 to your POM because JUnit 4.12 is only a transitive dependency in your current POM. But later Spock 2 versions might remove that dependency because it is not really needed. I think that already happened with 2.0-M3. So be careful.
After this change, Maven says:
[INFO] --- maven-surefire-plugin:3.0.0-M4:test (default-test) # spock-example ---
[INFO]
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO] Running HelloJUnitTest
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.059 s - in HelloJUnitTest
[INFO]
[INFO] Results:
[INFO]
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO]
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO] Running DatabaseDrivenSpec
[INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.171 s - in DatabaseDrivenSpec
(...)
[INFO]
[INFO] Results:
[INFO]
[INFO] Tests run: 39, Failures: 0, Errors: 0, Skipped: 0
If you decide to upgrade from JUnit 4 to 5, maybe configuration gets easier for you because then both Spock and JUnit use the same provider. In that case please add a JUnit 5 dependency so your tests can import the corresponding test annotations and assertion methods.
Update: After #khmarbaise commented on using vintage engine and me fully agreeing that it is the better solution, I want to show you how to do that instead of adding plugin dependencies to Surefire. (So you can delete those if you want to use this solution):
<dependency> <!-- only required if you want to run JUnit 4 tests alongside Spock 2 -->
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<version>5.5.2</version>
<scope>test</scope>
</dependency>
Why version 5.5.2 and not e.g. 5.6.2? In order to avoid version conflicts and subsequent warnings about vintage engine not finding tests in the Groovy directory. This is just because the POM in this sample project still uses a Spock 2.0-M1 BOM. As I said, it ought to be updated. But with this version it just works because it depends on the same JUnit 5 platform version as Spock in this configuration.
BTW, now Maven executes the Spock tests first and then the JUnit 4 tests, so the log output for both would be in reverse order.
I've checked out the latest Apache Directory-server trunk and am trying to get packaging working. I made a trivial change (i.e. added a new class) in protocol-ntp. When I run mvn package in protocol-ntp, the resulting jar in target contains the new class.
However, I'm having trouble getting the new class to be present in the jar containing all the projects. When I run mvn package inside the all folder, it "successfully" packages but the jar file (which does have an updated timestamp) contains only the old projects, without the new class. Running mvn package in the trunk root directory yields the following error:
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running org.apache.directory.ldap.client.template.LdapConnectionTemplateTest
Tests run: 9, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 7.718 sec - in org.apache.directory.ldap.client.template.LdapConnectionTemplateTest
Running org.apache.directory.shared.client.api.AdsSchemaLoaderTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 4.378 sec - in org.apache.directory.shared.client.api.AdsSchemaLoaderTest
Running org.apache.directory.shared.client.api.LdapConnectionPoolTest
Tests run: 3, Failures: 0, Errors: 0, Skipped: 1, Time elapsed: 5.171 sec - in org.apache.directory.shared.client.api.LdapConnectionPoolTest
Running org.apache.directory.shared.client.api.LdapConnectionTest
Tests run: 13, Failures: 1, Errors: 0, Skipped: 1, Time elapsed: 64.625 sec <<< FAILURE! - in org.apache.directory.shared.client.api.LdapConnectionTest
testConnectionWrongHost(org.apache.directory.shared.client.api.LdapConnectionTest) Time elapsed: 30.056 sec <<< FAILURE!
java.lang.AssertionError: Expected exception: org.apache.directory.ldap.client.api.exception.InvalidConnectionException
at org.junit.internal.runners.statements.ExpectException.evaluate(ExpectException.java:32)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.apache.directory.server.core.integ.FrameworkRunner.runChild(FrameworkRunner.java:391)
at org.apache.directory.server.core.integ.FrameworkRunner.runChild(FrameworkRunner.java:64)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.apache.directory.server.core.integ.FrameworkRunner.run(FrameworkRunner.java:164)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:283)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:173)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:128)
at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:203)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
Running org.apache.directory.shared.client.api.LdapSSLConnectionTest
Tests run: 11, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 4.409 sec - in org.apache.directory.shared.client.api.LdapSSLConnectionTest
Running org.apache.directory.shared.client.api.LightweightLdapConnectionPoolTest
Max Active connections =: 8
Tests run: 6, Failures: 0, Errors: 0, Skipped: 5, Time elapsed: 3.851 sec - in org.apache.directory.shared.client.api.LightweightLdapConnectionPoolTest
Running org.apache.directory.shared.client.api.operations.bind.SimpleBindRequestTest
Tests run: 21, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 5.147 sec - in org.apache.directory.shared.client.api.operations.bind.SimpleBindRequestTest
Running org.apache.directory.shared.client.api.operations.ClientAbandonRequestTest
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 36.442 sec - in org.apache.directory.shared.client.api.operations.ClientAbandonRequestTest
Running org.apache.directory.shared.client.api.operations.ClientAddRequestTest
Tests run: 11, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 6.067 sec - in org.apache.directory.shared.client.api.operations.ClientAddRequestTest
Running org.apache.directory.shared.client.api.operations.ClientCompareRequestTest
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 3.913 sec - in org.apache.directory.shared.client.api.operations.ClientCompareRequestTest
Running org.apache.directory.shared.client.api.operations.ClientDeleteRequestTest
Tests run: 7, Failures: 0, Errors: 0, Skipped: 2, Time elapsed: 4.525 sec - in org.apache.directory.shared.client.api.operations.ClientDeleteRequestTest
Running org.apache.directory.shared.client.api.operations.ClientExtendedRequestTest
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 3.875 sec - in org.apache.directory.shared.client.api.operations.ClientExtendedRequestTest
Running org.apache.directory.shared.client.api.operations.ClientModifyDnRequestTest
Tests run: 9, Failures: 0, Errors: 0, Skipped: 2, Time elapsed: 4.896 sec - in org.apache.directory.shared.client.api.operations.ClientModifyDnRequestTest
Running org.apache.directory.shared.client.api.operations.ClientModifyRequestTest
Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 5.234 sec - in org.apache.directory.shared.client.api.operations.ClientModifyRequestTest
Running org.apache.directory.shared.client.api.operations.ConcurrentSearchAndUnbindTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 1, Time elapsed: 4.257 sec - in org.apache.directory.shared.client.api.operations.ConcurrentSearchAndUnbindTest
Running org.apache.directory.shared.client.api.operations.GetRootDseTest
Tests run: 9, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 4.234 sec - in org.apache.directory.shared.client.api.operations.GetRootDseTest
Running org.apache.directory.shared.client.api.operations.search.AnonymousClientSearchRequestTest
Tests run: 10, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 4.928 sec - in org.apache.directory.shared.client.api.operations.search.AnonymousClientSearchRequestTest
Running org.apache.directory.shared.client.api.operations.search.ClientSearchRequestTest
Tests run: 11, Failures: 0, Errors: 0, Skipped: 1, Time elapsed: 5.169 sec - in org.apache.directory.shared.client.api.operations.search.ClientSearchRequestTest
Running org.apache.directory.shared.client.api.operations.search.OperationWithIndexTest
Tests run: 6, Failures: 0, Errors: 0, Skipped: 1, Time elapsed: 21.043 sec - in org.apache.directory.shared.client.api.operations.search.OperationWithIndexTest
Running org.apache.directory.shared.client.api.operations.search.SearchRequestReturningAttributesTest
Tests run: 13, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 4.254 sec - in org.apache.directory.shared.client.api.operations.search.SearchRequestReturningAttributesTest
Running org.apache.directory.shared.client.api.operations.search.SearchWithReferralsTest
Tests run: 7, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 7.803 sec - in org.apache.directory.shared.client.api.operations.search.SearchWithReferralsTest
Running org.apache.directory.shared.client.api.ServerSchemaLoaderTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 4.399 sec - in org.apache.directory.shared.client.api.ServerSchemaLoaderTest
Running org.apache.directory.shared.client.api.ValidatingLdapConnectionPoolTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 4.835 sec - in org.apache.directory.shared.client.api.ValidatingLdapConnectionPoolTest
Results :
Failed tests:
LdapConnectionTest.testConnectionWrongHost Expected exception: org.apache.directory.ldap.client.api.exception.InvalidConnectionException
Tests run: 162, Failures: 1, Errors: 0, Skipped: 14
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] ApacheDS Protocol Ntp .............................. SUCCESS [ 4.451 s]
[INFO] Apacheds Server Annotations ........................ SUCCESS [ 34.057 s]
[INFO] ApacheDS Server Config ............................. SUCCESS [ 12.769 s]
[INFO] ApacheDS Server JNDI ............................... SUCCESS [ 1.720 s]
[INFO] ApacheDS Test Framework ............................ SUCCESS [01:09 min]
[INFO] ApacheDS All ....................................... SUCCESS [ 3.743 s]
[INFO] ApacheDS Logger Interceptor ........................ SUCCESS [ 1.962 s]
[INFO] ApacheDS Password Hashing Interceptor .............. SUCCESS [ 1.046 s]
[INFO] ApacheDS Core Integration .......................... SUCCESS [14:02 min]
[INFO] ApacheDS Protocol Kerberos Test .................... SUCCESS [ 27.092 s]
[INFO] ApacheDS Server Integration ........................ SUCCESS [10:50 min]
[INFO] ApacheDS DirectoryService-WebApp bridge ............ SUCCESS [ 0.723 s]
[INFO] ApacheDS Jetty HTTP Server Integration ............. SUCCESS [ 1.341 s]
[INFO] ApacheDS Service Builder ........................... SUCCESS [ 3.739 s]
[INFO] Apache Directory LDAP Client API test .............. FAILURE [03:44 min]
[INFO] kerberos-client .................................... SKIPPED
[INFO] ApacheDS Service ................................... SKIPPED
[INFO] ApacheDS Wrapper ................................... SKIPPED
[INFO] ApacheDS Installers Maven Plugin ................... SKIPPED
[INFO] ApacheDS Installers ................................ SKIPPED
[INFO] ApacheDS OSGi Integration Tests .................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 31:21 min
[INFO] Finished at: 2017-04-25T21:53:52-04:00
[INFO] Final Memory: 118M/1407M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.18.1:test (default-test) on project ldap-client-test: There are test failures.
[ERROR]
[ERROR] Please refer to /media/DataDrive/Projects/Parclock/git-repos/directory-server/ldap-client-test/target/surefire-reports for the individual test results.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :ldap-client-test
Any ideas on how I can get this working?
I was able to solve the problem by running mvn package in the root project directory with -Dmaven.test.skip=true
I need to be able to use the profile activated during the run time of JUnit tests.
I was wondering if there is any way of doing something like:
String str = System.getProperty("activated.profile[0]");
Or any other relative way...
I realized there is an option to use ${project.profiles[0].id} bu somehow it's not working.
Any ideas?
When using surefire to run the unit tests, it usually spawns a new JVM to run the tests, and we have to pass the information to the new JVM. This can be done usually using the "systemPropertyVariables" tag.
I was able to exercise this using a quickstart Java project, where I added this to the POM:
I declared the following profiles
<profiles>
<profile>
<id>special-profile1</id>
</profile>
<profile>
<id>special-profile2</id>
</profile>
</profiles>
And this to surefire configuration:
<build>
<plugins>
...
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.19</version>
<configuration>
<systemPropertyVariables>
<profileId>${project.activeProfiles[0].id}</profileId>
</systemPropertyVariables>
</configuration>
</plugin>
...
</plugins>
</build>
And in my unit test, I added this:
/**
* Rigourous Test :-)
*/
public void testApp()
{
System.out.println("Profile ID: " + System.getProperty("profileId"));
}
When invoking the "test" command without profile (i.e. using mvn test), I got this:
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running com.fxs.AppTest
Profile ID: development
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.003 sec - in com.fxs.AppTest
Results :
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
And we I used mvn -P special-profile2 test, I got this
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running com.fxs.AppTest
Profile ID: special-profile2
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.002 sec - in com.fxs.AppTest
Results :
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
This will pass along the name of the first active profile. If we have potentially more than one active profiles, then we will probably need to use more system properties.
Note: I tested this using Maven 3.1.1
I other cases I used next in pom file:
<profiles>
<profile>
<id>a-profile-id</id>
<properties>
<flag>a-flag-value</flag>
</properties>
</profile>
</profiles>
and in java:
String flagValue = System.getenv("flag");
I have a DBUnit program that is not able to find an xml file located in src/test/resources folder.
Maven Folder Structure
src/test/java - StateDaoTest.java
src/test/resources - dataset.xml
Upon compiling the project I see that both the following files in target/test-classes folder:
StateDaoTest.class
dataset.xml
This is error log I see when I run the test:
Error Log:
Running StateDaoTest
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.451 sec <<< FAILURE!
testGetStateByStateCode(StateDaoTest) Time elapsed: 0.02 sec <<< ERROR!
java.io.FileNotFoundException: dataset.xml (The specified path is invalid)
pom.xml
<build>
<finalName>${project.artifactId}</finalName>
<testResources>
<testResource>
<directory>${project.basedir}/src/test/resources</directory>
</testResource>
</testResources>
.....
Can somebody please guide ?
I try to build Jenkins project with netBeans but have the same problem all the time.... Multiples tests fails during the building of project. I put descriptions of some fails.
Running hudson.cli.ConnectionMockTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.138 sec - in hudson.cli.ConnectionMockTest
Running hudson.cli.ConnectionTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.14 sec - in hudson.cli.ConnectionTest
Running hudson.cli.PrivateKeyProviderTest
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.655 sec <<< FAILURE! - in hudson.cli.PrivateKeyProviderTest
initializationError(hudson.cli.PrivateKeyProviderTest) Time elapsed: 0.015 sec <<< ERROR!
java.lang.IllegalStateException: Failed to transform class with name hudson.cli.CLI. Reason: java.io.IOException: invalid constant type: 15
at org.powermock.core.classloader.MockClassLoader.loadMockClass(MockClassLoader.java:207)
at org.powermock.core.classloader.MockClassLoader.loadModifiedClass(MockClassLoader.java:145)
at org.powermock.core.classloader.DeferSupportingClassLoader.loadClass(DeferSupportingClassLoader.java:65)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:340)
at sun.reflect.generics.factory.CoreReflectionFactory.makeNamedType(CoreReflectionFactory.java:114)
at sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:125)
at sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:49)
at sun.reflect.annotation.AnnotationParser.parseSig(AnnotationParser.java:439)
at sun.reflect.annotation.AnnotationParser.parseClassValue(AnnotationParser.java:420)
at sun.reflect.annotation.AnnotationParser.parseClassArray(AnnotationParser.java:724)
at sun.reflect.annotation.AnnotationParser.parseArray(AnnotationParser.java:531)
at sun.reflect.annotation.AnnotationParser.parseMemberValue(AnnotationParser.java:355)
at sun.reflect.annotation.AnnotationParser.parseAnnotation2(AnnotationParser.java:286)
at sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:120)
at sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:72)
at java.lang.Class.createAnnotationData(Class.java:3508)
at java.lang.Class.annotationData(Class.java:3497)
at java.lang.Class.getAnnotation(Class.java:3402)
at org.junit.internal.MethodSorter.getDeclaredMethods(MethodSorter.java:52)
at org.junit.internal.runners.TestClass.getAnnotatedMethods(TestClass.java:45)
at org.junit.internal.runners.MethodValidator.validateTestMethods(MethodValidator.java:71)
at org.junit.internal.runners.MethodValidator.validateStaticMethods(MethodValidator.java:44)
at org.junit.internal.runners.MethodValidator.validateMethodsForDefaultRunner(MethodValidator.java:50)
at org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl.validate(PowerMockJUnit44RunnerDelegateImpl.java:108)
at org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl.<init>(PowerMockJUnit44RunnerDelegateImpl.java:70)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:408)
at org.powermock.modules.junit4.common.internal.impl.JUnit4TestSuiteChunkerImpl.createDelegatorFromClassloader(JUnit4TestSuiteChunkerImpl.java:144)
at org.powermock.modules.junit4.common.internal.impl.JUnit4TestSuiteChunkerImpl.createDelegatorFromClassloader(JUnit4TestSuiteChunkerImpl.java:39)
at org.powermock.tests.utils.impl.AbstractTestSuiteChunkerImpl.createTestDelegators(AbstractTestSuiteChunkerImpl.java:217)
at org.powermock.modules.junit4.common.internal.impl.JUnit4TestSuiteChunkerImpl.<init>(JUnit4TestSuiteChunkerImpl.java:59)
at org.powermock.modules.junit4.common.internal.impl.AbstractCommonPowerMockRunner.<init>(AbstractCommonPowerMockRunner.java:32)
at org.powermock.modules.junit4.PowerMockRunner.<init>(PowerMockRunner.java:26)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:408)
at org.junit.internal.builders.AnnotatedBuilder.buildRunner(AnnotatedBuilder.java:29)
at org.junit.internal.builders.AnnotatedBuilder.runnerForClass(AnnotatedBuilder.java:21)
at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:26)
at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:26)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:262)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:124)
at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:200)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
Results :
Tests in error:
PrivateKeyProviderTest.initializationError ยป IllegalState Failed to transform ...
Tests run: 3, Failures: 0, Errors: 1, Skipped: 0
------------------------------------------------------------------------
Reactor Summary:
Jenkins main module ............................... SUCCESS [1.996s]
Jenkins CLI ....................................... FAILURE [11.240s]
Jenkins core ...................................... SKIPPED
Jenkins war ....................................... SKIPPED
Test harness for Jenkins and plugins .............. SKIPPED
Jenkins plugin POM ................................ SKIPPED
------------------------------------------------------------------------
BUILD FAILURE
------------------------------------------------------------------------
Total time: 15.449s
Finished at: Mon Oct 06 09:14:39 EDT 2014
Final Memory: 25M/471M
------------------------------------------------------------------------
Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.16:test (default-test) on project cli: There are test failures.
Please refer to C:\Users\ystavcha\Desktop\newClone\jenkins\cli\target\surefire-reports for the individual test results.
-> [Help 1]
To see the full stack trace of the errors, re-run Maven with the -e switch.
Re-run Maven using the -X switch to enable full debug logging.
For more information about the errors and possible solutions, please read the following articles:
[Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
It might be related to Powermock version. Try upgrading the version.