11 Replies Latest reply on May 11, 2011 9:28 AM by geuze

    Errors after upgrading to Alpha 5

    juergen.zimmermann

      After upgrading from Alpha 4 to Alpha 4 (and ShrinkWrap Alpha 11 to Alpha 12) I'm getting errors like the following one. However, I've no idea where to start or look for. Any hint is appreciated!

       

      addAndRemoveRolle(de.swe2.test.KundenverwaltungTest)  Time elapsed: 0.317 sec  <<< ERROR!
      org.jboss.arquillian.spi.ArquillianProxyException: java.lang.AssertionError :
      Expected: is not null
           got: null
      [Proxied because : Could not find suitable constructor]
      at org.junit.Assert.assertThat(Assert.java:778)
      at org.junit.Assert.assertThat(Assert.java:736)

      ...

        • 1. Errors after upgrading to Alpha 5
          aslak

          Seems our new Remote Exception Proxy is not dealing to nicely with the Assert Exceptions, but..

           

          It basically says you got a AssertionError:

          Expected: is not null

          but got: null

           

          It's wrapped in a ArquillianProxyException because it didn't manage to recreate the AssertionError on the client side, but the message provided is the original AssertionError message that you got incontainer.

           

          Some where a statement alla: Assert.notNull() failed in your test class. The stack trace provided is the original and should show you where.

          • 2. Errors after upgrading to Alpha 5
            juergen.zimmermann

            I understand the stacktrace as it is.

             

            However, when using Alpha 4 all Assert invocations in all test methods are working fine, and after upgrading to Alpha 5 some Assert invocations are failing.

             

            Each time the message in the stacktrace contains "[Proxied because : Could not find suitable constructor]", e.g.

            Expected: is not null

                 got: null

            [Proxied because : Could not find suitable constructor]

             

            Using Alpha 5 I'm getting 5 failures in my test suite. When rolling back to Alpha 4, I get 0 test failures.

            • 3. Errors after upgrading to Alpha 5
              aslak

              Ok, then you need to provide more information.

               

              What does your test case look like, what container are you using etc etc..

              • 4. Errors after upgrading to Alpha 5
                juergen.zimmermann

                The failures are caused because the @BeforeClass method isn't invoked (I also tried @Before, but this one isn't invoked either).

                 

                * I'm running against JBossAS 6 remote.

                * I removed jndi.properties when migrating to Alpha 5

                * I'm having this new arquillian.xml :

                <?xml version="1.0"?>
                <arquillian xmlns="http://jboss.com/arquillian"
                            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                            xsi:schemaLocation="http://jboss.org/schema/arquillian http://jboss.org/schema/arquillian/arquillian_1_0.xsd">
                <container qualifier="jbossas" default="true"/>
                </arquillian>

                * The old (and working) arquillian.xml for Alpha 4:

                <?xml version="1.0"?>
                <arquillian xmlns="http://jboss.com/arquillian"
                            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                            xmlns:jboss="urn:arq:org.jboss.arquillian.jbossas.remote_6">
                </arquillian>

                 

                • 5. Errors after upgrading to Alpha 5
                  aslak

                  BeforeClass / AfterClass / Before / After are now only executed in-container, not on the client side as well as it was in Alpha4.

                   

                  (the Before/After override has a bug so it doesn't work with Embedded containers like weld-se|ee at all)

                  • 6. Errors after upgrading to Alpha 5
                    juergen.zimmermann

                    I'm having an abstract base class with @BeforeClass. This method is definitely executed at the client side when I'm using Alpha 4.

                     

                    Is there a chance to emulate @BeforeClass at the client side when using Alpha 5?

                    • 7. Errors after upgrading to Alpha 5
                      aslak

                      You could have another @Test method annotated with @RunAsClient. but JUnit doesn't guarantee method order, so it's a bit random..

                       

                      You could make a instance block, or have a constructor that does things, but it might not be executed when you want it to..

                       

                      We are working on having support for using @RunAsClient on @Before/@BeforeClass methods as well, but we haven't dugg us far enough down in the test framework yet.

                      • 8. Errors after upgrading to Alpha 5
                        juergen.zimmermann

                        Thank you very much, Aslak! All in-container tests are working now.

                         

                        Inside @BeforeClass I was reloading the database using DbUnit. Now I add dbunit-VERSION.jar to test.ear/lib and the database reload is triggered within JBoss.

                        • 9. Errors after upgrading to Alpha 5
                          alrubinger

                          Aslak Knutsen wrote:

                           

                          BeforeClass / AfterClass / Before / After are now only executed in-container, not on the client side as well as it was in Alpha4.

                          Can we make this configurable, at least the *Class lifecycle methods?

                           

                          S,

                          ALR

                          • 10. Errors after upgrading to Alpha 5
                            aslak

                            Andrew Rubinger wrote:

                             

                            Aslak Knutsen wrote:

                             

                            BeforeClass / AfterClass / Before / After are now only executed in-container, not on the client side as well as it was in Alpha4.

                            Can we make this configurable, at least the *Class lifecycle methods?

                             

                            S,

                            ALR

                            it's planned: https://issues.jboss.org/browse/ARQ-351

                            • 11. Errors after upgrading to Alpha 5
                              geuze

                              I just want to say that I have a similar error:

                               

                              org.jboss.arquillian.spi.ArquillianProxyException: java.lang.AssertionError :  [Proxied because : Could not find suitable constructor]

                               

                              The test method which caused this error was:

                               

                              @Test
                              public final void testMethod() {

                                   //Some logic

                                   final List list = //some code;

                                   assertTrue(list.size() == 1);
                              }

                               

                              The assertion failed because the list had a size of 5. In Arquillian Alpha 4 this resulted in a meaningful message in my JUnit results. Not in an ArquillianProxyException.

                               

                              So is this a bug in Arquillian?