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


Java Container.getName方法代码示例

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

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

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

示例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>&lt;cubeId&gt;pod-name&lt;/cubeId&gt;</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;
}
 
开发者ID:arquillian,项目名称:arquillian-cube,代码行数:22,代码来源:ContainerUtil.java

示例5: getContainerName

import org.jboss.arquillian.container.spi.Container; //导入方法依赖的package包/类
private String getContainerName() {
    final Container container = containerInst.get();
    return container.getName();
}
 
开发者ID:wildfly,项目名称:wildfly-arquillian,代码行数:5,代码来源:CommonDomainDeployableContainer.java


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