本文整理汇总了Java中org.jboss.arquillian.container.spi.Container.getName方法的典型用法代码示例。如果您正苦于以下问题:Java Container.getName方法的具体用法?Java Container.getName怎么用?Java Container.getName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jboss.arquillian.container.spi.Container
的用法示例。
在下文中一共展示了Container.getName方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: handleBeforeDeployment
import org.jboss.arquillian.container.spi.Container; //导入方法依赖的package包/类
/**
* Executed before deployments to lazily execute the {@link ServerSetupTask#setup(ManagementClient, String) ServerSetupTask}.
* <p>
* This is lazily loaded for manual mode tests. The server may not have been started at the
* {@link org.jboss.arquillian.test.spi.event.suite.BeforeClass BeforeClass} event.
* </p>
*
* @param event the lifecycle event
* @param container the container the event is being invoked on
*
* @throws Throwable if an error occurs processing the event
*/
public synchronized void handleBeforeDeployment(@Observes BeforeDeploy event, Container container) throws Throwable {
final String containerName = container.getName();
if (setupTasks.containsKey(containerName)) {
setupTasks.get(containerName).deployments.add(event.getDeployment());
return;
}
final ClassContext classContext = classContextInstance.get();
if (classContext == null) {
return;
}
final Class<?> currentClass = classContext.getActiveId();
ServerSetup setup = currentClass.getAnnotation(ServerSetup.class);
if (setup == null) {
return;
}
final ManagementClient client = managementClient.get();
final ServerSetupTaskHolder holder = new ServerSetupTaskHolder(client);
holder.deployments.add(event.getDeployment());
setupTasks.put(containerName, holder);
holder.setup(setup, containerName);
}
示例2: handleAfterUndeploy
import org.jboss.arquillian.container.spi.Container; //导入方法依赖的package包/类
/**
* Executed after each undeploy for the container.
*
* @param afterDeploy the lifecycle event
* @param container the container the event is being invoked on
*
* @throws Exception if an error occurs processing the event
*/
public synchronized void handleAfterUndeploy(@Observes AfterUnDeploy afterDeploy, final Container container) throws Exception {
final String containerName = container.getName();
final ServerSetupTaskHolder holder = setupTasks.get(containerName);
if (holder == null) {
return;
}
// Remove the deployment
if (holder.deployments.remove(afterDeploy.getDeployment())) {
// If the deployments are now empty and the AfterClass has been invoked we need to ensure the tearDown() has
// happened. This should clean up any tasks left from managed deployments or unmanaged deployments that were
// not undeployed manually.
if (afterClassRun && holder.deployments.isEmpty()) {
holder.tearDown(containerName);
setupTasks.remove(containerName);
}
}
}
示例3: reportContainer
import org.jboss.arquillian.container.spi.Container; //导入方法依赖的package包/类
public void reportContainer(@Observes Container event) {
Map<String, String> containerProperties = event.getContainerConfiguration().getContainerProperties();
String containerId = event.getContainerConfiguration().isDefault() ? "_DEFAULT_" : event.getName();
Reporter.createReport(CONTAINER_REPORT)
.addKeyValueEntry(CONTAINER_NAME, event.getName())
.addReport(
Reporter.createReport(CONTAINER_CONFIGURATION_REPORT)
.feedKeyValueListFromMap(containerProperties))
.inSection(new TestSuiteConfigurationContainerSection(containerId, DEFAULT_TEST_SUITE_ID))
.fire(sectionEvent);
}
示例4: getCubeIDForContainer
import org.jboss.arquillian.container.spi.Container; //导入方法依赖的package包/类
/**
* Returns the cube ID for the container. By default, this is the container
* name, but can be overridden by the user in the container properties, e.g.
* <code><cubeId>pod-name</cubeId></code>.
*
* @param container
* the arquillian container
*
* @return the cube ID for the specified container
*/
public static String getCubeIDForContainer(Container container) {
final String cubeID;
final Map<String, String> containerProperties = container.getContainerConfiguration().getContainerProperties();
if (containerProperties == null) {
// test cases may not mock entire hierarchy
cubeID = null;
} else {
cubeID = containerProperties.get("cubeId");
}
return cubeID == null ? container.getName() : cubeID;
}
示例5: getContainerName
import org.jboss.arquillian.container.spi.Container; //导入方法依赖的package包/类
private String getContainerName() {
final Container container = containerInst.get();
return container.getName();
}