1 2 Previous Next 22 Replies Latest reply on Apr 3, 2007 5:56 PM by kconner

    Tests don't work in eclipse

      From http://www.jboss.com/index.html?module=bb&op=viewtopic&t=104663

      The tests aren't working in eclipse because Maven's eclipse:eclipse
      is not generating the correct classpath file.
      Kevin says he knows how to fix the pom to make this work.

        • 1. Re: Tests don't work in eclipse
          kconner

          I have made changes to the current structure and am just testing a few before checking in :-)

          • 2. Re: Tests don't work in eclipse

             

            "Kevin.Conner@jboss.com" wrote:
            "adrian@jboss.org" wrote:
            All the xml parsing tests fail because it cannot find the xml url using getResource().

            Now delete src/resources as a source folder and make it a class library,
            i.e.
            - <classpathentry kind="src" path="src/resources" including="schema/**" excluding="**/*.java"/>
            + <classpathentry kind="lib" path="src/resources">
            


            Okay, this is caused because the resources you require are explicitly excluded from the source path.

            If there are no objections then I will change the structure of the projects so that the test resources are not embedded within the compile resources. This should fix this issue.


            This also needs to differentiate things like src/resources/schema
            which should get included in the jar file and the resources that are
            only used for tests.

            Of course, the tests need to use both.

            • 3. Re: Tests don't work in eclipse

               

              "adrian@jboss.org" wrote:
              and the resources that are
              only used for tests.


              These resources still need including the tests jar file.

              • 4. Re: Tests don't work in eclipse
                kconner

                 

                "adrian@jboss.org" wrote:
                This also needs to differentiate things like src/resources/schema
                which should get included in the jar file and the resources that are
                only used for tests.

                Of course, the tests need to use both.

                Main resources are included in the jar, test resources in the test jar.

                The test classpath will include the main resources as well as the test ones.

                My changes should be okay.

                • 5. Re: Tests don't work in eclipse
                  kconner

                  I have checked in the changes, please update and try now.

                  I have changed the structure to separate the main and test resources (for projects having both), as per normal maven practice. The location of these resources do not adhere to the maven standard though.

                  • 6. Re: Tests don't work in eclipse

                     

                    "Kevin.Conner@jboss.com" wrote:
                    I have checked in the changes, please update and try now.

                    I have changed the structure to separate the main and test resources (for projects having both), as per normal maven practice. The location of these resources do not adhere to the maven standard though.


                    This looks better.

                    I now see three failing tests in dependency project (which is expected since
                    I'm currently working on the fix for this).

                    There are three failing tests in kernel which is NOT expected.
                    I suspect these are due to Ales's refactoring?

                    The spring-int tests are all broken due to resources not found,
                    so there is something wrong there.

                    Maven is telling a different story, e.g. for the container project
                    
                    Results :
                    
                    Tests in error:
                     testConfigure20(org.jboss.test.javabean.test.PropertyTestCase)
                     testConfigure20WithCtor(org.jboss.test.javabean.test.PropertyTestCase)
                     testConfigure20WithCtorFactory(org.jboss.test.javabean.test.PropertyTestCase)
                     testConfigure20WithCtorExplicitFactoryClass(org.jboss.test.javabean.test.PropertyTestCase)
                     testConfigure20WithCtorExplicitFactoryClassAndParams(org.jboss.test.javabean.test.PropertyTestCase)
                    
                    Tests run: 679, Failures: 0, Errors: 5, Skipped: 0
                    


                    • 7. Re: Tests don't work in eclipse
                      kconner

                       

                      "adrian@jboss.org" wrote:
                      The spring-int tests are all broken due to resources not found,
                      so there is something wrong there.

                      Okay, will check these now
                      "adrian@jboss.org" wrote:
                      Maven is telling a different story, e.g. for the container project
                      Tests in error:
                       testConfigure20(org.jboss.test.javabean.test.PropertyTestCase)
                       testConfigure20WithCtor(org.jboss.test.javabean.test.PropertyTestCase)
                       testConfigure20WithCtorFactory(org.jboss.test.javabean.test.PropertyTestCase)
                       testConfigure20WithCtorExplicitFactoryClass(org.jboss.test.javabean.test.PropertyTestCase)
                       testConfigure20WithCtorExplicitFactoryClassAndParams(org.jboss.test.javabean.test.PropertyTestCase)
                      
                      Tests run: 679, Failures: 0, Errors: 5, Skipped: 0
                      

                      Will check this afterwards.

                      • 8. Re: Tests don't work in eclipse
                        alesj

                         

                        "adrian@jboss.org" wrote:

                        There are three failing tests in kernel which is NOT expected.
                        I suspect these are due to Ales's refactoring?

                        What's the error there?


                        • 9. Re: Tests don't work in eclipse

                           

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

                          There are three failing tests in kernel which is NOT expected.
                          I suspect these are due to Ales's refactoring?

                          What's the error there?


                          This bean should not be installed, it should get a security exception.
                          junit.framework.AssertionFailedError: expected:<ControllerState@79e328{**ERROR**}> but was:<ControllerState@307c44{Installed}>
                           at junit.framework.Assert.fail(Assert.java:47)
                           at junit.framework.Assert.failNotEquals(Assert.java:282)
                           at junit.framework.Assert.assertEquals(Assert.java:64)
                           at junit.framework.Assert.assertEquals(Assert.java:71)
                           at org.jboss.test.kernel.controller.test.AccessControlTestCase.testAccessControlContext(AccessControlTestCase.java:57)
                          


                          Looks like classloading dependency is broken?
                          java.lang.IllegalStateException: Bean not found cl at state ControllerState@307c44{Installed}
                           at org.jboss.test.kernel.junit.MicrocontainerTestDelegate.getControllerContext(MicrocontainerTestDelegate.java:152)
                           at org.jboss.test.kernel.junit.MicrocontainerTestDelegate.getBean(MicrocontainerTestDelegate.java:125)
                           at org.jboss.test.kernel.junit.MicrocontainerTest.getBean(MicrocontainerTest.java:93)
                           at org.jboss.test.kernel.junit.MicrocontainerTest.getBean(MicrocontainerTest.java:80)
                           at org.jboss.test.kernel.deployment.test.BeanMetaDataWithClassloaderTestCase.testBeanAsValueMetaData(BeanMetaDataWithClassloaderTestCase.java:48)
                          


                          Some other problem with classloaders?
                          java.lang.IllegalStateException: Incompletely deployed:
                          
                          *** DEPLOYMENTS IN ERROR: Name -> Error
                          FactoryBeanConfiguredClassLoader -> java.lang.IllegalArgumentException: Wrong arguments. new for target java.lang.reflect.Constructor expected=[org.jboss.kernel.spi.config.KernelConfigurator] actual=[org.jboss.kernel.plugins.config.AbstractKernelConfigurator]
                          FactoryDeploymentConfiguredClassLoader -> java.lang.IllegalArgumentException: Wrong arguments. new for target java.lang.reflect.Constructor expected=[org.jboss.kernel.spi.config.KernelConfigurator] actual=[org.jboss.kernel.plugins.config.AbstractKernelConfigurator]
                          
                           at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.internalValidate(AbstractKernelDeployer.java:249)
                           at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.validate(AbstractKernelDeployer.java:163)
                           at org.jboss.test.kernel.junit.MicrocontainerTestDelegate.validate(MicrocontainerTestDelegate.java:180)
                           at org.jboss.test.kernel.junit.MicrocontainerTest.validate(MicrocontainerTest.java:191)
                           at org.jboss.test.kernel.deployment.test.DeploymentClassLoaderTestCase.testDeploymentClassLoader(DeploymentClassLoaderTestCase.java:51)
                          


                          • 10. Re: Tests don't work in eclipse
                            kconner

                             

                            "Kevin.Conner@jboss.com" wrote:
                            "adrian@jboss.org" wrote:
                            The spring-int tests are all broken due to resources not found,
                            so there is something wrong there.

                            Okay, will check these now

                            This should be fixed. There was an extra level in the resource name, xml-test, which has been removed.

                            • 11. Re: Tests don't work in eclipse
                              kconner

                               

                              "alesj" wrote:
                              What's the error there?

                              Let me check this out first, it may be similar to the spring one.

                              • 12. Re: Tests don't work in eclipse

                                 

                                "Kevin.Conner@jboss.com" wrote:

                                This should be fixed. There was an extra level in the resource name, xml-test, which has been removed.


                                That works now, thanks.

                                I've got to do the same thing with some other changes that are not committed yet.
                                I think I understand what you did - I'll follow the same pattern.

                                • 13. Re: Tests don't work in eclipse
                                  kconner

                                  The kernel module contains two sets of test resources, one under org/** and the second under xml-test/**

                                  The xml-test resources do not appear to be referenced, are they needed?

                                  Should these be combined with the others or removed?

                                  Kev

                                  • 14. Re: Tests don't work in eclipse
                                    kconner

                                    Copying the xml-test resources up one level does not appear to make any difference to the test results. I suspect these are regressions.

                                    Should I remove the xml-test resources?

                                    1 2 Previous Next