java.lang.AssertionError: expected:<17> but was:<3>

QOS.ch JIRA | Ceki Gülcü | 12 months ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    {code}Feb 26, 2016 10:16:58 PM org.slf4j.impl.MultithreadedInitializationTest multiThreadedInitialization INFO: hello Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.949 sec <<< FAILURE! - in org.slf4j.impl.MultithreadedInitializationTest multiThreadedInitialization(org.slf4j.impl.MultithreadedInitializationTest) Time elapsed: 0.33 sec <<< FAILURE! java.lang.AssertionError: expected:<17> but was:<3> at org.junit.Assert.fail(Assert.java:93) at org.junit.Assert.failNotEquals(Assert.java:647) at org.junit.Assert.assertEquals(Assert.java:128) at org.junit.Assert.assertEquals(Assert.java:472) at org.junit.Assert.assertEquals(Assert.java:456) at org.slf4j.impl.MultithreadedInitializationTest.multiThreadedInitialization(MultithreadedInitializationTest.java:91) 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:616) ... at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:238) at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:161) at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:290) at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:242) at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:121) Results : Failed tests: MultithreadedInitializationTest.multiThreadedInitialization:91 expected:<17> but was:<3> {code}

    QOS.ch JIRA | 12 months ago | Ceki Gulcu
    java.lang.AssertionError: expected:<17> but was:<3>
  2. 0

    {code}Feb 26, 2016 10:16:58 PM org.slf4j.impl.MultithreadedInitializationTest multiThreadedInitialization INFO: hello Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.949 sec <<< FAILURE! - in org.slf4j.impl.MultithreadedInitializationTest multiThreadedInitialization(org.slf4j.impl.MultithreadedInitializationTest) Time elapsed: 0.33 sec <<< FAILURE! java.lang.AssertionError: expected:<17> but was:<3> at org.junit.Assert.fail(Assert.java:93) at org.junit.Assert.failNotEquals(Assert.java:647) at org.junit.Assert.assertEquals(Assert.java:128) at org.junit.Assert.assertEquals(Assert.java:472) at org.junit.Assert.assertEquals(Assert.java:456) at org.slf4j.impl.MultithreadedInitializationTest.multiThreadedInitialization(MultithreadedInitializationTest.java:91) 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:616) ... at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:238) at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:161) at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:290) at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:242) at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:121) Results : Failed tests: MultithreadedInitializationTest.multiThreadedInitialization:91 expected:<17> but was:<3> {code}

    QOS.ch JIRA | 12 months ago | Ceki Gülcü
    java.lang.AssertionError: expected:<17> but was:<3>
  3. 0

    MultithreadedInitializationTest in slf4j-simple fails (see below) because SimpleLogger.init method is called via SimpleLoggerFactory.getLogger. Thus SimpleLogger may be used before it is actually initialized. {code} ------------------------------------------------------- T E S T S ------------------------------------------------------- Running org.slf4j.InvocationTest Running org.slf4j.impl.SimpleLoggerTest Running org.slf4j.impl.MultithreadedInitializationTest Running org.slf4j.DetectLoggerNameMismatchTest Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.284 sec - in org.slf4j.InvocationTest testNullParameter_BUG78(org.slf4j.InvocationTest) Time elapsed: 0.064 sec testNull(org.slf4j.InvocationTest) Time elapsed: 0.008 sec testMarker(org.slf4j.InvocationTest) Time elapsed: 0.004 sec test2(org.slf4j.InvocationTest) Time elapsed: 0.001 sec testMDC(org.slf4j.InvocationTest) Time elapsed: 0.002 sec test1(org.slf4j.InvocationTest) Time elapsed: 0 sec THREAD_COUNT=8 Exception in thread "Thread-7" java.lang.NullPointerException at org.slf4j.impl.SimpleLogger.write(SimpleLogger.java:378) at org.slf4j.impl.SimpleLogger.log(SimpleLogger.java:373) at org.slf4j.impl.SimpleLogger.info(SimpleLogger.java:534) at org.slf4j.impl.MultithreadedInitializationTest$LoggerAccessingThread.run(MultithreadedInitializationTest.java:119) SLF4J: A number (6) of logging calls during the initialization phase have been intercepted and are SLF4J: now being replayed. These are suject to the filtering rules of the underlying logging system. SLF4J: See also http://www.slf4j.org/codes.html#replay [Thread-0] INFO org.slf4j.impl.MultithreadedInitializationTest$LoggerAccessingThread-1 - in run method [Thread-0] INFO org.slf4j.impl.MultithreadedInitializationTest$LoggerAccessingThread-6 - in run method [Thread-0] INFO org.slf4j.impl.MultithreadedInitializationTest$LoggerAccessingThread-3 - in run method [Thread-0] INFO org.slf4j.impl.MultithreadedInitializationTest$LoggerAccessingThread-4 - in run method [Thread-0] INFO org.slf4j.impl.MultithreadedInitializationTest$LoggerAccessingThread-2 - in run method [Thread-0] INFO org.slf4j.impl.MultithreadedInitializationTest$LoggerAccessingThread-5 - in run method [Thread-0] INFO org.slf4j.impl.MultithreadedInitializationTest$LoggerAccessingThread-0 - in run method [main] INFO org.slf4j.impl.MultithreadedInitializationTest$LoggerAccessingThread-0 - post harness [main] INFO org.slf4j.impl.MultithreadedInitializationTest$LoggerAccessingThread-1 - post harness [main] INFO org.slf4j.impl.MultithreadedInitializationTest$LoggerAccessingThread-2 - post harness [main] INFO org.slf4j.impl.MultithreadedInitializationTest$LoggerAccessingThread-3 - post harness [main] INFO org.slf4j.impl.MultithreadedInitializationTest$LoggerAccessingThread-4 - post harness [main] INFO org.slf4j.impl.MultithreadedInitializationTest$LoggerAccessingThread-5 - post harness [main] INFO org.slf4j.impl.MultithreadedInitializationTest$LoggerAccessingThread-6 - post harness [main] INFO org.slf4j.impl.MultithreadedInitializationTest$LoggerAccessingThread-7 - post harness [main] INFO org.slf4j.impl.MultithreadedInitializationTest.slowInitialization-9350 - hello Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.208 sec <<< FAILURE! - in org.slf4j.impl.MultithreadedInitializationTest multiThreadedInitialization(org.slf4j.impl.MultithreadedInitializationTest) Time elapsed: 0.05 sec <<< FAILURE! java.lang.AssertionError: expected:<19> but was:<25> at org.junit.Assert.fail(Assert.java:93) at org.junit.Assert.failNotEquals(Assert.java:647) at org.junit.Assert.assertEquals(Assert.java:128) at org.junit.Assert.assertEquals(Assert.java:472) at org.junit.Assert.assertEquals(Assert.java:456) at org.slf4j.impl.MultithreadedInitializationTest.multiThreadedInitialization(MultithreadedInitializationTest.java:84) 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:606) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:30) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222) at org.junit.runners.ParentRunner.run(ParentRunner.java:300) at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:367) at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:274) at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:238) at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:161) at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:290) at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:242) at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:121) Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.248 sec - in org.slf4j.impl.SimpleLoggerTest emptyLoggerName(org.slf4j.impl.SimpleLoggerTest) Time elapsed: 0.022 sec loggerNameWithNoDots_WithLevel(org.slf4j.impl.SimpleLoggerTest) Time elapsed: 0 sec loggerNameWithOneDotShouldInheritFromParent(org.slf4j.impl.SimpleLoggerTest) Time elapsed: 0.001 sec loggerNameWithNoDots_WithNoSetLevel(org.slf4j.impl.SimpleLoggerTest) Time elapsed: 0 sec loggerNameWithOneDot_NoSetLevel(org.slf4j.impl.SimpleLoggerTest) Time elapsed: 0.004 sec Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.229 sec - in org.slf4j.DetectLoggerNameMismatchTest testPassIfMatch(org.slf4j.DetectLoggerNameMismatchTest) Time elapsed: 0.021 sec verifyLoggerDefinedInBaseWithOverridenGetClassMethod(org.slf4j.DetectLoggerNameMismatchTest) Time elapsed: 0.001 sec testNoTriggerWithoutProperty(org.slf4j.DetectLoggerNameMismatchTest) Time elapsed: 0.004 sec testTriggerWithProperty(org.slf4j.DetectLoggerNameMismatchTest) Time elapsed: 0.001 sec testTriggerWholeMessage(org.slf4j.DetectLoggerNameMismatchTest) Time elapsed: 0 sec Results : Failed tests: MultithreadedInitializationTest.multiThreadedInitialization:84 expected:<19> but was:<25> {code}

    QOS.ch JIRA | 1 year ago | Ceki Gulcu
    java.lang.AssertionError: expected:<19> but was:<25>
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    MultithreadedInitializationTest in slf4j-simple fails (see below) because SimpleLogger.init method is called via SimpleLoggerFactory.getLogger. Thus SimpleLogger may be used before it is actually initialized. {code} ------------------------------------------------------- T E S T S ------------------------------------------------------- Running org.slf4j.InvocationTest Running org.slf4j.impl.SimpleLoggerTest Running org.slf4j.impl.MultithreadedInitializationTest Running org.slf4j.DetectLoggerNameMismatchTest Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.284 sec - in org.slf4j.InvocationTest testNullParameter_BUG78(org.slf4j.InvocationTest) Time elapsed: 0.064 sec testNull(org.slf4j.InvocationTest) Time elapsed: 0.008 sec testMarker(org.slf4j.InvocationTest) Time elapsed: 0.004 sec test2(org.slf4j.InvocationTest) Time elapsed: 0.001 sec testMDC(org.slf4j.InvocationTest) Time elapsed: 0.002 sec test1(org.slf4j.InvocationTest) Time elapsed: 0 sec THREAD_COUNT=8 Exception in thread "Thread-7" java.lang.NullPointerException at org.slf4j.impl.SimpleLogger.write(SimpleLogger.java:378) at org.slf4j.impl.SimpleLogger.log(SimpleLogger.java:373) at org.slf4j.impl.SimpleLogger.info(SimpleLogger.java:534) at org.slf4j.impl.MultithreadedInitializationTest$LoggerAccessingThread.run(MultithreadedInitializationTest.java:119) SLF4J: A number (6) of logging calls during the initialization phase have been intercepted and are SLF4J: now being replayed. These are suject to the filtering rules of the underlying logging system. SLF4J: See also http://www.slf4j.org/codes.html#replay [Thread-0] INFO org.slf4j.impl.MultithreadedInitializationTest$LoggerAccessingThread-1 - in run method [Thread-0] INFO org.slf4j.impl.MultithreadedInitializationTest$LoggerAccessingThread-6 - in run method [Thread-0] INFO org.slf4j.impl.MultithreadedInitializationTest$LoggerAccessingThread-3 - in run method [Thread-0] INFO org.slf4j.impl.MultithreadedInitializationTest$LoggerAccessingThread-4 - in run method [Thread-0] INFO org.slf4j.impl.MultithreadedInitializationTest$LoggerAccessingThread-2 - in run method [Thread-0] INFO org.slf4j.impl.MultithreadedInitializationTest$LoggerAccessingThread-5 - in run method [Thread-0] INFO org.slf4j.impl.MultithreadedInitializationTest$LoggerAccessingThread-0 - in run method [main] INFO org.slf4j.impl.MultithreadedInitializationTest$LoggerAccessingThread-0 - post harness [main] INFO org.slf4j.impl.MultithreadedInitializationTest$LoggerAccessingThread-1 - post harness [main] INFO org.slf4j.impl.MultithreadedInitializationTest$LoggerAccessingThread-2 - post harness [main] INFO org.slf4j.impl.MultithreadedInitializationTest$LoggerAccessingThread-3 - post harness [main] INFO org.slf4j.impl.MultithreadedInitializationTest$LoggerAccessingThread-4 - post harness [main] INFO org.slf4j.impl.MultithreadedInitializationTest$LoggerAccessingThread-5 - post harness [main] INFO org.slf4j.impl.MultithreadedInitializationTest$LoggerAccessingThread-6 - post harness [main] INFO org.slf4j.impl.MultithreadedInitializationTest$LoggerAccessingThread-7 - post harness [main] INFO org.slf4j.impl.MultithreadedInitializationTest.slowInitialization-9350 - hello Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.208 sec <<< FAILURE! - in org.slf4j.impl.MultithreadedInitializationTest multiThreadedInitialization(org.slf4j.impl.MultithreadedInitializationTest) Time elapsed: 0.05 sec <<< FAILURE! java.lang.AssertionError: expected:<19> but was:<25> at org.junit.Assert.fail(Assert.java:93) at org.junit.Assert.failNotEquals(Assert.java:647) at org.junit.Assert.assertEquals(Assert.java:128) at org.junit.Assert.assertEquals(Assert.java:472) at org.junit.Assert.assertEquals(Assert.java:456) at org.slf4j.impl.MultithreadedInitializationTest.multiThreadedInitialization(MultithreadedInitializationTest.java:84) 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:606) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:30) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222) at org.junit.runners.ParentRunner.run(ParentRunner.java:300) at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:367) at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:274) at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:238) at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:161) at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:290) at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:242) at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:121) Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.248 sec - in org.slf4j.impl.SimpleLoggerTest emptyLoggerName(org.slf4j.impl.SimpleLoggerTest) Time elapsed: 0.022 sec loggerNameWithNoDots_WithLevel(org.slf4j.impl.SimpleLoggerTest) Time elapsed: 0 sec loggerNameWithOneDotShouldInheritFromParent(org.slf4j.impl.SimpleLoggerTest) Time elapsed: 0.001 sec loggerNameWithNoDots_WithNoSetLevel(org.slf4j.impl.SimpleLoggerTest) Time elapsed: 0 sec loggerNameWithOneDot_NoSetLevel(org.slf4j.impl.SimpleLoggerTest) Time elapsed: 0.004 sec Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.229 sec - in org.slf4j.DetectLoggerNameMismatchTest testPassIfMatch(org.slf4j.DetectLoggerNameMismatchTest) Time elapsed: 0.021 sec verifyLoggerDefinedInBaseWithOverridenGetClassMethod(org.slf4j.DetectLoggerNameMismatchTest) Time elapsed: 0.001 sec testNoTriggerWithoutProperty(org.slf4j.DetectLoggerNameMismatchTest) Time elapsed: 0.004 sec testTriggerWithProperty(org.slf4j.DetectLoggerNameMismatchTest) Time elapsed: 0.001 sec testTriggerWholeMessage(org.slf4j.DetectLoggerNameMismatchTest) Time elapsed: 0 sec Results : Failed tests: MultithreadedInitializationTest.multiThreadedInitialization:84 expected:<19> but was:<25> {code}

    QOS.ch JIRA | 1 year ago | Ceki Gülcü
    java.lang.AssertionError: expected:<19> but was:<25>

  1. jf-ast 3 times, last 2 weeks ago
  2. treefolk 3 times, last 2 weeks ago
  3. kjhdofjosvs 1 times, last 1 month ago
  4. MoYapro 3 times, last 2 months ago
  5. andyglick 1 times, last 2 months ago
5 more registered users
32 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.lang.AssertionError

    expected:<17> but was:<3>

    at org.junit.Assert.fail()
  2. JUnit
    Assert.assertEquals
    1. org.junit.Assert.fail(Assert.java:93)
    2. org.junit.Assert.failNotEquals(Assert.java:647)
    3. org.junit.Assert.assertEquals(Assert.java:128)
    4. org.junit.Assert.assertEquals(Assert.java:472)
    5. org.junit.Assert.assertEquals(Assert.java:456)
    5 frames
  3. SLF4J LOG4J-12 Binding
    MultithreadedInitializationTest.multiThreadedInitialization
    1. org.slf4j.impl.MultithreadedInitializationTest.multiThreadedInitialization(MultithreadedInitializationTest.java:91)
    1 frame
  4. Java RT
    Method.invoke
    1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    4. java.lang.reflect.Method.invoke(Method.java:616)
    4 frames