Arquillian Beforesuite Unittest Preparation

88 Views Asked by At

I want to call a Method before any arquilliantest. I created a Suite by Inheritance. See Suite class inheritance

My Suite class looks like this:

public class ProvisioningITestSuite extends RdpArquillianTest {

    @Inject
    private PathConfigForTest pathConfig;

    public void prepareDirsForProvisioningTests(@Observes BeforeSuite event) throws IOException {
        Files.newDirectoryStream(pathConfig.getVdfsTargetBwkSignalOutputDir().toPath()).forEach(file - >{
            try {
                Files.delete(file);
            } catch(IOException e) {
                e.printStackTrace();
            }
        });

        Files.newDirectoryStream(pathConfig.getVdfsTargetPrdCompleteSupplyDir().toPath()).forEach(file - >{
            try {
                Files.delete(file);
            } catch(IOException e) {
                e.printStackTrace();
            }
        });
    }
}

How can i get this to work? Arquillian is very new to me, am I on the right way?

1

There are 1 best solutions below

0
On

The thread you stumbled upon is a dev discussion about overall suite support which is not released yet.

I would suggest using simple @Before method with the same logic if you are using JUnit.