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


Java BeforeSuite类代码示例

本文整理汇总了Java中org.jboss.arquillian.test.spi.event.suite.BeforeSuite的典型用法代码示例。如果您正苦于以下问题:Java BeforeSuite类的具体用法?Java BeforeSuite怎么用?Java BeforeSuite使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


BeforeSuite类属于org.jboss.arquillian.test.spi.event.suite包,在下文中一共展示了BeforeSuite类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: startTestSuite

import org.jboss.arquillian.test.spi.event.suite.BeforeSuite; //导入依赖的package包/类
public void startTestSuite(@Observes(precedence = Integer.MAX_VALUE) BeforeSuite managerProcessing) {
    Reporter
        .createReport(new TestSuiteReport(TEST_SUITE_NAME))
        .inSection(new TestSuiteSection(DEFAULT_TEST_SUITE_ID))
        .fire(sectionEvent);

    // todo differentiate between loaded extensions and configs that are in arquillian.xml
    //        ReportBuilder extensionsReport = Reporter.createReport(new ConfigurationReport("Loaded extensions"));
    //        for (ExtensionDef extensionDef : descriptor.get().getExtensions()) {
    //            ReportBuilder extBuilder = Reporter
    //                .createReport(extensionDef.getExtensionName())
    //                .feedKeyValueListFromMap(extensionDef.getExtensionProperties());
    //            extensionsReport.addReport(extBuilder);
    //        }
    //        extensionsReport
    //            .inSection(new TestSuiteConfigurationSection("loaded-extension"))
    //            .fire(sectionEvent);
}
 
开发者ID:arquillian,项目名称:arquillian-reporter,代码行数:19,代码来源:ArquillianCoreReporterLifecycleManager.java

示例2: on

import org.jboss.arquillian.test.spi.event.suite.BeforeSuite; //导入依赖的package包/类
public void on(@Observes BeforeSuite beforeSuite) {
    final SkipperConfiguration skipperConfiguration = this.skipperConfiguration.get();
    final ReporterConfiguration reporterConfiguration = this.reporterConfiguration.get();

    if (reporterConfiguration == null) {
        throw new IllegalStateException("ReporterConfiguration was not injected. Be sure you have Arquillian Recorder "
                + "Reporter implementation on class path.");
    }

    File adocExportFile = null;

    if (!skipperConfiguration.getPlainAdoc().isEmpty()) {
        adocExportFile = new File(reporterConfiguration.getFile().getParentFile(), skipperConfiguration.getPlainAdoc());
    }

    if (adocExportFile != null) {
        final AsciidocExporter asciidocExporter = new AsciidocExporter(adocExportFile);
        this.asciiDocExporter.set(asciidocExporter);
    }
}
 
开发者ID:arquillian,项目名称:arquillian-governor,代码行数:21,代码来源:SkipperReporter.java

示例3: startBeforeSuiteTrueTest

import org.jboss.arquillian.test.spi.event.suite.BeforeSuite; //导入依赖的package包/类
@Test
public void startBeforeSuiteTrueTest() throws Exception {

    Mockito.when(configuration.getStartBeforeSuite()).thenReturn(true);

    fire(new VideoExtensionConfigured());

    fire(new BeforeSuite());
    fire(new BeforeClass(DummyTestCase.class));
    fire(new Before(DummyTestCase.class, DummyTestCase.class.getMethod("test")));

    bind(TestScoped.class, TestResult.class, TestResult.passed());

    fire(new After(DummyTestCase.class, DummyTestCase.class.getMethod("test")));
    fire(new AfterClass(DummyTestCase.class));
    fire(new AfterSuite());

    assertEventFired(BeforeVideoStart.class, 1);
    assertEventFired(StartRecordSuiteVideo.class, 1);
    assertEventFired(AfterVideoStart.class, 1);

    assertEventFired(BeforeVideoStop.class, 1);
    assertEventFired(StopRecordSuiteVideo.class, 1);
    assertEventFired(AfterVideoStop.class, 1);
}
 
开发者ID:arquillian,项目名称:arquillian-recorder,代码行数:26,代码来源:RecorderLifecycleObserverTestCase.java

示例4: startBeforeClassTrueTest

import org.jboss.arquillian.test.spi.event.suite.BeforeSuite; //导入依赖的package包/类
@Test
public void startBeforeClassTrueTest() throws Exception {

    Mockito.when(configuration.getStartBeforeClass()).thenReturn(true);

    fire(new VideoExtensionConfigured());

    fire(new BeforeSuite());
    fire(new BeforeClass(DummyTestCase.class));
    fire(new Before(DummyTestCase.class, DummyTestCase.class.getMethod("test")));

    bind(TestScoped.class, TestResult.class, TestResult.passed());

    fire(new AfterRules(DummyTestCase.class, DummyTestCase.class.getMethod("test"), LifecycleMethodExecutor.NO_OP));
    fire(new AfterClass(DummyTestCase.class));
    fire(new AfterSuite());

    assertEventFired(BeforeVideoStart.class, 1);
    assertEventFired(StartRecordClassVideo.class, 1);
    assertEventFired(AfterVideoStart.class, 1);

    assertEventFired(BeforeVideoStop.class, 1);
    assertEventFired(StopRecordClassVideo.class, 1);
    assertEventFired(AfterVideoStop.class, 1);
}
 
开发者ID:arquillian,项目名称:arquillian-recorder,代码行数:26,代码来源:RecorderLifecycleObserverTestCase.java

示例5: startBeforeTestTrueTest

import org.jboss.arquillian.test.spi.event.suite.BeforeSuite; //导入依赖的package包/类
@Test
public void startBeforeTestTrueTest() throws Exception {

    Mockito.when(configuration.getStartBeforeTest()).thenReturn(true);

    fire(new VideoExtensionConfigured());

    fire(new BeforeSuite());
    fire(new BeforeClass(DummyTestCase.class));
    fire(new Before(DummyTestCase.class, DummyTestCase.class.getMethod("test")));

    bind(TestScoped.class, TestResult.class, TestResult.passed());

    fire(new AfterRules(DummyTestCase.class, DummyTestCase.class.getMethod("test"), LifecycleMethodExecutor.NO_OP));
    fire(new AfterClass(DummyTestCase.class));
    fire(new AfterSuite());

    assertEventFired(BeforeVideoStart.class, 1);
    assertEventFired(StartRecordVideo.class, 1);
    assertEventFired(AfterVideoStart.class, 1);

    assertEventFired(BeforeVideoStop.class, 1);
    assertEventFired(StopRecordVideo.class, 1);
    assertEventFired(AfterVideoStop.class, 1);
}
 
开发者ID:arquillian,项目名称:arquillian-recorder,代码行数:26,代码来源:RecorderLifecycleObserverTestCase.java

示例6: shouldParseEmptyAutostart

import org.jboss.arquillian.test.spi.event.suite.BeforeSuite; //导入依赖的package包/类
@Test
public void shouldParseEmptyAutostart() throws Exception {
    Map<String, String> parameters = new HashMap<String, String>();
    parameters.put("autoStartContainers", "");
    parameters.put("dockerContainers", "a:\n  image: a\nb:\n  image: a\n");

    CubeConfiguration cubeConfiguration = CubeConfiguration.fromMap(new HashMap<String, String>());
    bind(ApplicationScoped.class, CubeConfiguration.class, cubeConfiguration);

    CubeDockerConfiguration dockerConfiguration = CubeDockerConfiguration.fromMap(parameters, null);
    bind(ApplicationScoped.class, CubeDockerConfiguration.class, dockerConfiguration);

    fire(new BeforeSuite());

    assertEventFired(CreateCube.class, 0);
    assertEventFired(StartCube.class, 0);
}
 
开发者ID:arquillian,项目名称:arquillian-cube,代码行数:18,代码来源:CubeSuiteLifecycleControllerTest.java

示例7: shouldParseEmptyValuesAutostart

import org.jboss.arquillian.test.spi.event.suite.BeforeSuite; //导入依赖的package包/类
@Test
public void shouldParseEmptyValuesAutostart() throws Exception {
    Map<String, String> parameters = new HashMap<String, String>();
    parameters.put("autoStartContainers", " ,  ");
    parameters.put("dockerContainers", "a:\n  image: a\nb:\n  image: a\n");

    CubeConfiguration cubeConfiguration = CubeConfiguration.fromMap(new HashMap<String, String>());
    bind(ApplicationScoped.class, CubeConfiguration.class, cubeConfiguration);

    CubeDockerConfiguration dockerConfiguration = CubeDockerConfiguration.fromMap(parameters, null);
    bind(ApplicationScoped.class, CubeDockerConfiguration.class, dockerConfiguration);

    fire(new BeforeSuite());

    assertEventFired(CreateCube.class, 0);
    assertEventFired(StartCube.class, 0);
}
 
开发者ID:arquillian,项目名称:arquillian-cube,代码行数:18,代码来源:CubeSuiteLifecycleControllerTest.java

示例8: shouldParseTrimAutostart

import org.jboss.arquillian.test.spi.event.suite.BeforeSuite; //导入依赖的package包/类
@Test
public void shouldParseTrimAutostart() throws Exception {
    Map<String, String> parameters = new HashMap<String, String>();
    parameters.put("autoStartContainers", "a , b ");
    parameters.put("dockerContainers", "a:\n  image: a\nb:\n  image: a\n");

    CubeConfiguration cubeConfiguration = CubeConfiguration.fromMap(new HashMap<String, String>());
    bind(ApplicationScoped.class, CubeConfiguration.class, cubeConfiguration);

    CubeDockerConfiguration dockerConfiguration = CubeDockerConfiguration.fromMap(parameters, null);
    bind(ApplicationScoped.class, CubeDockerConfiguration.class, dockerConfiguration);

    fire(new BeforeSuite());

    assertEventFired(CreateCube.class, 2);
    assertEventFired(StartCube.class, 2);
    assertEventFiredOnOtherThread(CreateCube.class);
    assertEventFiredOnOtherThread(StartCube.class);
}
 
开发者ID:arquillian,项目名称:arquillian-cube,代码行数:20,代码来源:CubeSuiteLifecycleControllerTest.java

示例9: shouldCreateAndStartAutoContainersDefiningRegularExpressions

import org.jboss.arquillian.test.spi.event.suite.BeforeSuite; //导入依赖的package包/类
@Test
public void shouldCreateAndStartAutoContainersDefiningRegularExpressions() {
    Map<String, String> dockerData = new HashMap<String, String>();
    dockerData.put("autoStartContainers", "regexp:a(.*)");
    dockerData.put("dockerContainers", "a:\n  image: a\nab:\n  image: a\nx:\n" +
        "  image: a\n");

    CubeConfiguration cubeConfiguration = CubeConfiguration.fromMap(new HashMap<String, String>());
    bind(ApplicationScoped.class, CubeConfiguration.class, cubeConfiguration);

    CubeDockerConfiguration dockerConfiguration = CubeDockerConfiguration.fromMap(dockerData, null);
    bind(ApplicationScoped.class, CubeDockerConfiguration.class, dockerConfiguration);

    fire(new BeforeSuite());

    assertEventFired(CreateCube.class, 2);
    assertEventFired(StartCube.class, 2);
    assertEventFiredOnOtherThread(CreateCube.class);
    assertEventFiredOnOtherThread(StartCube.class);
}
 
开发者ID:arquillian,项目名称:arquillian-cube,代码行数:21,代码来源:CubeSuiteLifecycleControllerTest.java

示例10: shouldCreateAndStartAutoContainers

import org.jboss.arquillian.test.spi.event.suite.BeforeSuite; //导入依赖的package包/类
@Test
public void shouldCreateAndStartAutoContainers() {

    Map<String, String> dockerData = new HashMap<String, String>();
    dockerData.put("autoStartContainers", "a,b");
    dockerData.put("dockerContainers", "a:\n  image: a\nb:\n  image: a\n");

    CubeConfiguration cubeConfiguration = CubeConfiguration.fromMap(new HashMap<String, String>());
    bind(ApplicationScoped.class, CubeConfiguration.class, cubeConfiguration);

    CubeDockerConfiguration dockerConfiguration = CubeDockerConfiguration.fromMap(dockerData, null);
    bind(ApplicationScoped.class, CubeDockerConfiguration.class, dockerConfiguration);

    fire(new BeforeSuite());

    assertEventFired(CreateCube.class, 2);
    assertEventFired(StartCube.class, 2);
    assertEventFiredOnOtherThread(CreateCube.class);
    assertEventFiredOnOtherThread(StartCube.class);
}
 
开发者ID:arquillian,项目名称:arquillian-cube,代码行数:21,代码来源:CubeSuiteLifecycleControllerTest.java

示例11: handleBeforeSuite

import org.jboss.arquillian.test.spi.event.suite.BeforeSuite; //导入依赖的package包/类
@Override
public void handleBeforeSuite(BeforeSuite event) throws Throwable {
    super.handleBeforeSuite(event);

    Runtime runtime = RuntimeLocator.getRuntime();
    IllegalStateAssertion.assertNull(runtime, "Embedded Runtime already created without @RunWith(Arquillian.class)");

    runtime = EmbeddedUtils.getEmbeddedRuntime();
    ObjectStore suiteStore = getSuiteObjectStore();
    suiteStore.add(Runtime.class, runtime);

    // Do additional setup
    Iterator<EmbeddedRuntimeSetup> itsetup = ServiceLoader.load(EmbeddedRuntimeSetup.class).iterator();
    while(itsetup.hasNext()) {
        EmbeddedRuntimeSetup setup = itsetup.next();
        setup.setupEmbeddedRuntime(suiteStore);
    }
}
 
开发者ID:tdiesler,项目名称:gravia,代码行数:19,代码来源:EmbeddedSetupObserver.java

示例12: startTestSuite

import org.jboss.arquillian.test.spi.event.suite.BeforeSuite; //导入依赖的package包/类
public void startTestSuite(@Observes BeforeSuite managerProcessing) {
    Reporter.createReport(new ConfigurationReport(ENVIRONMENT_SECTION_NAME))
            .addKeyValueEntry(JAVA_VERSION, getJavaVersion())
            .addKeyValueEntry(TEST_RUNNER, getTestRunner())
            .addKeyValueEntry(DOCKER, isRunningInDocker())
            .addKeyValueEntry(TIMEZONE, getTimeZone())
            .addKeyValueEntry(CHARSET, getDefaultCharset())
            .addKeyValueEntry(OPERATIVE_SYSTEM, getOperativeSystemName())
            .addKeyValueEntry(OPERATIVE_SYSTEM_ARCH, getOperativeSystemArchitecture())
            .addKeyValueEntry(OPERATIVE_SYSTEM_VERSION,getOperativeSystemVersion())
            .inSection(new TestSuiteConfigurationSection("environment"))
            .fire(sectionEvent);
}
 
开发者ID:arquillian,项目名称:arquillian-reporter,代码行数:14,代码来源:EnvironmentReportCreator.java

示例13: execute

import org.jboss.arquillian.test.spi.event.suite.BeforeSuite; //导入依赖的package包/类
public void execute(@Observes(precedence = Integer.MAX_VALUE)
	EventContext<BeforeSuite> event) throws InvalidSyntaxException {

	Bundle bundle = FrameworkUtil.getBundle(getClass());

	BundleContext bundleContext = bundle.getBundleContext();

	Filter filter = FrameworkUtil.createFilter(
		"(&(objectClass=org.springframework.context.ApplicationContext)" +
			"(org.springframework.context.service.name=" +
				bundle.getSymbolicName() + "))");

	ServiceTracker<ApplicationContext, ApplicationContext> serviceTracker =
		new ServiceTracker<>(bundleContext, filter, null);

	serviceTracker.open();

	try {
		serviceTracker.waitForService(30 * 1000L);
	}
	catch (InterruptedException ie) {
		throw new RuntimeException(ie);
	}

	serviceTracker.close();

	event.proceed();
}
 
开发者ID:liferay-labs,项目名称:arquillian-liferay,代码行数:29,代码来源:LiferayWaitForServiceBuilderObserver.java

示例14: setProperties

import org.jboss.arquillian.test.spi.event.suite.BeforeSuite; //导入依赖的package包/类
public void setProperties(@Observes BeforeSuite event) {
	Properties props = load(SystemProperties.FILE_NAME);
	if (props != null) {
		for (Map.Entry<Object, Object> entry : props.entrySet()) {
			System.setProperty(entry.getKey().toString(), entry.getValue()
					.toString());
		}
	}
}
 
开发者ID:Blazebit,项目名称:blaze-storage,代码行数:10,代码来源:SystemPropertiesLoader.java

示例15: execute

import org.jboss.arquillian.test.spi.event.suite.BeforeSuite; //导入依赖的package包/类
public void execute(@Observes(precedence = Integer.MAX_VALUE)
		EventContext<BeforeSuite> event) throws InvalidSyntaxException {

	Bundle bundle = FrameworkUtil.getBundle(getClass());

	BundleContext bundleContext = bundle.getBundleContext();

	Filter filter = FrameworkUtil.createFilter(
		"(&(objectClass=org.springframework.context.ApplicationContext)" +
			"(org.springframework.context.service.name=" +
			bundleContext.getBundle().getSymbolicName() + "))");

	ServiceTracker<ApplicationContext, ApplicationContext> serviceTracker =
		new ServiceTracker<>(bundleContext, filter, null);

	serviceTracker.open();

	try {
		serviceTracker.waitForService(30 * 1000L);
	}
	catch (InterruptedException e) {
		throw new RuntimeException(e);
	}

	serviceTracker.close();

	event.proceed();
}
 
开发者ID:arquillian,项目名称:arquillian-extension-liferay,代码行数:29,代码来源:LiferayWaitForServiceObserver.java


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