本文整理汇总了Java中org.ops4j.pax.exam.TestProbeBuilder.build方法的典型用法代码示例。如果您正苦于以下问题:Java TestProbeBuilder.build方法的具体用法?Java TestProbeBuilder.build怎么用?Java TestProbeBuilder.build使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.ops4j.pax.exam.TestProbeBuilder
的用法示例。
在下文中一共展示了TestProbeBuilder.build方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: startTestContainer
import org.ops4j.pax.exam.TestProbeBuilder; //导入方法依赖的package包/类
protected static void startTestContainer(String featureName, String bundleName, Option[] additionalOptions, Class<? extends DeploymentProbe> probeClass, PhaseListener phaseListener) throws Exception {
if (probeClass == null) {
probeClass = DeploymentProbe.class;
}
long time = System.currentTimeMillis();
system = PaxExamRuntime.createTestSystem(mergeOptions(config(featureName, bundleName), additionalOptions));
time = post(phaseListener, CREATE_SYSTEM, time);
testContainer = PaxExamRuntime.createContainer(system);
time = post(phaseListener, CREATE_CONTAINER, time);
testContainer.start();
time = post(phaseListener, START_CONTAINER, time);
try {
// install the probe
TestProbeBuilder probeBuilder = system.createProbe();
time = post(phaseListener, CREATE_PROBE, time);
probeBuilder.setHeader(Constants.DYNAMICIMPORT_PACKAGE, "*,org.apache.felix.service.*;status=provisional");
probeBuilder.addTests(probeClass, probeClass.getMethods());
time = post(phaseListener, ADD_TESTS, time);
testProbe = probeBuilder.build();
time = post(phaseListener, BUILD_PROBE, time);
testContainer.installProbe(testProbe.getStream());
time = post(phaseListener, INSTALL_PROBE, time);
// wait for SwitchYard application activation
executeProbe("testBundleActivation");
time = post(phaseListener, EXECUTE_PROBE, time);
} catch (Exception e) {
// cleanup
after();
throw e;
}
}
示例2: startTestContainer
import org.ops4j.pax.exam.TestProbeBuilder; //导入方法依赖的package包/类
protected static void startTestContainer(String featureName, String bundleName, Option[] additionalOptions, Class<? extends DeploymentProbe> probeClass, PhaseListener phaseListener) throws Exception {
if (probeClass == null) {
probeClass = DeploymentProbe.class;
}
long time = System.currentTimeMillis();
system = PaxExamRuntime.createTestSystem(mergeOptions(config(featureName, bundleName), additionalOptions));
time = post(phaseListener, CREATE_SYSTEM, time);
testContainer = PaxExamRuntime.createContainer(system);
time = post(phaseListener, CREATE_CONTAINER, time);
testContainer.start();
time = post(phaseListener, START_CONTAINER, time);
try {
// install the probe
TestProbeBuilder probeBuilder = system.createProbe();
time = post(phaseListener, CREATE_PROBE, time);
probeBuilder.setHeader(Constants.DYNAMICIMPORT_PACKAGE, "*,org.apache.felix.service.*;status=provisional");
probeBuilder.addTests(probeClass, probeClass.getMethods());
time = post(phaseListener, ADD_TESTS, time);
testProbe = probeBuilder.build();
time = post(phaseListener, BUILD_PROBE, time);
testContainer.installProbe(testProbe.getStream());
time = post(phaseListener, INSTALL_PROBE, time);
// wait for SwitchYard application activation
executeProbe("testBundleActivation");
time = post(phaseListener, Phase.EXECUTE_PROBE, time);
} catch (Exception e) {
// cleanup
after();
throw e;
}
}