本文整理汇总了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);
}
示例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();
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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());
}
示例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();
}
示例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")));
}
示例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");
}
示例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();
}