本文整理汇总了Java中org.jboss.arquillian.test.spi.event.suite.BeforeClass.getTestClass方法的典型用法代码示例。如果您正苦于以下问题:Java BeforeClass.getTestClass方法的具体用法?Java BeforeClass.getTestClass怎么用?Java BeforeClass.getTestClass使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jboss.arquillian.test.spi.event.suite.BeforeClass
的用法示例。
在下文中一共展示了BeforeClass.getTestClass方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: startTestClass
import org.jboss.arquillian.test.spi.event.suite.BeforeClass; //导入方法依赖的package包/类
public void startTestClass(@Observes(precedence = Integer.MAX_VALUE) BeforeClass event) {
TestClass testClass = event.getTestClass();
boolean runAsClient = event.getTestClass().isAnnotationPresent(RunAsClient.class);
TestClassReport testClassReport = new TestClassReport(testClass.getName());
Reporter
.createReport(new ConfigurationReport(TEST_CLASS_CONFIGURATION))
.addKeyValueEntry(CLASS_RUNS_AS_CLIENT, runAsClient);
String reportMessage = ReportMessageParser.parseTestClassReportMessage(event.getTestClass().getJavaClass());
Reporter
.createReport(testClassReport)
.addKeyValueEntry(TEST_CLASS_REPORT_MESSAGE, reportMessage)
.inSection(new TestClassSection(testClass.getJavaClass(), DEFAULT_TEST_SUITE_ID))
.fire(sectionEvent);
}
示例2: applyIstioResources
import org.jboss.arquillian.test.spi.event.suite.BeforeClass; //导入方法依赖的package包/类
public void applyIstioResources(@Observes(precedence = -20) BeforeClass beforeClass, final IstioClient istioClient) {
final TestClass testClass = beforeClass.getTestClass();
Arrays.stream(findAnnotations(testClass))
.map(IstioResource::value)
.map(RunnerExpressionParser::parseExpressions)
.map(IstioResourceResolver::resolve)
.forEach(istioResource -> {
try (BufferedInputStream istioResourceStream = new BufferedInputStream(istioResource) ) {
createdIstioResources.addAll(istioClient.registerCustomResources(istioResourceStream));
} catch (IOException e) {
throw new IllegalStateException(e);
}
});
}
示例3: getPacts
import org.jboss.arquillian.test.spi.event.suite.BeforeClass; //导入方法依赖的package包/类
protected List<Pact> getPacts(BeforeClass test) {
final TestClass testClass = test.getTestClass();
final Provider providerInfo = testClass.getAnnotation(Provider.class);
if (providerInfo == null) {
return Collections.emptyList();
}
final String serviceName = providerInfo.value();
final Consumer consumerInfo = testClass.getAnnotation(Consumer.class);
final String consumerName = consumerInfo != null ? consumerInfo.value() : null;
List<Pact> pacts;
try {
final ContractsRetriever contractsSource =
getContractsSource(testClass, algeronProviderConfigurationInstance.get());
contractsSource.setProviderName(serviceName);
final List<URI> contractsDirectory = contractsSource.retrieve();
pacts = loadContractFiles(contractsDirectory, serviceName).stream()
.filter(p -> consumerName == null || p.getConsumer().getName().equals(consumerName))
.collect(toList());
} catch (IOException e) {
throw new IllegalArgumentException(e);
}
return pacts;
}
示例4: createEnvironment
import org.jboss.arquillian.test.spi.event.suite.BeforeClass; //导入方法依赖的package包/类
/**
* Create the environment as specified by @Template or
* arq.extension.ce-cube.openshift.template.* properties.
* <p>
* In the future, this might be handled by starting application Cube
* objects, e.g. CreateCube(application), StartCube(application)
* <p>
* Needs to fire before the containers are started.
*/
public void createEnvironment(@Observes(precedence = 10) BeforeClass event, OpenShiftAdapter client,
CECubeConfiguration configuration, OpenShiftClient openshiftClient) throws DeploymentException {
final TestClass testClass = event.getTestClass();
log.info(String.format("Creating environment for %s", testClass.getName()));
OpenShiftResourceFactory.createResources(testClass.getName(), client, null, testClass.getJavaClass(), configuration.getProperties());
processTemplateResources(testClass, client, configuration);
final CubeOpenShiftConfiguration config = (CubeOpenShiftConfiguration) configurationInstance.get();
registerRoutes(config, openshiftClient);
}
示例5: executeHealthCheck
import org.jboss.arquillian.test.spi.event.suite.BeforeClass; //导入方法依赖的package包/类
public void executeHealthCheck(@Observes BeforeClass beforeClass) {
final TestClass testClass = beforeClass.getTestClass();
if (ReflectionUtil.isClassWithAnnotation(testClass.getJavaClass(), HealthCheck.class)) {
final HealthCheck healthCheck = testClass.getAnnotation(HealthCheck.class);
executeHealthCheck(healthCheck);
}
}
示例6: executeSleep
import org.jboss.arquillian.test.spi.event.suite.BeforeClass; //导入方法依赖的package包/类
public void executeSleep(@Observes BeforeClass beforeClass) {
final TestClass testClass = beforeClass.getTestClass();
if (ReflectionUtil.isClassWithAnnotation(testClass.getJavaClass(), Sleep.class)) {
final Sleep sleep = testClass.getAnnotation(Sleep.class);
executeSleep(sleep);
}
}
示例7: createEnvironment
import org.jboss.arquillian.test.spi.event.suite.BeforeClass; //导入方法依赖的package包/类
/**
* Create the environment as specified by @Template or
* arq.extension.ce-cube.openshift.template.* properties.
* <p>
* In the future, this might be handled by starting application Cube
* objects, e.g. CreateCube(application), StartCube(application)
* <p>
* Needs to fire before the containers are started.
*/
public void createEnvironment(@Observes(precedence = 10) BeforeClass event, OpenShiftAdapter client,
CubeOpenShiftConfiguration cubeOpenShiftConfiguration) {
final TestClass testClass = event.getTestClass();
log.info(String.format("Creating environment for %s", testClass.getName()));
OpenShiftResourceFactory.createResources(testClass.getName(), client, testClass.getJavaClass(),
cubeOpenShiftConfiguration.getProperties());
classTemplateProcessor = new ClassTemplateProcessor(client, cubeOpenShiftConfiguration, testClass);
final List<? extends OpenShiftResource> templateResources = classTemplateProcessor.processTemplateResources();
templateDetailsProducer.set(() -> templateResources);
}