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

Tests are not executed using combinations of @ApplyScriptBefore / @ApplyScriptAfter

    XMLWordPrintable

Details

    • Hide

      Create a test case having a @ApplyScriptBefore annotation with at least 2 SQL scripts to execute.

      Show
      Create a test case having a @ApplyScriptBefore annotation with at least 2 SQL scripts to execute.

    Description

      Forum reference: https://community.jboss.org/message/874117

      The following test case succeeds (green bar) although it should fail:

      @RunWith(Arquillian.class)  
      @DataSource("java:oracleDS")  
      @Cleanup(phase=TestExecutionPhase.NONE)  
      @ApplyScriptBefore("deploy-db-functionality.sql")  
      @ApplyScriptAfter("undeploy-db-functionality.sql")  
      public class PersistenceIT {  
         // @Deployment ...  
        
         @Test  
         @ApplyScriptBefore("trigger-db-functionality.sql")  
         public void shouldFail() {  
             Assert.fail("should fail, but doesn't");  
         }  
      }
      

      Removing class level annotations does not work either:

      @Test  
      @ApplyScriptBefore({ "deploy-db-functionality.sql", "trigger-db-functionality.sql" })  
      @ApplyScriptAfter("undeploy-db-functionality.sql")  
      public void shouldFail() { ... }  
      

      What actually works is to use only one ApplyScriptBefore / ApplyScriptAfter annotation per test, each with only one script to execute.

      Attachments

        Issue Links

          Activity

            People

              bartosz-1 Bartosz Majsak
              tkuestermann Thomas Küstermann (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: