Hi,
I would like to apply a SQL script before and after each test is executed. My test case looks a bit like this:
@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");
}
}
The issue is that this simple test case should fail, but what I get instead is a green bar. Seems that the test method is not even executed.
I tried to remove the Apply annotations on the class level, but got the same erroneous green bar:
@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.
Looks like a bug, am I right?
/Thomas