1 2 Previous Next 19 Replies Latest reply on Mar 5, 2008 3:48 PM by Kabir Khan

    aop-mc-int tests failing on annotation parsing

    Adrian Brock Master

      The aop-mc-int tests rerun the mc tests with the aop configuration.

      The parsing of annotations to create metadata is failing in these tests.

      Ales can either you or Kabir take a look at it and decide whose problem it is,
      Thanks.

      Note also this issue with Maven problems:
      http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4133819#4133819

        • 1. Re: aop-mc-int tests failing on annotation parsing
          Ales Justin Master

           

          "adrian@jboss.org" wrote:

          The parsing of annotations to create metadata is failing in these tests.

          Ales can either you or Kabir take a look at it and decide whose problem it is,

          Can you just point me to the few tests that are failing?
          I'll have a look and see who's fault it really is.


          • 2. Re: aop-mc-int tests failing on annotation parsing
            Adrian Brock Master

             

            [ejort@warjort jboss-mdr]$ grep -ri FAILURE ~/microcontainer/aop-mc-int/target/surefire-reports/no-weave/org.jboss.test.microcontainer.test.MicrocontainerAllTestCase.txt
            Tests run: 1138, Failures: 14, Errors: 0, Skipped: 0, Time elapsed: 36.476 sec <<< FAILURE!
            testCustomCollectionPreInstantiated(org.jboss.test.kernel.config.test.CollectionAnnotationTestCase) Time elapsed: 0.353 sec <<< FAILURE!
            testCustomSetPreInstantiated(org.jboss.test.kernel.config.test.SetAnnotationTestCase) Time elapsed: 0.27 sec <<< FAILURE!
            testCustomListPreInstantiated(org.jboss.test.kernel.config.test.ListAnnotationTestCase) Time elapsed: 0.223 sec <<< FAILURE!
            testCustomMapPreInstantiated(org.jboss.test.kernel.config.test.MapAnnotationTestCase) Time elapsed: 0.241 sec <<< FAILURE!
            testComplicatedLifecycleDependencyCorrectOrder(org.jboss.test.kernel.dependency.test.ComplicatedLifecycleDependencyAnnotationTestCase) Time elapsed: 0.048 sec <<< FAILURE!
            testComplicatedLifecycleDependencyWrongOrder(org.jboss.test.kernel.dependency.test.ComplicatedLifecycleDependencyAnnotationTestCase) Time elapsed: 0.03 sec <<< FAILURE!
            testComplicatedLifecycleDependencyReinstall(org.jboss.test.kernel.dependency.test.ComplicatedLifecycleDependencyAnnotationTestCase) Time elapsed: 0.057 sec <<< FAILURE!
            testKernelControllerContextAware(org.jboss.test.kernel.dependency.test.KernelControllerContextAwareAnnotationTestCase) Time elapsed: 0.044 sec <<< FAILURE!
            testClassAnnotationNoOverride(org.jboss.test.kernel.metadata.test.ClassAnnotationTestCase) Time elapsed: 0.049 sec <<< FAILURE!
            testClassAnnotationOverride(org.jboss.test.kernel.metadata.test.ClassAnnotationTestCase) Time elapsed: 0.038 sec <<< FAILURE!
            testClassAnnotationNew(org.jboss.test.kernel.metadata.test.ClassAnnotationTestCase) Time elapsed: 0.04 sec <<< FAILURE!
            testPropertyAnnotationNoOverride(org.jboss.test.kernel.metadata.test.ClassAnnotationTestCase) Time elapsed: 0.022 sec <<< FAILURE!
            testPropertyAnnotationOverride(org.jboss.test.kernel.metadata.test.ClassAnnotationTestCase) Time elapsed: 0.02 sec <<< FAILURE!
            testPropertyAnnotationNew(org.jboss.test.kernel.metadata.test.ClassAnnotationTestCase) Time elapsed: 0.042 sec <<< FAILURE!
            


            • 3. Re: aop-mc-int tests failing on annotation parsing
              Ales Justin Master

              Anything else that this '-Djava.system.class.loader=org.jboss.aop.standalone.SystemClassLoader' that needs setting?

              • 4. Re: aop-mc-int tests failing on annotation parsing
                Ales Justin Master

                 

                "alesj" wrote:
                Anything else that this '-Djava.system.class.loader=org.jboss.aop.standalone.SystemClassLoader' that needs setting?

                OK, getting the same failures as you, so it looks like that's enough.

                • 5. Re: aop-mc-int tests failing on annotation parsing
                  Ales Justin Master

                   

                  testCustomCollectionPreInstantiated(org.jboss.test.kernel.config.test.CollectionAnnotationTestCase)
                   Time elapsed: 0.353 sec <<< FAILURE!
                  testCustomSetPreInstantiated(org.jboss.test.kernel.config.test.SetAnnotationTestCase) Time elapsed:
                   0.27 sec <<< FAILURE!
                  testCustomListPreInstantiated(org.jboss.test.kernel.config.test.ListAnnotationTestCase) Time elapse
                  d: 0.223 sec <<< FAILURE!
                  testCustomMapPreInstantiated(org.jboss.test.kernel.config.test.MapAnnotationTestCase) Time elapsed:
                   0.241 sec <<< FAILURE!
                  


                  The problem with those is Kabir's problem. :-)

                  The test fails since there is null collection on the collection where there is only setter (no getter).
                  The actual non-null/non-empty collection argument gets pushed into ReflectionUtils.invoke(method, target, args), where the target is AOPContainerProxy. And the actual underlying delegate, FromPreinst(some_collection)SimpleBean, gets called. But the result of this setter invocation doesn't show in the proxy itself.

                  • 6. Re: aop-mc-int tests failing on annotation parsing
                    Ales Justin Master

                     

                    testComplicatedLifecycleDependencyCorrectOrder(org.jboss.test.kernel.dependency.test.ComplicatedLifecycleDependencyAnnotationTestCase) Time elapsed: 0.048 sec <<< FAILURE!
                    testComplicatedLifecycleDependencyWrongOrder(org.jboss.test.kernel.dependency.test.ComplicatedLifecycleDependencyAnnotationTestCase) Time elapsed: 0.03 sec <<< FAILURE!
                    testComplicatedLifecycleDependencyReinstall(org.jboss.test.kernel.dependency.test.ComplicatedLifecycleDependencyAnnotationTestCase) Time elapsed: 0.057 sec <<< FAILURE!
                    


                    Similar problem.
                    The proxy doesn't reflect delegate's field changes.

                    bean5: org.jboss.test.kernel.dependency.support.SimpleBeanWithComplicatedLifecycle = {org.jboss.test.kernel.dependency.support.AOPContainerProxy$0@1792}"org.jboss.test.kernel.dependency.support.AnnotatedSimpleBeanWithComplicatedLifecycle@1b044df (proxied by org.jboss.test.kernel.dependency.support.AOPContainerProxy$0@9b777a)"
                    mixins: java.lang.Object[] = null
                    delegate: org.jboss.test.kernel.dependency.support.AnnotatedSimpleBeanWithComplicatedLifecycle = {org.jboss.test.kernel.dependency.support.AnnotatedSimpleBeanWithComplicatedLifecycle@1032}
                     createOrder: int = 9
                     startOrder: int = 10
                     stopOrder: int = -1
                     destroyOrder: int = -1
                     createBean: org.jboss.test.kernel.dependency.support.SimpleBeanWithLifecycle = {org.jboss.test.kernel.dependency.support.SimpleBeanWithLifecycle@1487}
                     startBean: org.jboss.test.kernel.dependency.support.SimpleBeanWithLifecycle = {org.jboss.test.kernel.dependency.support.SimpleBeanWithLifecycle@1789}
                     stopBean: org.jboss.test.kernel.dependency.support.SimpleBeanWithLifecycle = null
                     destroyBean: org.jboss.test.kernel.dependency.support.SimpleBeanWithLifecycle = null
                    currentAdvisor: org.jboss.aop.Advisor = {org.jboss.aop.proxy.container.InstanceProxyContainer@1802}
                    classAdvisor: org.jboss.aop.Advisor = {org.jboss.aop.proxy.container.ClassProxyContainer@1803}
                    metadata: org.jboss.aop.metadata.SimpleMetaData = null
                    instanceAdvisor: org.jboss.aop.InstanceAdvisor = {org.jboss.aop.proxy.container.InstanceProxyContainer@1802}
                    createOrder: int = -1
                    startOrder: int = -1
                    stopOrder: int = -1
                    destroyOrder: int = -1
                    createBean: org.jboss.test.kernel.dependency.support.SimpleBeanWithLifecycle = null
                    startBean: org.jboss.test.kernel.dependency.support.SimpleBeanWithLifecycle = null
                    stopBean: org.jboss.test.kernel.dependency.support.SimpleBeanWithLifecycle = null
                    destroyBean: org.jboss.test.kernel.dependency.support.SimpleBeanWithLifecycle = null
                    

                    e.g. see delegate.createOrder vs. bean5.createOrder.

                    • 7. Re: aop-mc-int tests failing on annotation parsing
                      Adrian Brock Master

                      Ok.

                      Do you want to raise a bug report telling what you found and assign it to Kabir.

                      It's strange that these are all annotation tests?????

                      If its passed the arguments to the target then it isn't an MC or test issue
                      (unless you are somehow checking the wrong target).

                      • 8. Re: aop-mc-int tests failing on annotation parsing
                        Ales Justin Master

                         

                        "adrian@jboss.org" wrote:

                        Do you want to raise a bug report telling what you found and assign it to Kabir.

                        Sure.
                        Just waiting to catch him on the IM.

                        "adrian@jboss.org" wrote:

                        It's strange that these are all annotation tests?????

                        Yup, looks like my fault. :-)
                        But I don't do anything extraordinary.
                        There is always just a simple super class that overrides some of the behavior of the actual class that holds the variables.
                        e.g overriding create method to add @Create annotation, instead of doing that via xml

                        "adrian@jboss.org" wrote:

                        If its passed the arguments to the target then it isn't an MC or test issue
                        (unless you are somehow checking the wrong target).

                        How could I check the wrong target?
                        My target is ControllerContext.getTarget(), which is, when AOP-MC-int is present, a proxy created by AOPConstructorJoinpoint.

                        • 9. Re: aop-mc-int tests failing on annotation parsing
                          Ales Justin Master

                           

                          "alesj" wrote:

                          "adrian@jboss.org" wrote:

                          It's strange that these are all annotation tests?????

                          Yup, looks like my fault. :-)

                          And this one - ClassAnnotationTestCase - is all yours. :-)

                          You are peeking MetaData in the TestClassAnnotation constructor.
                          And in the test you expect this MetaData not to be null - assertPeekedMetaData.
                          But the AOPConstructorJoinpoint masks the MetaData just before it creates the instance.


                          • 10. Re: aop-mc-int tests failing on annotation parsing
                            Ales Justin Master

                            The last one

                            testKernelControllerContextAware(org.jboss.test.kernel.dependency.test.KernelControllerContextAwareAnnotationTestCase) Time elapsed: 0.044 sec <<< FAILURE!

                            is the same problem as the previous mentioned - delegate vs. proxy.

                            • 11. Re: aop-mc-int tests failing on annotation parsing
                              Adrian Brock Master

                               

                              "alesj" wrote:
                              "alesj" wrote:

                              "adrian@jboss.org" wrote:

                              It's strange that these are all annotation tests?????

                              Yup, looks like my fault. :-)

                              And this one - ClassAnnotationTestCase - is all yours. :-)

                              You are peeking MetaData in the TestClassAnnotation constructor.
                              And in the test you expect this MetaData not to be null - assertPeekedMetaData.
                              But the AOPConstructorJoinpoint masks the MetaData just before it creates the instance.


                              I don't really understand this? The test was added at the same time as a change
                              to the AOPConstructorJoinpoint (so it must have worked at some point unless
                              I'm stupid? :-)

                              The test hasn't changed since, but the joinpoint factory has changed a lot.

                              Choose one of:
                              * the test only worked by fluke and later fixes found the problem - so it started failing
                              and nobody raised an issue
                              * or the test never worked - and its been failing for 14 months without comment

                              Either way, it doesn't fill me confidence. ;-(

                              It's a stupid test anyway. The purpose is to make sure the metadata
                              is populated properly from the class/xml

                              It uses the push of the metadata (for AOP to pickup under the wire) to get this information.

                              It would be the same if it just did:

                              ControllerContext context = .assertInstalledContext("name");
                              ScopeKey scope = context.getScopeInfo()...;
                              MetaData md = repository.getMetaData(scope);


                              • 12. Re: aop-mc-int tests failing on annotation parsing
                                Ales Justin Master

                                 

                                "adrian@jboss.org" wrote:

                                I don't really understand this? The test was added at the same time as a change
                                to the AOPConstructorJoinpoint (so it must have worked at some point unless
                                I'm stupid? :-)

                                The test hasn't changed since, but the joinpoint factory has changed a lot.

                                Choose one of:
                                * the test only worked by fluke and later fixes found the problem - so it started failing
                                and nobody raised an issue
                                * or the test never worked - and its been failing for 14 months without comment

                                I have no idea how this ever worked - with AOP enabled. :-)
                                Since it does exactly what I wrote.
                                I don't see where you could pull out non-null MetaData, after you mask it in the AOPConstructorJoinpoint, and all you have is
                                 public static void peekMetaData()
                                 {
                                 peekedMetaData = MetaDataStack.peek();
                                 }
                                

                                in AbstractMetaDataTest.
                                Who's only usage is in TestClassAnnotation constructor.

                                • 13. Re: aop-mc-int tests failing on annotation parsing
                                  Ales Justin Master

                                   

                                  "adrian@jboss.org" wrote:

                                  It's a stupid test anyway. The purpose is to make sure the metadata
                                  is populated properly from the class/xml

                                  It uses the push of the metadata (for AOP to pickup under the wire) to get this information.

                                  It would be the same if it just did:

                                  ControllerContext context = .assertInstalledContext("name");
                                  ScopeKey scope = context.getScopeInfo()...;
                                  MetaData md = repository.getMetaData(scope);

                                  OK, since it's not AOP usage that we're testing there, I've changed the test to get the MetaData in the following way:
                                   protected MetaData assertMetaData(String name)
                                   {
                                   KernelControllerContext context = getControllerContext(name);
                                   assertNotNull(context);
                                   ScopeInfo scopeInfo = context.getScopeInfo();
                                   assertNotNull(scopeInfo);
                                   MetaData metaData = scopeInfo.getMetaData();
                                   assertNotNull(metaData);
                                   return metaData;
                                   }
                                  


                                  • 14. Re: aop-mc-int tests failing on annotation parsing
                                    Adrian Brock Master

                                     

                                    "alesj" wrote:
                                    "adrian@jboss.org" wrote:

                                    (so it must have worked at some point unless I'm stupid? :-)

                                    I have no idea how this ever worked - with AOP enabled. :-)


                                    The logical conclusion is incontrovertable (proof by contradication)

                                    Can you make sure bug reports get raised for the failing tests please.
                                    It's not very good when you're changing something important and the
                                    testsuite already has lots of failures.

                                    1 2 Previous Next