java.lang.AssertionError: Should throw UnknownAdviceTypeException

Spring JIRA | David Boden | 4 years ago
  1. 0

    h4. Overview Building with Maven under Java 6, the {{testAdvisorAdapterRegistrationManagerNotPresentInContext()}} method in {{AdvisorAdapterRegistrationTests}} consistently passes. Building under Java 7 (e.g., JDK 1.7.0_06), it sometimes passes but most of the time throws the error detailed below. The failure is due to the test *running* under Java 7 and has nothing to do with the compilation. h4. Steps to recreate Please note that to recreate the issue you *must* run at least both the tests in {{AdvisorAdapterRegistrationTests}} *together*. The problem has something to do with the interaction between the two tests. If you just run the {{testAdvisorAdapterRegistrationManagerNotPresentInContext()}} method on its own (in Eclipse) then it'll pass every time. * In Eclipse select the {{AdvisorAdapterRegistrationTests}} class and say "run as JUnit test". You'll see it succeed. * Go to the _Run Configuration_ menu and under the JRE tab select an Alternate JRE of a Java 7 runtime. * Repeat the run using your updated run configuration. You'll see a test failure. * If you run it 10 times, you'll probably see it succeed one or two times. h4. ERROR Details {noformat} java.lang.AssertionError: Should throw UnknownAdviceTypeException at org.junit.Assert.fail(Assert.java:93) at org.springframework.aop.framework.adapter.AdvisorAdapterRegistrationTests.testAdvisorAdapterRegistrationManagerNotPresentInContext(AdvisorAdapterRegistrationTests.java:49) 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.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:69) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:48) 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:292) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197) {noformat}

    Spring JIRA | 4 years ago | David Boden
    java.lang.AssertionError: Should throw UnknownAdviceTypeException
  2. 0

    h4. Overview Building with Maven under Java 6, the {{testAdvisorAdapterRegistrationManagerNotPresentInContext()}} method in {{AdvisorAdapterRegistrationTests}} consistently passes. Building under Java 7 (e.g., JDK 1.7.0_06), it sometimes passes but most of the time throws the error detailed below. The failure is due to the test *running* under Java 7 and has nothing to do with the compilation. h4. Steps to recreate Please note that to recreate the issue you *must* run at least both the tests in {{AdvisorAdapterRegistrationTests}} *together*. The problem has something to do with the interaction between the two tests. If you just run the {{testAdvisorAdapterRegistrationManagerNotPresentInContext()}} method on its own (in Eclipse) then it'll pass every time. * In Eclipse select the {{AdvisorAdapterRegistrationTests}} class and say "run as JUnit test". You'll see it succeed. * Go to the _Run Configuration_ menu and under the JRE tab select an Alternate JRE of a Java 7 runtime. * Repeat the run using your updated run configuration. You'll see a test failure. * If you run it 10 times, you'll probably see it succeed one or two times. h4. ERROR Details {noformat} java.lang.AssertionError: Should throw UnknownAdviceTypeException at org.junit.Assert.fail(Assert.java:93) at org.springframework.aop.framework.adapter.AdvisorAdapterRegistrationTests.testAdvisorAdapterRegistrationManagerNotPresentInContext(AdvisorAdapterRegistrationTests.java:49) 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.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:69) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:48) 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:292) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197) {noformat}

    Spring JIRA | 4 years ago | David Boden
    java.lang.AssertionError: Should throw UnknownAdviceTypeException
  3. 0

    current master does not build eureka-core

    GitHub | 2 years ago | george-smith
    java.lang.AssertionError: Apps size from remote regions do not match expected: [2] but was:[1]
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Flaky unit tests

    GitHub | 3 years ago | samuelgruetter
    java.lang.AssertionError: should not have received exception
  6. 0

    Non-deterministic SynchronizedObserver.runConcurrencyTest

    GitHub | 3 years ago | benjchristensen
    java.lang.AssertionError: Concurrency test failed: expected:<173500> but was:<151756>

  1. andyglick 7 times, last 3 months ago
  2. tfr 4 times, last 5 months ago
9 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

    Should throw UnknownAdviceTypeException

    at org.junit.Assert.fail()
  2. JUnit
    Assert.fail
    1. org.junit.Assert.fail(Assert.java:93)
    1 frame
  3. Spring AOP
    AdvisorAdapterRegistrationTests.testAdvisorAdapterRegistrationManagerNotPresentInContext
    1. org.springframework.aop.framework.adapter.AdvisorAdapterRegistrationTests.testAdvisorAdapterRegistrationManagerNotPresentInContext(AdvisorAdapterRegistrationTests.java:49)
    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:601)
    4 frames
  5. JUnit
    ParentRunner.run
    1. org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
    2. org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
    3. org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
    4. org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
    5. org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
    6. org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:69)
    7. org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:48)
    8. org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
    9. org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
    10. org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
    11. org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
    12. org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
    13. org.junit.runners.ParentRunner.run(ParentRunner.java:292)
    13 frames
  6. JUnit4 Runner
    JUnit4TestReference.run
    1. org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
    1 frame
  7. JUnit3 Runner
    RemoteTestRunner.main
    1. org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
    2. org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
    3. org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
    4. org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
    5. org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
    5 frames