在 pax 考试中,我希望某些东西对所有测试功能都是通用的。为此,我使用了@Before,使用@Before 方法的问题是它会在每个测试方法之前被调用。有没有办法解决这个问题。pax 考试中是否有一些注释可用于解决此问题。
@Before
public void init() throws Exception{
featuresService.installFeature("hibernate");
featuresService.installFeature("hibernate-validator");
bundleContext.installBundle("wrap:mvn:osgi/osgi/3.0.1").start();
bundleContext.installBundle("wrap:mvn:javax.xml/xml/3.1.0").start();
bundleContext.installBundle("wrap:mvn:commons-dbcp/commons-dbcp/1.2.2").start();
bundleContext.installBundle("wrap:mvn:commons-pool/commons-pool/1.3").start();
bundleContext.installBundle("wrap:mvn:commons-lang/commons-lang/2.3").start();
}