junit.framework.AssertionFailedError

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • The following Unit Test {{org.exoplatform.services.rest.ext.groovy.DefaultGroovyResourceLoaderTest#testLoadGroovySource}} fails when it is executing twice without clean up between the 2 executions. 1st time: ---- {code:java} $ mvn test -Dtest=DefaultGroovyResourceLoaderTest [INFO] Scanning for projects... [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building eXo PLF:: WS :: REST :: Extentions 2.6.x-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- maven-enforcer-plugin:1.0:enforce (enforce-java-version) @ exo.ws.rest.ext --- [INFO] [INFO] --- maven-enforcer-plugin:1.0:enforce (enforce-maven-version) @ exo.ws.rest.ext --- [INFO] [INFO] --- maven-resources-plugin:2.5:resources (default-resources) @ exo.ws.rest.ext --- [debug] execute contextualize [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] Copying 1 resource [INFO] [INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ exo.ws.rest.ext --- [INFO] Nothing to compile - all classes are up to date [INFO] [INFO] --- maven-antrun-plugin:1.6:run (default) @ exo.ws.rest.ext --- [INFO] Executing tasks main: [echo] Java Vendor System Prop: Oracle Corporation [echo] Java Version System Prop: 1.8.0_92 [INFO] Executed tasks [INFO] [INFO] --- maven-resources-plugin:2.5:testResources (default-testResources) @ exo.ws.rest.ext --- [debug] execute contextualize [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] Copying 9 resources [INFO] [INFO] --- maven-antrun-plugin:1.6:run (create-tmp-dir) @ exo.ws.rest.ext --- [WARNING] Parameter tasks is deprecated, use target instead [INFO] Executing tasks main: [INFO] Executed tasks [INFO] [INFO] --- maven-antrun-plugin:1.6:run (prepare-test-policy) @ exo.ws.rest.ext --- [INFO] Executing tasks main: [echo] Creating Access Policy for tests [copy] Copying 1 file to /srv/ciagent/workspace/target/test-classes [INFO] Executed tasks [INFO] [INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @ exo.ws.rest.ext --- [INFO] Compiling 1 source file to /srv/ciagent/workspace/target/test-classes [INFO] [INFO] --- maven-surefire-plugin:2.17:test (default-test) @ exo.ws.rest.ext --- [INFO] Surefire report directory: /srv/ciagent/workspace/target/surefire-reports ------------------------------------------------------- T E S T S ------------------------------------------------------- Running org.exoplatform.services.rest.ext.groovy.DefaultGroovyResourceLoaderTest A file 'tsm-excludes.properties' has been found 09.01.2017 09:49:17 *INFO * [main] StandaloneContainer: StandaloneContainer initialized using: file:/srv/ciagent/workspace/src/test/resources/conf/standalone/test-configuration.xml (StandaloneContainer.java, line 200) Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 9.824 sec - in org.exoplatform.services.rest.ext.groovy.DefaultGroovyResourceLoaderTest Results : Tests run: 1, Failures: 0, Errors: 0, Skipped: 0 [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 16.177s [INFO] Finished at: Mon Jan 09 09:49:21 UTC 2017 [INFO] Final Memory: 19M/990M [INFO] ------------------------------------------------------------------------ {code} 2nd time (no clean before) ---- {code:java} $ mvn test -Dtest=DefaultGroovyResourceLoaderTest [INFO] Scanning for projects... [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building eXo PLF:: WS :: REST :: Extentions 2.6.x-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- maven-enforcer-plugin:1.0:enforce (enforce-java-version) @ exo.ws.rest.ext --- [INFO] [INFO] --- maven-enforcer-plugin:1.0:enforce (enforce-maven-version) @ exo.ws.rest.ext --- [INFO] [INFO] --- maven-resources-plugin:2.5:resources (default-resources) @ exo.ws.rest.ext --- [debug] execute contextualize [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] Copying 1 resource [INFO] [INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ exo.ws.rest.ext --- [INFO] Nothing to compile - all classes are up to date [INFO] [INFO] --- maven-antrun-plugin:1.6:run (default) @ exo.ws.rest.ext --- [INFO] Executing tasks main: [echo] Java Vendor System Prop: Oracle Corporation [echo] Java Version System Prop: 1.8.0_92 [INFO] Executed tasks [INFO] [INFO] --- maven-resources-plugin:2.5:testResources (default-testResources) @ exo.ws.rest.ext --- [debug] execute contextualize [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] Copying 9 resources [INFO] [INFO] --- maven-antrun-plugin:1.6:run (create-tmp-dir) @ exo.ws.rest.ext --- [WARNING] Parameter tasks is deprecated, use target instead [INFO] Executing tasks main: [INFO] Executed tasks [INFO] [INFO] --- maven-antrun-plugin:1.6:run (prepare-test-policy) @ exo.ws.rest.ext --- [INFO] Executing tasks main: [echo] Creating Access Policy for tests [copy] Copying 1 file to /srv/ciagent/workspace/target/test-classes [INFO] Executed tasks [INFO] [INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @ exo.ws.rest.ext --- [INFO] Nothing to compile - all classes are up to date [INFO] [INFO] --- maven-surefire-plugin:2.17:test (default-test) @ exo.ws.rest.ext --- [INFO] Surefire report directory: /srv/ciagent/workspace/target/surefire-reports ------------------------------------------------------- T E S T S ------------------------------------------------------- Running org.exoplatform.services.rest.ext.groovy.DefaultGroovyResourceLoaderTest A file 'tsm-excludes.properties' has been found 09.01.2017 09:49:37 *INFO * [main] StandaloneContainer: StandaloneContainer initialized using: file:/srv/ciagent/workspace/src/test/resources/conf/standalone/test-configuration.xml (StandaloneContainer.java, line 200) Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 11.562 sec <<< FAILURE! - in org.exoplatform.services.rest.ext.groovy.DefaultGroovyResourceLoaderTest testLoadGroovySource(org.exoplatform.services.rest.ext.groovy.DefaultGroovyResourceLoaderTest) Time elapsed: 11.06 sec <<< FAILURE! junit.framework.AssertionFailedError: Expected: <null> but was: file:/srv/ciagent/workspace/target/test-classes/repo/MyClass.groovy at junit.framework.Assert.fail(Assert.java:50) at junit.framework.Assert.assertTrue(Assert.java:20) at junit.framework.Assert.assertNull(Assert.java:237) at junit.framework.Assert.assertNull(Assert.java:230) at org.exoplatform.services.rest.ext.groovy.DefaultGroovyResourceLoaderTest.testLoadGroovySource(DefaultGroovyResourceLoaderTest.java:47) Results : Failed tests: DefaultGroovyResourceLoaderTest.testLoadGroovySource:47 Expected: <null> but was: file:/srv/ciagent/workspace/target/test-classes/repo/MyClass.groovy Tests run: 1, Failures: 1, Errors: 0, Skipped: 0 [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 17.350s [INFO] Finished at: Mon Jan 09 09:49:41 UTC 2017 [INFO] Final Memory: 21M/990M [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.17:test (default-test) on project exo.ws.rest.ext: There are test failures. [ERROR] [ERROR] Please refer to /srv/ciagent/workspace/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 {code} It's due to the fact that this UT creates a file on the filesystem and doesn't delete it at the end of the test. There is no error on CI jobs but the sonar jobs fails because of that: * https://ci.exoplatform.org/job/PLF/view/sonar/job/ws-develop-sonar/50/console {code:java} testLoadGroovySource(org.exoplatform.services.rest.ext.groovy.DefaultGroovyResourceLoaderTest) Time elapsed: 0.024 sec <<< FAILURE! junit.framework.AssertionFailedError: Expected: <null> but was: file:/srv/ciagent/workspace/PLF/ws-develop-sonar/exo.ws.rest.ext/target/test-classes/repo/MyClass.groovy at junit.framework.Assert.fail(Assert.java:50) at junit.framework.Assert.assertTrue(Assert.java:20) at junit.framework.Assert.assertNull(Assert.java:237) at junit.framework.Assert.assertNull(Assert.java:230) at org.exoplatform.services.rest.ext.groovy.DefaultGroovyResourceLoaderTest.testLoadGroovySource(DefaultGroovyResourceLoaderTest.java:47) Running org.exoplatform.services.rest.ext.groovy.GroovyExoComponentTest Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.126 sec - in org.exoplatform.services.rest.ext.groovy.GroovyExoComponentTest Running org.exoplatform.services.rest.ext.provider.HierarchicalPropertyEntityProviderTest Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.019 sec - in org.exoplatform.services.rest.ext.provider.HierarchicalPropertyEntityProviderTest Running org.exoplatform.services.rest.ext.filter.UriNormalizationFilterTest Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.01 sec - in org.exoplatform.services.rest.ext.filter.UriNormalizationFilterTest Results : Failed tests: DefaultGroovyResourceLoaderTest.testLoadGroovySource:47 Expected: <null> but was: file:/srv/ciagent/workspace/PLF/ws-develop-sonar/exo.ws.rest.ext/target/test-classes/repo/MyClass.groovy Tests run: 13, Failures: 1, Errors: 0, Skipped: 0 [INFO] ------------------------------------------------------------------------ [INFO] Reactor Summary: [INFO] [INFO] eXo PLF:: WS ...................................... SUCCESS [3.237s] [INFO] eXo PLF:: WS :: Commons Utils ..................... SUCCESS [18.573s] [INFO] eXo PLF:: WS :: Framework :: JSON ................. SUCCESS [7.018s] [INFO] eXo PLF:: WS :: Framework :: Servlet .............. SUCCESS [2.108s] [INFO] eXo PLF:: WS :: HTTP :: testframework ............. SUCCESS [1.332s] [INFO] eXo PLF:: WS :: REST :: Core ...................... SUCCESS [23.842s] [INFO] eXo PLF:: WS :: REST :: Extentions ................ FAILURE [9.666s] [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 1:06.592s [INFO] Finished at: Sun Jan 08 08:11:59 UTC 2017 [INFO] Final Memory: 56M/957M [INFO] ------------------------------------------------------------------------ {code}
    via by Maxime Gréau,
  • GitHub comment 120#197254392
    via GitHub by cuter74
    ,
  • Impacted Cases ============== Reproduce Test Steps ==================== 1. use make_apk.py package HexGL. 2. click the app then quit. 3. click the app again. Expected Outcome ================ the app could launch successfully. Actual Outcome ============== the app crashed. Test Case Source Code ===================== Test Builds =========== Issue Analysis ============== The crash log: E/AndroidRuntime( 2816): FATAL EXCEPTION: AsyncTask #2 E/AndroidRuntime( 2816): Process: org.xwalk.hexgldemo, PID: 2816 E/AndroidRuntime( 2816): java.lang.RuntimeException: An error occured while executing doInBackground() E/AndroidRuntime( 2816): at android.os.AsyncTask$3.done(AsyncTask.java:300) E/AndroidRuntime( 2816): at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:355) E/AndroidRuntime( 2816): at java.util.concurrent.FutureTask.setException(FutureTask.java:222) E/AndroidRuntime( 2816): at java.util.concurrent.FutureTask.run(FutureTask.java:242) E/AndroidRuntime( 2816): at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231) E/AndroidRuntime( 2816): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) E/AndroidRuntime( 2816): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) E/AndroidRuntime( 2816): at java.lang.Thread.run(Thread.java:841) E/AndroidRuntime( 2816): Caused by: junit.framework.AssertionFailedError: Expected: <null> but was: org.xwalk.core.XWalkCoreWrapper@b3d23238 E/AndroidRuntime( 2816): at junit.framework.Assert.fail(Assert.java:50) E/AndroidRuntime( 2816): at junit.framework.Assert.assertTrue(Assert.java:20) E/AndroidRuntime( 2816): at junit.framework.Assert.assertNull(Assert.java:237) E/AndroidRuntime( 2816): at junit.framework.Assert.assertNull(Assert.java:230) E/AndroidRuntime( 2816): at org.xwalk.core.XWalkCoreWrapper.attachXWalkCore(XWalkCoreWrapper.java:77) E/AndroidRuntime( 2816): at org.xwalk.core.XWalkLibraryLoader$DockTask.doInBackground(XWalkLibraryLoader.java:283) E/AndroidRuntime( 2816): at org.xwalk.core.XWalkLibraryLoader$DockTask.doInBackground(XWalkLibraryLoader.java:264) E/AndroidRuntime( 2816): at android.os.AsyncTask$2.call(AsyncTask.java:288) E/AndroidRuntime( 2816): at java.util.concurrent.FutureTask.run(FutureTask.java:237)
    via by Dong Jun,
  • Impacted Cases ============== Reproduce Test Steps ==================== 1. use make_apk.py package HexGL. 2. click the app then quit. 3. click the app again. Expected Outcome ================ the app could launch successfully. Actual Outcome ============== the app crashed. Test Case Source Code ===================== Test Builds =========== Issue Analysis ============== The crash log: E/AndroidRuntime( 2816): FATAL EXCEPTION: AsyncTask #2 E/AndroidRuntime( 2816): Process: org.xwalk.hexgldemo, PID: 2816 E/AndroidRuntime( 2816): java.lang.RuntimeException: An error occured while executing doInBackground() E/AndroidRuntime( 2816): at android.os.AsyncTask$3.done(AsyncTask.java:300) E/AndroidRuntime( 2816): at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:355) E/AndroidRuntime( 2816): at java.util.concurrent.FutureTask.setException(FutureTask.java:222) E/AndroidRuntime( 2816): at java.util.concurrent.FutureTask.run(FutureTask.java:242) E/AndroidRuntime( 2816): at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231) E/AndroidRuntime( 2816): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) E/AndroidRuntime( 2816): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) E/AndroidRuntime( 2816): at java.lang.Thread.run(Thread.java:841) E/AndroidRuntime( 2816): Caused by: junit.framework.AssertionFailedError: Expected: <null> but was: org.xwalk.core.XWalkCoreWrapper@b3d23238 E/AndroidRuntime( 2816): at junit.framework.Assert.fail(Assert.java:50) E/AndroidRuntime( 2816): at junit.framework.Assert.assertTrue(Assert.java:20) E/AndroidRuntime( 2816): at junit.framework.Assert.assertNull(Assert.java:237) E/AndroidRuntime( 2816): at junit.framework.Assert.assertNull(Assert.java:230) E/AndroidRuntime( 2816): at org.xwalk.core.XWalkCoreWrapper.attachXWalkCore(XWalkCoreWrapper.java:77) E/AndroidRuntime( 2816): at org.xwalk.core.XWalkLibraryLoader$DockTask.doInBackground(XWalkLibraryLoader.java:283) E/AndroidRuntime( 2816): at org.xwalk.core.XWalkLibraryLoader$DockTask.doInBackground(XWalkLibraryLoader.java:264) E/AndroidRuntime( 2816): at android.os.AsyncTask$2.call(AsyncTask.java:288) E/AndroidRuntime( 2816): at java.util.concurrent.FutureTask.run(FutureTask.java:237)
    via by Dong Jun,
    • junit.framework.AssertionFailedError: Expected: <null> but was: file:/srv/ciagent/workspace/PLF/ws-develop-sonar/exo.ws.rest.ext/target/test-classes/repo/MyClass.groovy at junit.framework.Assert.fail(Assert.java:50) at junit.framework.Assert.assertTrue(Assert.java:20) at junit.framework.Assert.assertNull(Assert.java:237) at junit.framework.Assert.assertNull(Assert.java:230) at org.exoplatform.services.rest.ext.groovy.DefaultGroovyResourceLoaderTest.testLoadGroovySource(DefaultGroovyResourceLoaderTest.java:47)

    Users with the same issue

    odd
    1 times, last one,
    andyglick
    2 times, last one,
    Unknown User
    8 times, last one,
    Casper
    14 times, last one,
    Unknown visitor1 times, last one,
    27 more bugmates