9 Replies Latest reply on Mar 29, 2008 5:03 PM by Ales Justin

    PropertyReplaceTC failing in maven

    Ales Justin Master

      Does anyone else get this failure when running test in maven (+ Winz XP):

      -------------------------------------------------------------------------------
      Test set: org.jboss.test.kernel.config.test.PropertyReplaceTestCase
      -------------------------------------------------------------------------------
      Tests run: 3, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.046 sec <<< FAILURE!
      testAnnotationPropertyReplace(org.jboss.test.kernel.config.test.PropertyReplaceTestCase) Time elapsed: 0.016 sec <<< FAILURE!
      junit.framework.ComparisonFailure: null expected:<test.[PropertyReplaceTestCase].Name> but was:<test.[${test.property.value}].Name>
       at junit.framework.Assert.assertEquals(Assert.java:81)
       at junit.framework.Assert.assertEquals(Assert.java:87)
       at org.jboss.test.kernel.config.test.PropertyReplaceTestCase.testAnnotationPropertyReplace(PropertyReplaceTestCase.java:88)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at junit.framework.TestCase.runTest(TestCase.java:168)
       at junit.framework.TestCase.runBare(TestCase.java:134)
       at junit.framework.TestResult$1.protect(TestResult.java:110)
       at junit.framework.TestResult.runProtected(TestResult.java:128)
       at junit.framework.TestResult.run(TestResult.java:113)
       at junit.framework.TestCase.run(TestCase.java:124)
       at junit.framework.TestSuite.runTest(TestSuite.java:232)
       at junit.framework.TestSuite.run(TestSuite.java:227)
       at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
       at junit.extensions.TestSetup$1.protect(TestSetup.java:23)
       at junit.framework.TestResult.runProtected(TestResult.java:128)
       at junit.extensions.TestSetup.run(TestSetup.java:27)
       at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)
       at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
       at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
       at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
       at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338)
       at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997)
      
      


      It passes for me in IDE and on my Linux box.
      But been getting this for a while now, and I think I already 'complained' about it a while ago, but just cannot find the post anymore.

      Any ideas of what can go wrong?
      Or is this just another maven cl hick-up?

        • 1. Re: PropertyReplaceTC failing in maven
          Adrian Brock Master

           

          "alesj" wrote:

          It passes for me in IDE and on my Linux box.
          But been getting this for a while now, and I think I already 'complained' about it a while ago, but just cannot find the post anymore.

          Any ideas of what can go wrong?
          Or is this just another maven cl hick-up?


          I had a similar issue in the classloading tests under Maven.
          IIRC Paul updated the surefire plugin to fix it?

          Maybe the fix doesn't work on Windows?
          Do the classloading-vfs tests fail for you as well?

          Also I saw an issue when doing the releases last week where it wasn't using the jar plugin
          defined in build/pom.xml instead it was getting it from org.jboss:jboss-parent
          which was older and broken.

          The same could be happening here?
          mc/build/pom.xml == 2.4.1 surefire plugin
          jboss-parent:4-beta-1 == 2.3

          • 2. Re: PropertyReplaceTC failing in maven
            Scott Stark Master

            I see the same failure on osx, so its not windows specific.

            • 3. Re: PropertyReplaceTC failing in maven
              Scott Stark Master

              I added some logging to the setting of the system property and the issue is that the tests are being run in an order different than the declared method order. Because of this, the system property was not getting set prior to the testAnnotationPropertyReplace. I pulled the setting to a separate private method that is now also called by testAnnotationPropertyReplace and the tests pass on osx.

              • 4. Re: PropertyReplaceTC failing in maven
                Ales Justin Master

                 

                "adrian@jboss.org" wrote:

                Do the classloading-vfs tests fail for you as well?

                Yeah, but it's old-reflection-creeping-in or too-new-kernel issue.
                Haven't seen your problem (yet).

                -------------------------------------------------------------------------------
                Test set: org.jboss.test.classloading.vfs.metadata.test.ModuleDependencyUnitTestCase
                -------------------------------------------------------------------------------
                Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.594 sec <<< FAILURE!
                org.jboss.test.classloading.vfs.metadata.test.ModuleDependencyUnitTestCase Time elapsed: 0 sec <<< ERROR!
                java.lang.RuntimeException: Unable to properly initialize the Kernel
                 at org.jboss.kernel.KernelFactory.initializeKernel(KernelFactory.java:203)
                 at org.jboss.kernel.KernelFactory.assembleNewKernel(KernelFactory.java:107)
                 at org.jboss.kernel.KernelFactory.newInstance(KernelFactory.java:67)
                 at org.jboss.kernel.plugins.bootstrap.AbstractBootstrap.bootstrap(AbstractBootstrap.java:114)
                 at org.jboss.kernel.plugins.bootstrap.AbstractBootstrap.run(AbstractBootstrap.java:83)
                 at org.jboss.test.kernel.junit.MicrocontainerTestDelegate.setUp(MicrocontainerTestDelegate.java:76)
                 at org.jboss.test.AbstractTestSetup.setUp(AbstractTestSetup.java:63)
                 at junit.extensions.TestSetup$1.protect(TestSetup.java:18)
                 at junit.framework.TestResult.runProtected(TestResult.java:124)
                 at junit.extensions.TestSetup.run(TestSetup.java:23)
                 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                 at java.lang.reflect.Method.invoke(Method.java:585)
                 at org.apache.maven.surefire.junit.JUnitTestSet.execute(JUnitTestSet.java:213)
                 at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
                 at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
                 at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
                 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                 at java.lang.reflect.Method.invoke(Method.java:585)
                 at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338)
                 at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997)
                Caused by: java.lang.NoClassDefFoundError: org/jboss/beans/info/spi/BeanAccessMode
                 at java.lang.Class.getDeclaredMethods0(Native Method)
                 at java.lang.Class.privateGetDeclaredMethods(Class.java:2395)
                 at java.lang.Class.getDeclaredMethods(Class.java:1763)
                 at org.jboss.reflect.plugins.introspection.IntrospectionTypeInfoFactoryImpl.getDeclaredMethods(IntrospectionTypeInfoFactoryImpl.java:479)
                 at org.jboss.reflect.plugins.introspection.IntrospectionTypeInfoFactoryImpl.getMethods(IntrospectionTypeInfoFactoryImpl.java:188)
                 at org.jboss.reflect.plugins.ClassInfoImpl.getDeclaredMethods(ClassInfoImpl.java:394)
                 at org.jboss.beans.info.plugins.AbstractBeanInfoFactory.getMethods(AbstractBeanInfoFactory.java:203)
                 at org.jboss.beans.info.plugins.AbstractBeanInfoFactory.getBeanInfo(AbstractBeanInfoFactory.java:136)
                 at org.jboss.config.plugins.AbstractConfiguration.getBeanInfo(AbstractConfiguration.java:68)
                 at org.jboss.kernel.plugins.config.AbstractKernelConfig.getBeanInfo(AbstractKernelConfig.java:65)
                 at org.jboss.kernel.plugins.config.property.PropertyKernelConfig.getImplementation(PropertyKernelConfig.java:175)
                 at org.jboss.kernel.plugins.config.property.PropertyKernelConfig.createKernelConfigurator(PropertyKernelConfig.java:96)
                 at org.jboss.kernel.plugins.bootstrap.basic.BasicKernelInitializer.createKernelConfigurator(BasicKernelInitializer.java:124)
                 at org.jboss.kernel.plugins.bootstrap.basic.BasicKernelInitializer.initKernel(BasicKernelInitializer.java:73)
                 at org.jboss.kernel.KernelFactory.initializeKernel(KernelFactory.java:198)
                 ... 23 more
                Caused by: java.lang.NoClassDefFoundError: org/jboss/beans/info/spi/BeanAccessMode
                 at java.lang.Class.getDeclaredMethods0(Native Method)
                 at java.lang.Class.privateGetDeclaredMethods(Class.java:2395)
                 at java.lang.Class.getDeclaredMethods(Class.java:1763)
                 at org.jboss.reflect.plugins.introspection.IntrospectionTypeInfoFactoryImpl.getDeclaredMethods(IntrospectionTypeInfoFactoryImpl.java:479)
                 at org.jboss.reflect.plugins.introspection.IntrospectionTypeInfoFactoryImpl.getMethods(IntrospectionTypeInfoFactoryImpl.java:188)
                 at org.jboss.reflect.plugins.ClassInfoImpl.getDeclaredMethods(ClassInfoImpl.java:394)
                 at org.jboss.beans.info.plugins.AbstractBeanInfoFactory.getMethods(AbstractBeanInfoFactory.java:203)
                 at org.jboss.beans.info.plugins.AbstractBeanInfoFactory.getBeanInfo(AbstractBeanInfoFactory.java:136)
                 at org.jboss.config.plugins.AbstractConfiguration.getBeanInfo(AbstractConfiguration.java:68)
                 at org.jboss.kernel.plugins.config.AbstractKernelConfig.getBeanInfo(AbstractKernelConfig.java:65)
                 at org.jboss.kernel.plugins.config.property.PropertyKernelConfig.getImplementation(PropertyKernelConfig.java:175)
                 at org.jboss.kernel.plugins.config.property.PropertyKernelConfig.createKernelConfigurator(PropertyKernelConfig.java:96)
                 at org.jboss.kernel.plugins.bootstrap.basic.BasicKernelInitializer.createKernelConfigurator(BasicKernelInitializer.java:124)
                 at org.jboss.kernel.plugins.bootstrap.basic.BasicKernelInitializer.initKernel(BasicKernelInitializer.java:73)
                 at org.jboss.kernel.KernelFactory.initializeKernel(KernelFactory.java:198)
                 ... 23 more
                
                

                But it runs OK on my Linux box. :-(

                • 5. Re: PropertyReplaceTC failing in maven
                  Adrian Brock Master

                  Classloading was already updated to use the latest MC.
                  Is this using an (old) snapshot?

                  What does mvn dependency:tree say is getting used?

                  • 6. Re: PropertyReplaceTC failing in maven
                    Ales Justin Master

                     

                    "adrian@jboss.org" wrote:
                    What does mvn dependency:tree say is getting used?

                    It still says this:
                    - http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4137369#4137369

                    I'll get a hold of Paul. ;-(

                    • 7. Re: PropertyReplaceTC failing in maven
                      Adrian Brock Master

                       

                      "alesj" wrote:
                      "adrian@jboss.org" wrote:
                      What does mvn dependency:tree say is getting used?

                      It still says this:
                      - http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4137369#4137369

                      I'll get a hold of Paul. ;-(


                      What that your maven is broken, what I posted or something else?

                      This is what I get. It shows classloading-vfs using MC beta11

                      [INFO] snapshot org.jboss.cl:jboss-classloading:2.0.0-SNAPSHOT: checking for updates from snapshots.jboss.org
                      [INFO] [dependency:tree]
                      [INFO] org.jboss.cl:jboss-classloading-vfs:jar:2.0.0-SNAPSHOT
                      [INFO] +- junit:junit:jar:4.4:test
                      [INFO] +- org.jboss:jboss-vfs:jar:2.0.0.Beta7:compile
                      [INFO] +- org.jboss.microcontainer:jboss-kernel:jar:2.0.0.Beta11:compile
                      [INFO] | \- org.jboss.microcontainer:jboss-dependency:jar:2.0.0.Beta11:compile
                      [INFO] | +- org.jboss:jboss-reflect:jar:2.0.0.Beta12:compile
                      [INFO] | \- org.jboss:jboss-mdr:jar:2.0.0.Beta12:compile
                      [INFO] +- jboss:jboss-common-logging-log4j:jar:2.0.4.GA:test
                      [INFO] | \- log4j:log4j:jar:1.2.14:test
                      [INFO] +- org.jboss:jboss-test:jar:1.0.5.GA:test
                      [INFO] +- org.jboss.man:jboss-managed:jar:2.0.0.Beta12:compile
                      [INFO] | \- org.jboss.man:jboss-metatype:jar:2.0.0.Beta12:compile
                      [INFO] +- org.jboss:jbossxb:jar:2.0.0.CR7:compile
                      [INFO] | +- apache-xerces:xercesImpl:jar:2.9.1:compile
                      [INFO] | +- wutka-dtdparser:dtdparser121:jar:1.2.1:compile
                      [INFO] | +- javax.activation:activation:jar:1.0.2:compile
                      [INFO] | \- javax.xml.bind:jaxb-api:jar:2.1:compile
                      [INFO] | +- javax.xml.stream:stax-api:jar:1.0-2:compile
                      [INFO] | \- (javax.activation:activation:jar:1.1:compile - omitted for conflict with 1.0.2)
                      [INFO] \- org.jboss.cl:jboss-classloading:jar:2.0.0-SNAPSHOT:compile
                      [INFO] +- (org.jboss.microcontainer:jboss-dependency:jar:2.0.0.Beta11:compile - omitted for duplicate)
                      [INFO] \- org.jboss.cl:jboss-classloader:jar:2.0.0-SNAPSHOT:compile
                      [INFO] +- org.jboss:jboss-classloading-spi:jar:5.0.0.Beta4:compile
                      [INFO] +- org.jboss:jboss-common-core:jar:2.2.3.GA:compile
                      [INFO] \- jboss:jboss-common-logging-spi:jar:2.0.4.GA:compile
                      


                      and all the tests pass:

                      Results :
                      
                      Tests run: 88, Failures: 0, Errors: 0, Skipped: 0
                      
                      [INFO] [jar:jar]
                      [INFO] Building jar: /home/ejort/jboss-cl/classloading-vfs/target/jboss-classloading-vfs.jar
                      


                      • 8. Re: PropertyReplaceTC failing in maven
                        Ales Justin Master

                        OK, I've managed to get things running.
                        But still can't use 'mvn dependency:tree'.

                        • 9. Re: PropertyReplaceTC failing in maven
                          Ales Justin Master

                           

                          "alesj" wrote:
                          OK, I've managed to get things running.

                          Meaning all the tests pass for me as well.
                          Nuking helped.
                          But due to my slow network at home I didn't nuke it all.
                          I'll probably try that on Monday, and we'll if that also resolves that tree issue.