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

Arquillian Extension Persistence - DB cleanup does not work with Maven Archetype

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Do
    • Major
    • None
    • persistence_1.0.0.Alpha3
    • None
    • Hide

      Precondition:
      -new maven project
      -archetype (org.jboss.spec.archetypes): jboss-javaee6-webapp (v 7.0.2.CR1)
      -modify arquillian.xml to work with the proper installation (jboss-as-web-7.0.2.Final in my case)
      -remove the import.sql
      -modify dependencies for arquillian to the latest version (1.0.0.CR7): arquillian-junit-container
      -add dependencies for arquillian (1.0.0.CR7, 1.0.0.Alpha3): arquillian-protocol-servlet, arquillian-persistence-api

      Code to add to the file MemberRegistrationTest.java for reproduction:
      1) add: @PersistenceTest to Testclass
      2) add: MemberListProducer.class to the ShrinkWrap statement
      3) add: @Inject MemberListProducer producer;
      4) create a new Test:
      @Test
      public void testProducer()

      { assertTrue(producer.getMembers().isEmpty()); }

      5) go to project properties > search for maven > add: arq-jbossas-remote
      6) deploy the app on jboss server
      7) run MemberRegistrationTest as JUnit test
      8) if the test passes: rerun the test. It will only fail if testRegister() was executed before!

      Show
      Precondition: -new maven project -archetype (org.jboss.spec.archetypes): jboss-javaee6-webapp (v 7.0.2.CR1) -modify arquillian.xml to work with the proper installation (jboss-as-web-7.0.2.Final in my case) -remove the import.sql -modify dependencies for arquillian to the latest version (1.0.0.CR7): arquillian-junit-container -add dependencies for arquillian (1.0.0.CR7, 1.0.0.Alpha3): arquillian-protocol-servlet, arquillian-persistence-api Code to add to the file MemberRegistrationTest.java for reproduction: 1) add: @PersistenceTest to Testclass 2) add: MemberListProducer.class to the ShrinkWrap statement 3) add: @Inject MemberListProducer producer; 4) create a new Test: @Test public void testProducer() { assertTrue(producer.getMembers().isEmpty()); } 5) go to project properties > search for maven > add: arq-jbossas-remote 6) deploy the app on jboss server 7) run MemberRegistrationTest as JUnit test 8) if the test passes: rerun the test. It will only fail if testRegister() was executed before!

    Description

      Problem: based on discussion in the forums, the DB should be cleaned up after each @Test execution. This was not the case for a very simple project, and can be easily reproduced based on maven archetypes.

      After executing steps to reproduce:

      Actual result:
      if method testRegister() is executed before testProducer(), then the latter fails. Because getMembers() does return a list of size == 1.

      Expected result:
      as the DB is to be cleaned after each test, the getMembers() method should be empty and both tests should verify.

      Attachments

        Activity

          People

            bartosz-1 Bartosz Majsak
            membersound david meier (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: