8 Replies Latest reply on Feb 25, 2008 10:46 AM by alesj

    SpecialValueFactoryUnitTestCase failure

    starksm64

      I just pulled down the current mc trunk contents and did a mvn install, and the SpecialValueFactoryUnitTestCase is failing to start:

      Running org.jboss.test.metatype.types.test.MetaTypeUnitTestCase
      Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.1 sec
      Running org.jboss.test.metatype.values.factory.test.SpecialValueFactoryUnitTestCase
      [INFO] ------------------------------------------------------------------------
      [ERROR] BUILD FAILURE
      [INFO] ------------------------------------------------------------------------
      [INFO] There are test failures.
      
      Please refer to /home/svn/JBossMC/jbossmc/metatype/target/surefire-reports for the individual test results.
      [INFO] ------------------------------------------------------------------------
      [INFO] For more information, run Maven with the -e switch
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time: 6 minutes 11 seconds
      [INFO] Finished at: Fri Feb 22 06:13:47 PST 2008
      [INFO] Final Memory: 29M/114M
      [INFO] ------------------------------------------------------------------------
      [starksm@succubus jbossmc]$
      
      [starksm@succubus jbossmc]$ cat metatype/target/surefire-reports/org.jboss.test.metatype.values.factory.test.SpecialValueFactoryUnitTestCase-output.txt
      org.apache.maven.surefire.booter.SurefireExecutionException: Unresolved compilation problem:
      ; nested exception is java.lang.Error: Unresolved compilation problem:
      
      java.lang.Error: Unresolved compilation problem:
      
       at org.jboss.metatype.api.types.MetaTypeFactory.getInstance(MetaTypeFactory.java:46)
       at org.jboss.test.metatype.values.factory.test.AbstractMetaValueFactoryTest.<clinit>(AbstractMetaValueFactoryTest.java:43)
       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:597)
       at org.apache.maven.surefire.junit.JUnitTestSet.createInstanceFromSuiteMethod(JUnitTestSet.java:180)
       at org.apache.maven.surefire.junit.JUnitTestSet.constructTestObject(JUnitTestSet.java:140)
       at org.apache.maven.surefire.junit.JUnitTestSet.execute(JUnitTestSet.java:197)
       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:597)
       at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338)
       at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997)
      



        • 1. Re: SpecialValueFactoryUnitTestCase failure
          alesj

          I've got this two tests failing for me:
          - CompositeMetaTypeFactoryUnitTestCase
          - VFSClassLoaderFactoryUnitTestCase

          And there could be more (I got the 2nd one by commenting CCE in the first)

          Like said, 1st is CCE.
          2nd one:

          Caused by: org.jboss.xb.binding.JBossXBRuntimeException: {urn:jboss:classloader:1.0}classloader not found as a child of {urn:jboss:bean-deployer:2.0}deployment
          


          • 2. Re: SpecialValueFactoryUnitTestCase failure

            I'm not seeing either of these.

            A clean build (not a clean checkout) comes up with this error,
            which is from Scott's latest commit...

            Results :
            
            Tests in error:
             testMapComposite(org.jboss.test.metatype.types.factory.test.CompositeMetaTypeFactoryUnitTestCase)
            
            Tests run: 154, Failures: 0, Errors: 1, Skipped: 0
            


            -------------------------------------------------------------------------------
            Test set: org.jboss.test.metatype.types.factory.test.CompositeMetaTypeFactoryUnitTestCase
            -------------------------------------------------------------------------------
            Tests run: 5, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.125 sec <<< FAILURE!
            testMapComposite(org.jboss.test.metatype.types.factory.test.CompositeMetaTypeFactoryUnitTestCase) Time elapsed: 0.022 sec <<< ERROR!
            java.lang.ClassCastException: org.jboss.metatype.api.types.ImmutableTableMetaType
             at org.jboss.test.metatype.types.factory.test.CompositeMetaTypeFactoryUnitTestCase.testMapComposite(CompositeMetaTypeFactoryUnitTestCase.java:140)
            


            • 3. Re: SpecialValueFactoryUnitTestCase failure

              I just tried a clean checkout and blew away my local maven repository as well.
              I get the same result, so it must be something at your end?

              • 4. Re: SpecialValueFactoryUnitTestCase failure
                starksm64

                Rerunning mvn test from within metatype I only see the CompositeMetaTypeFactoryUnitTestCase failure. This is expected as the MetaTypeFactory impl has not been updated to support MapCompositeMetaType. I'll create the jira for that.

                Running org.jboss.test.metatype.types.factory.test.CompositeMetaTypeFactoryUnitTestCase
                Tests run: 5, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.015 sec <<< FAILURE!
                



                • 5. Re: SpecialValueFactoryUnitTestCase failure
                  starksm64
                  • 6. Re: SpecialValueFactoryUnitTestCase failure

                    I would update the test to this:

                     public Map<String, String> compositeSignature;
                    
                     public void testMapComposite() throws Exception
                     {
                     Field field = getClass().getField("compositeSignature");
                     Type mapSignature = field.getGenericType();
                     CompositeMetaType result = assertInstanceOf(resolve(mapSignature), CompositeMetaType.class);
                     MutableCompositeMetaType expected = new MutableCompositeMetaType(HashMap.class.getName(), "HashMap<String,String>");
                     expected.addItem("key1", "key1", SimpleMetaType.STRING);
                     expected.addItem("key2", "key2", SimpleMetaType.STRING);
                     expected.addItem("key3", "key3", SimpleMetaType.STRING);
                     expected.freeze();
                    
                     testComposite(expected, result);
                    
                     String[] itemNames = {"key1", "key2", "key3"};
                     MetaValue[] itemValues = {SimpleValueSupport.wrap("value1"), SimpleValueSupport.wrap("value3"), SimpleValueSupport.wrap("value3")};
                     CompositeValueSupport mapValue = new CompositeValueSupport(expected, itemNames, itemValues);
                     assertEquals("value1", mapValue.get("key1"));
                     }
                    


                    Your test will never work, since:
                    new HashMap<String,String>().getClass()
                    

                    will just return the erased type, not the generic type.

                    • 7. Re: SpecialValueFactoryUnitTestCase failure
                      starksm64

                      Ok, thanks.

                      • 8. Re: SpecialValueFactoryUnitTestCase failure
                        alesj

                         

                        "adrian@jboss.org" wrote:

                        I get the same result, so it must be something at your end?

                        Uf, yup, it must be something here. :-(

                        When I ran in IDEA it works.
                        Running local 'mvn install' fails on VFSClassLoaderFactoryUnitTestCase (with the error I posted before).
                        Running on my TeamCity build server again works OK.

                        Nuking whole maven repo?
                        Or just jbossxb?