2016-12-30 40 views
0

我想在任何arquilliantest之前调用Method。我通过继承创建了一个套件。见Suite class inheritanceArquillian Beforesuite Unittest Preparation

我的套房类看起来是这样的:

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(); 
      } 
     }); 
    } 
} 

我怎样才能得到这个工作? Arquillian对我来说很新,我是否正确?

+0

我知道这个方法不是很好的代码,我只是实现了这个快速和脏... – YvesHendseth

回答

0

您偶然发现的线索是关于尚未发布的整体套件支持的开发人员讨论。

如果您使用的是JUnit,我建议使用简单的@Before方法使用相同的逻辑。