Uploaded image for project: 'Arquillian'
  1. Arquillian
  2. ARQ-1002

The Arquillian test case which sharing super class for deployment only succes with 2 rounds.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • 1.0.1.Final
    • Base Implementation
    • None

      Dear All,

      I'm in the Eclipse/Maven/Arquillian/Glassfish-Embedded environment. I've the JUnit/Arquillian test case which shares the super class for deployment as the following: -

      The Utility for creating ear

          public class ArchivePreparation {
      
              private static final EnterpriseArchive EAR;
      
              //Getter here
      
              static {
      
                 EAR = getDeployinngEar();
      
              }
      
              private static EnterpriseArchive getDeployingEar() {
      
                 //Create and return the ear.
      
              }
      
          }
      
      

      The super class

          public class AbstractTester {
      
              @Deployment
      
              public static EnterpriseArchive deploy() {
      
                  return ArchivePreparation.getEAR();
      
              }
      
          }
      
      

      The test case #1, #2, #3 and #4: It is same coding.

          @RunWith(Arquillian.class)
      
          public class EarTester1 extends AbstractTester {
      
              @EJB
      
              private DummyServiceable serviceEjb;
      
              @Test
      
              public void whenPerform() {
      
                  Assert.assertNotNull("The service ejb is null.",
      
                                        this.serviceEjb);
      
              }
      
          }
      
      

      The JUnit test suite

          @RunWith(Suite.class)
      
          @SuiteClasses({
      
              EarTester1.class,
      
              EarTester2.class,
      
              EarTester3.class,
      
              EarTester4.class,
      
          })
      
          public class ArquillianMultipleTestSuite {
      
          }
      
      

      When I execute the ArquillianMultipleTestSuite, for both inside the Eclipse and command line with mvn test,

      Only the EarTester #1 and #2 is success. The #3 and #4 are always fail 100%.

      Since all test cases are the same coding, I'm very confused and have no idea why it is failure.

      I also create the project for reproducing at the github.com as the following information :-

      The Glassfish embedded 3.1.2 configuration

      1. The project URL is https://github.com/charleech/local-glassfish-embedded-312

      2. The step for configuring is https://github.com/charleech/local-glassfish-embedded-312/blob/master/README.md

      The multiple deployment example project

      1. The parent project URL is https://github.com/charleech/arquillian-evaluation

      2. The project URL is https://github.com/charleech/arquillian-evaluation/tree/master/deployment It would be nice to checkout together with the parent project.

      3. If you prefer to run unit testing inside the eclipse, please read the step at https://github.com/charleech/arquillian-evaluation/blob/master/deployment/README.md

            Unassigned Unassigned
            charlee_ch_jira Charlee Chitsuk (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: