Uploaded image for project: 'Spring Framework'
  1. Spring Framework
  2. SPR-9991

AdvisorAdapterRegistrationTests fails intermittently under Java 7

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: 3.1.3
    • Fix Version/s: None
    • Component/s: [Build], Core:AOP
    • Labels:
      None
    • Last commented by a User:
      false

      Description

      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.

      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.

      ERROR Details

      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)
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                cbeams Chris Beams
                Reporter:
                daveboden David Boden
                Last updater:
                Chris Beams
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  6 years, 5 weeks ago