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


Java ApplicationScoped类代码示例

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


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

示例1: setup

import org.jboss.arquillian.core.api.annotation.ApplicationScoped; //导入依赖的package包/类
@Before
public void setup() throws Exception {

    serviceProducer.set(serviceLoader);

    final List<GovernorProvider> governorProviders = new ArrayList<GovernorProvider>();
    governorProviders.add(governorProvider);

    Mockito.when(serviceLoader.all(GovernorProvider.class)).thenReturn(governorProviders);

    manager = Mockito.spy(getManager());
    Mockito.when(manager.resolve(ServiceLoader.class)).thenReturn(serviceLoader);

    governorConfiguration = new GovernorConfiguration();
    bind(ApplicationScoped.class, GovernorConfiguration.class, governorConfiguration);

    jiraGovernorConfiguration = new JiraGovernorConfiguration();
    jiraGovernorConfiguration.setServer(JIRA_SERVER_ADDRESS);
    jiraGovernorConfiguration.setUsername(USERNAME);
    jiraGovernorConfiguration.setPassword(PASSWORD);

    bind(ApplicationScoped.class, JiraGovernorConfiguration.class, jiraGovernorConfiguration);

    final JiraGovernorClient jiraGovernorClient = new JiraGovernorClientFactory().build(jiraGovernorConfiguration);
    bind(ApplicationScoped.class, JiraGovernorClient.class, jiraGovernorClient);
}
 
开发者ID:arquillian,项目名称:arquillian-governor,代码行数:27,代码来源:JiraGovernorTestCase.java

示例2: init

import org.jboss.arquillian.core.api.annotation.ApplicationScoped; //导入依赖的package包/类
@Before
public void init() throws Exception {
    bind(ApplicationScoped.class, ServiceLoader.class, serviceLoader);
    bind(ApplicationScoped.class, ScreenshooterConfiguration.class, configuration);
    bind(ApplicationScoped.class, Screenshooter.class, screenshooter);
    bind(ApplicationScoped.class, RecorderStrategyRegister.class, recorderStrategyRegister);

    Mockito.when(screenshooter.getScreenshotType()).thenReturn(ScreenshotType.PNG);

    Mockito.doNothing().when(cleaner).clean(configuration);

    Mockito.when(serviceLoader.onlyOne(ScreenshooterEnvironmentCleaner.class, DefaultScreenshooterEnvironmentCleaner.class))
        .thenReturn(cleaner);

    screenshotFile = folder.newFile("screenshot.png");
    URL resource = BlurLevelTestCase.class.getResource("/arquillian_ui_success_256px.png");
    FileUtils.copyURLToFile(resource, screenshotFile);
    originalSize = (int) screenshotFile.length();
    OUTPUT_FILE = screenshotFile.getAbsoluteFile();
}
 
开发者ID:arquillian,项目名称:arquillian-recorder,代码行数:21,代码来源:BlurLevelTestCase.java

示例3: shouldParseEmptyAutostart

import org.jboss.arquillian.core.api.annotation.ApplicationScoped; //导入依赖的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

示例4: shouldParseEmptyValuesAutostart

import org.jboss.arquillian.core.api.annotation.ApplicationScoped; //导入依赖的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

示例5: shouldParseTrimAutostart

import org.jboss.arquillian.core.api.annotation.ApplicationScoped; //导入依赖的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

示例6: shouldCreateAndStartAutoContainersDefiningRegularExpressions

import org.jboss.arquillian.core.api.annotation.ApplicationScoped; //导入依赖的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

示例7: shouldCreateAndStartAutoContainers

import org.jboss.arquillian.core.api.annotation.ApplicationScoped; //导入依赖的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

示例8: shouldStopAndDestroyAutoContainers

import org.jboss.arquillian.core.api.annotation.ApplicationScoped; //导入依赖的package包/类
@Test
public void shouldStopAndDestroyAutoContainers() {

    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 AfterSuite());

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

示例9: setup

import org.jboss.arquillian.core.api.annotation.ApplicationScoped; //导入依赖的package包/类
@Before
public void setup() {

    Yaml yaml = new Yaml();
    @SuppressWarnings("unchecked")
    Map<String, Object> content = (Map<String, Object>) yaml.load(CONTENT);

    when(cube.getId()).thenReturn(CUBE_ID);
    when(cube.configuration()).thenReturn(content);
    when(container.getName()).thenReturn(CUBE_ID);
    when(container.getDeployableContainer()).thenReturn(deployableContainer);
    when(deployableContainer.getConfigurationClass()).thenReturn(ContainerConfiguration.class);
    when(container.getContainerConfiguration()).thenReturn(containerDef);
    when(containerRegistry.getContainers()).thenReturn(Arrays.asList(container));
    when(hasPortBindings.getContainerIP()).thenReturn("192.168.0.1");
    registry = new LocalCubeRegistry();
    registry.addCube(cube);

    bind(ApplicationScoped.class, CubeRegistry.class, registry);
    bind(ApplicationScoped.class, ContainerRegistry.class, containerRegistry);

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

示例10: setup

import org.jboss.arquillian.core.api.annotation.ApplicationScoped; //导入依赖的package包/类
@Before
public void setup() {

    Yaml yaml = new Yaml();
    @SuppressWarnings("unchecked")
    Map<String, Object> content = (Map<String, Object>) yaml.load(CONTENT);

    when(cube.getId()).thenReturn(CUBE_ID);
    when(cube.configuration()).thenReturn(content);
    when(cube.getMetadata(HasPortBindings.class)).thenReturn(
        new TestPortBindings(new Binding("localhost").addPortBinding(8089, 8090)));
    when(container.getName()).thenReturn(CUBE_ID);
    when(container.getDeployableContainer()).thenReturn(deployableContainer);
    when(deployableContainer.getConfigurationClass()).thenReturn(ContainerConfiguration.class);
    when(container.getContainerConfiguration()).thenReturn(containerDef);
    when(containerRegistry.getContainers()).thenReturn(Arrays.asList(container));
    registry = new LocalCubeRegistry();
    registry.addCube(cube);

    bind(ApplicationScoped.class, CubeRegistry.class, registry);
    bind(ApplicationScoped.class, ContainerRegistry.class, containerRegistry);
}
 
开发者ID:arquillian,项目名称:arquillian-cube,代码行数:23,代码来源:ContainerConfigurationControllerTest.java

示例11: setup

import org.jboss.arquillian.core.api.annotation.ApplicationScoped; //导入依赖的package包/类
@Before
@SuppressWarnings("unchecked")
public void setup() {
    when(cube.getId()).thenReturn(CUBE_ID);
    when(container.getName()).thenReturn(CUBE_ID);
    when(container.getDeployableContainer()).thenReturn(deployableContainer);
    when(container.getContainerConfiguration()).thenReturn(containerDef);
    when(containerDef.getContainerProperties()).thenReturn(Collections.EMPTY_MAP);
    when(containerRegistry.getContainers()).thenReturn(Arrays.asList(container));
    registry = new LocalCubeRegistry();
    registry.addCube(cube);

    bind(ApplicationScoped.class, CubeRegistry.class, registry);
    bind(ApplicationScoped.class, ContainerRegistry.class, containerRegistry);
    bind(ApplicationScoped.class, CubeConfiguration.class, new CubeConfiguration());
}
 
开发者ID:arquillian,项目名称:arquillian-cube,代码行数:17,代码来源:CubeContainerLifecycleControllerTest.java

示例12: initializeReporterAndRegisterServices

import org.jboss.arquillian.core.api.annotation.ApplicationScoped; //导入依赖的package包/类
@Before
public final void initializeReporterAndRegisterServices() {
    initMocks(this);

    initiateStringKeys();
    bind(ApplicationScoped.class, ServiceLoader.class, serviceLoader);

    fire(new InitiateReporterEvent(lifecycleManager));
    registerBuilders();
}
 
开发者ID:arquillian,项目名称:arquillian-reporter,代码行数:11,代码来源:AbstractReporterTestBase.java

示例13: should_move_files_to_output_directory

import org.jboss.arquillian.core.api.annotation.ApplicationScoped; //导入依赖的package包/类
@Test
public void should_move_files_to_output_directory() throws IOException {

    final File origin = temporaryFolder.newFolder("origin");

    byte[] content = "Contract File".getBytes();
    Files.copy(new ByteArrayInputStream(content), new File(origin, "pact.txt").toPath());

    String config = "provider: url\n" +
        "contractsFolder: " + origin.getAbsolutePath() + "\n" +
        "url: http://localhost:18081/pacts\n";

    final Map<String, String> params = new HashMap<>();
    params.put("publishContracts", "true");
    params.put("publishConfiguration", config);

    final AlgeronConsumerConfiguration pactConsumerConfiguration = AlgeronConsumerConfiguration.fromMap(params);
    bind(ApplicationScoped.class, AlgeronConsumerConfiguration.class, pactConsumerConfiguration);

    WireMock.stubFor(
        WireMock.post(WireMock.urlEqualTo("/pacts/pact.txt"))
            .withRequestBody(new ContainsPattern("Contract File"))
            .willReturn(WireMock.aResponse().withStatus(200)));

    fire(new AfterClass(UrlContractsPublisherObserverTest.class));

    WireMock.verify(WireMock.postRequestedFor(WireMock.urlEqualTo("/pacts/pact.txt"))
        .withRequestBody(new ContainsPattern("Contract File")));
}
 
开发者ID:arquillian,项目名称:arquillian-algeron,代码行数:30,代码来源:UrlContractsPublisherObserverTest.java

示例14: should_move_files_to_output_directory

import org.jboss.arquillian.core.api.annotation.ApplicationScoped; //导入依赖的package包/类
@Test
public void should_move_files_to_output_directory() throws IOException {

    params.put("publishContracts", "true");
    final AlgeronConsumerConfiguration pactConsumerConfiguration = AlgeronConsumerConfiguration.fromMap(params);
    bind(ApplicationScoped.class, AlgeronConsumerConfiguration.class, pactConsumerConfiguration);

    fire(new AfterClass(FolderContractsPublisherObserverTest.class));

    Assertions.assertThat(output).isDirectory();
    Assertions.assertThat(new File(output, "pact.txt")).exists().hasContent("Contract File");
}
 
开发者ID:arquillian,项目名称:arquillian-algeron,代码行数:13,代码来源:FolderContractsPublisherObserverTest.java

示例15: should_not_move_files_to_output_directory_if_no_publish_contracts

import org.jboss.arquillian.core.api.annotation.ApplicationScoped; //导入依赖的package包/类
@Test
public void should_not_move_files_to_output_directory_if_no_publish_contracts() throws IOException {

    final AlgeronConsumerConfiguration pactConsumerConfiguration = AlgeronConsumerConfiguration.fromMap(params);
    bind(ApplicationScoped.class, AlgeronConsumerConfiguration.class, pactConsumerConfiguration);

    fire(new AfterClass(FolderContractsPublisherObserverTest.class));

    Assertions.assertThat(output).isDirectory();
    Assertions.assertThat(new File(output, "pact.txt")).doesNotExist();
}
 
开发者ID:arquillian,项目名称:arquillian-algeron,代码行数:12,代码来源:FolderContractsPublisherObserverTest.java


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