当前位置: 首页>>代码示例>>Java>>正文


Java BeforeClass.getTestClass方法代码示例

本文整理汇总了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);
}
 
开发者ID:arquillian,项目名称:arquillian-reporter,代码行数:18,代码来源:ArquillianCoreReporterLifecycleManager.java

示例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);
                }
            });

    }
 
开发者ID:arquillian,项目名称:arquillian-cube,代码行数:18,代码来源:IstioResourcesApplier.java

示例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;
}
 
开发者ID:arquillian,项目名称:arquillian-algeron,代码行数:29,代码来源:PactsRetriever.java

示例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);
}
 
开发者ID:jboss-openshift,项目名称:ce-arq,代码行数:19,代码来源:CEEnvironmentProcessor.java

示例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);

    }
}
 
开发者ID:arquillian,项目名称:arquillian-cube,代码行数:10,代码来源:HealthCheckBeforeClassObserver.java

示例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);

    }
}
 
开发者ID:arquillian,项目名称:arquillian-cube,代码行数:10,代码来源:SleepBeforeClassObserver.java

示例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);
}
 
开发者ID:arquillian,项目名称:arquillian-cube,代码行数:20,代码来源:CEEnvironmentProcessor.java


注:本文中的org.jboss.arquillian.test.spi.event.suite.BeforeClass.getTestClass方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。