Hi,
I wrote some test cases. It gives the expected
results when i run it as a JUnit plug-in test using Eclipse IDE. But,
when i run it with Maven (mvn clean install -P e42 -e) the test cases
fail. What would be the reason?
Following is the console output form the test cases execution.
-------------------------------------------------------
T
E S T S
-------------------------------------------------------
Running
org.eclipse.recommenders.test.snipmatch.handlers.CommandHandlerTest
Tests
run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.047 sec
Running
org.eclipse.recommenders.test.snipmatch.rcp.UserEnvironmentTest
Tests run: 2, Failures: 0, Errors: 2, Skipped: 0, Time elapsed:
0.044 sec <<< FAILURE!
Results :
Tests
in error:
testIsJavaEditor(org.eclipse.recommenders.test.snipmatch.rcp.UserEnvironmentTest):
Workbench has not been created yet.
testGetSearchBoxAnchor(org.eclipse.recommenders.test.snipmatch.rcp.UserEnvironmentTest):
Workbench has not been created yet.
Tests run:
3, Failures: 0, Errors: 2, Skipped: 0
[INFO]
------------------------------------------------------------------------
[INFO]
Reactor Summary:
[INFO]
[INFO]
org.eclipse.recommenders.snipmatch.rcp ............ SUCCESS [14.087s]
[INFO] org.eclipse.recommenders.tests.snipmatch.rcp ...... FAILURE
[12.661s]
[INFO]
org.eclipse.recommenders.feature.snipmatch.rcp .... SKIPPED
[INFO]
snipmatch-aggregator .............................. SKIPPED
[INFO]
------------------------------------------------------------------------
[INFO]
BUILD FAILURE
[INFO]
------------------------------------------------------------------------
[INFO]
Total time: 1:26.893s
[INFO] Finished at: Tue Jun 25 19:32:30 IST 2013
[INFO]
Final Memory: 111M/255M
[INFO]
------------------------------------------------------------------------
[ERROR]
Failed to execute goal
org.eclipse.tycho:tycho-surefire-plugin:0.18.0:test (default-test) on
project org.eclipse.recommenders.tests.snipmatch.
rcp: There are test failures.
[ERROR]
[ERROR]
Please refer to
E:\GSoC\EclipseRCP\git\SnipMatch\tests\org.eclipse.recommenders.tests.snipmatch.rcp\target\surefire-reports
for the individual
test results.
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException:
Failed to execute goal
org.eclipse.tycho:tycho-surefire-plugin:0.18.0:test (default-test) on p
roject
org.eclipse.recommenders.tests.snipmatch.rcp: There are test failures.
Please refer to
E:\GSoC\EclipseRCP\git\SnipMatch\tests\org.eclipse.recommenders.tests.snipmatch.rcp\target\surefire-reports
for the individual test re
sults.
at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:213)
at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at
org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at
org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at
org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at
org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at
org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at
org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at
org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at
org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused
by: org.apache.maven.plugin.MojoFailureException: There are test
failures.
Please refer to
E:\GSoC\EclipseRCP\git\SnipMatch\tests\org.eclipse.recommenders.tests.snipmatch.rcp\target\surefire-reports
for the individual test re
sults.
at
org.eclipse.tycho.surefire.TestMojo.runTest(TestMojo.java:800)
at
org.eclipse.tycho.surefire.TestMojo.execute(TestMojo.java:560)
at
org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
... 19 more
[ERROR]
[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]
[ERROR]
After correcting the problems, you can resume the build with the
command
[ERROR] mvn <goals> -rf
:org.eclipse.recommenders.tests.snipmatch.rcp
E:\GSoC\EclipseRCP\git\SnipMatch>