org.jboss.arquillian.container.spi.client.deployment.Deployment.isDeployed()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(10.3k)|赞(0)|评价(0)|浏览(175)

本文整理了Java中org.jboss.arquillian.container.spi.client.deployment.Deployment.isDeployed()方法的一些代码示例,展示了Deployment.isDeployed()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Deployment.isDeployed()方法的具体详情如下:
包路径:org.jboss.arquillian.container.spi.client.deployment.Deployment
类名称:Deployment
方法名:isDeployed

Deployment.isDeployed介绍

暂无

代码示例

代码示例来源:origin: org.jboss.arquillian.container/arquillian-container-spi

public List<Deployment> deployedDeployments() {
  List<Deployment> result = new ArrayList<Deployment>();
  for (Deployment dep : this.deployments) {
    if (dep.isDeployed()) {
      result.add(dep);
    }
  }
  return result;
}

代码示例来源:origin: arquillian/arquillian-core

public List<Deployment> deployedDeployments() {
  List<Deployment> result = new ArrayList<Deployment>();
  for (Deployment dep : this.deployments) {
    if (dep.isDeployed()) {
      result.add(dep);
    }
  }
  return result;
}

代码示例来源:origin: org.jboss.arquillian.container/arquillian-container-spi

public List<Deployment> deployedDeploymentsInUnDeployOrder() {
  List<Deployment> managedDeployment = new ArrayList<Deployment>();
  for (Deployment deployment : deployments) {
    DeploymentDescription desc = deployment.getDescription();
    if (desc.managed() || deployment.isDeployed()) {
      managedDeployment.add(deployment);
    }
  }
  Collections.sort(managedDeployment, new Comparator<Deployment>() {
    public int compare(Deployment o1, Deployment o2) {
      return new Integer(o2.getDescription().getOrder()).compareTo(o1.getDescription().getOrder());
    }
  });
  return Collections.unmodifiableList(managedDeployment);
}

代码示例来源:origin: arquillian/arquillian-core

public List<Deployment> deployedDeploymentsInUnDeployOrder() {
  List<Deployment> managedDeployment = new ArrayList<Deployment>();
  for (Deployment deployment : deployments) {
    DeploymentDescription desc = deployment.getDescription();
    if (desc.managed() || deployment.isDeployed()) {
      managedDeployment.add(deployment);
    }
  }
  Collections.sort(managedDeployment, new Comparator<Deployment>() {
    public int compare(Deployment o1, Deployment o2) {
      return new Integer(o2.getDescription().getOrder()).compareTo(o1.getDescription().getOrder());
    }
  });
  return Collections.unmodifiableList(managedDeployment);
}

代码示例来源:origin: org.jboss.arquillian.extension/arquillian-extension-byteman

/**
 * Check is this should run as client.
 * <p/>
 * Verify @Deployment.testable vs @RunAsClient on Class or Method level
 */
private static boolean isRunAsClient(Deployment deployment, Class<?> testClass, Method testMethod) {
  boolean runAsClient = true;
  if (deployment != null) {
    runAsClient = !deployment.getDescription().testable();
    runAsClient = !deployment.isDeployed() || runAsClient;
    if (testMethod.isAnnotationPresent(RunAsClient.class)) {
      runAsClient = true;
    } else if (testClass.isAnnotationPresent(RunAsClient.class)) {
      runAsClient = true;
    }
  }
  return runAsClient;
}

代码示例来源:origin: org.jboss.arquillian.extension/arquillian-transaction-impl-base

/**
 * Check is this should run as client.
 * <p/>
 * Verify @Deployment.testable vs @RunAsClient on Class or Method level
 */
public static boolean isRunAsClient(Deployment deployment, Class<?> testClass, Method testMethod) {
  boolean runAsClient = true;
  if (deployment != null) {
    runAsClient = !deployment.getDescription().testable();
    runAsClient = !deployment.isDeployed() || runAsClient;
    if (testMethod.isAnnotationPresent(RunAsClient.class)) {
      runAsClient = true;
    } else if (testClass.isAnnotationPresent(RunAsClient.class)) {
      runAsClient = true;
    }
  }
  return runAsClient;
}

代码示例来源:origin: org.jboss.arquillian.container/arquillian-container-test-impl-base

/**
 * Returns if the given test should run as client.
 * <p>
 * Verify @Deployment.testable vs @RunAsClient on Class or Method level
 */
public static boolean isRunAsClient(Deployment deployment, TestClass testClass, Method testMethod) {
  boolean runAsClient = true;
  if (deployment != null) {
    runAsClient = deployment.getDescription().testable() ? false : true;
    runAsClient = deployment.isDeployed() ? runAsClient : true;
    if (testMethod.isAnnotationPresent(RunAsClient.class)) {
      runAsClient = true;
    } else if (testClass.isAnnotationPresent(RunAsClient.class)) {
      runAsClient = true;
    }
  }
  return runAsClient;
}

代码示例来源:origin: arquillian/arquillian-core

/**
 * Returns if the given test should run as client.
 * <p>
 * Verify @Deployment.testable vs @RunAsClient on Class or Method level
 */
public static boolean isRunAsClient(Deployment deployment, TestClass testClass, Method testMethod) {
  boolean runAsClient = true;
  if (deployment != null) {
    runAsClient = deployment.getDescription().testable() ? false : true;
    runAsClient = deployment.isDeployed() ? runAsClient : true;
    if (testMethod.isAnnotationPresent(RunAsClient.class)) {
      runAsClient = true;
    } else if (testClass.isAnnotationPresent(RunAsClient.class)) {
      runAsClient = true;
    }
  }
  return runAsClient;
}

代码示例来源:origin: org.jboss.arquillian.container/arquillian-container-impl-base

@Override
  public void perform(Container container, Deployment deployment) throws Exception {
    if (container.getState().equals(Container.State.STARTED) && deployment.isDeployed()) {
      event.fire(new UnDeployDeployment(container, deployment));
    }
  }
});

代码示例来源:origin: arquillian/arquillian-core

@Override
  public void perform(Container container, Deployment deployment) throws Exception {
    if (container.getState().equals(Container.State.STARTED) && deployment.isDeployed()) {
      event.fire(new UnDeployDeployment(container, deployment));
    }
  }
});

代码示例来源:origin: org.jboss.arquillian.container/arquillian-container-test-impl-base

@Before
public void bindDeployment() {
  bind(ApplicationScoped.class, Deployment.class, deployment);
  bind(ApplicationScoped.class, DeploymentDescription.class, deploymentDescriptor);
  when(deployment.getDescription()).thenReturn(deploymentDescriptor);
  when(deployment.isDeployed()).thenReturn(true);
}

代码示例来源:origin: arquillian/arquillian-core

@Before
public void bindDeployment() {
  bind(ApplicationScoped.class, Deployment.class, deployment);
  bind(ApplicationScoped.class, DeploymentDescription.class, deploymentDescriptor);
  when(deployment.getDescription()).thenReturn(deploymentDescriptor);
  when(deployment.isDeployed()).thenReturn(true);
}

代码示例来源:origin: org.jboss.arquillian.container/arquillian-container-test-impl-base

@Test
public void shouldExecuteLocalIfDeploymentIsTestableButNotDeployed() throws Exception {
  when(deploymentDescriptor.testable()).thenReturn(true);
  when(deployment.isDeployed()).thenReturn(false); // override @Before setup
  fire(test("methodLevelRunModeDefault", new ClassLevelRunModeDefault()));
  assertEventFired(LocalExecutionEvent.class, 1);
}

代码示例来源:origin: arquillian/arquillian-core

@Test
public void shouldExecuteLocalIfDeploymentIsTestableButNotDeployed() throws Exception {
  when(deploymentDescriptor.testable()).thenReturn(true);
  when(deployment.isDeployed()).thenReturn(false); // override @Before setup
  fire(test("methodLevelRunModeDefault", new ClassLevelRunModeDefault()));
  assertEventFired(LocalExecutionEvent.class, 1);
}

代码示例来源:origin: org.jboss.arquillian.container/arquillian-container-test-impl-base

@Override
public void stop(String containerQualifier) {
  DeploymentScenario scenario = deploymentScenario.get();
  if (scenario == null) {
    throw new IllegalArgumentException("No deployment scenario in context");
  }
  ContainerRegistry registry = containerRegistry.get();
  if (registry == null) {
    throw new IllegalArgumentException("No container registry in context");
  }
  if (!containerExists(registry.getContainers(), containerQualifier)) {
    throw new IllegalArgumentException("No container with the specified name exists");
  }
  if (!isControllableContainer(registry.getContainers(), containerQualifier)) {
    throw new IllegalArgumentException("Could not stop "
      + containerQualifier
      + " container. The container life cycle is controlled by Arquillian");
  }
  Container container = registry.getContainer(new TargetDescription(containerQualifier));
  List<Deployment> managedDeployments = scenario.startupDeploymentsFor(new TargetDescription(containerQualifier));
  for (Deployment d : managedDeployments) {
    if (d.isDeployed()) {
      log.info("Automatic undeploying of the managed deployment with name " + d.getDescription().getName() +
        " from the container with name " + container.getName());
      event.fire(new UnDeployDeployment(container, d));
    }
  }
  log.info("Manual stopping of a server instance");
  event.fire(new StopContainer(container));
}

代码示例来源:origin: arquillian/arquillian-core

@Override
public void stop(String containerQualifier) {
  DeploymentScenario scenario = deploymentScenario.get();
  if (scenario == null) {
    throw new IllegalArgumentException("No deployment scenario in context");
  }
  ContainerRegistry registry = containerRegistry.get();
  if (registry == null) {
    throw new IllegalArgumentException("No container registry in context");
  }
  if (!containerExists(registry.getContainers(), containerQualifier)) {
    throw new IllegalArgumentException("No container with the specified name exists");
  }
  if (!isControllableContainer(registry.getContainers(), containerQualifier)) {
    throw new IllegalArgumentException("Could not stop "
      + containerQualifier
      + " container. The container life cycle is controlled by Arquillian");
  }
  Container container = registry.getContainer(new TargetDescription(containerQualifier));
  List<Deployment> managedDeployments = scenario.startupDeploymentsFor(new TargetDescription(containerQualifier));
  for (Deployment d : managedDeployments) {
    if (d.isDeployed()) {
      log.info("Automatic undeploying of the managed deployment with name " + d.getDescription().getName() +
        " from the container with name " + container.getName());
      event.fire(new UnDeployDeployment(container, d));
    }
  }
  log.info("Manual stopping of a server instance");
  event.fire(new StopContainer(container));
}

代码示例来源:origin: arquillian/arquillian-core

if (!d.isDeployed()) {
  log.info("Automatic deploying of the managed deployment with name " + d.getDescription().getName() +
    " for the container with name " + container.getName());

代码示例来源:origin: org.jboss.arquillian.container/arquillian-container-test-impl-base

if (!d.isDeployed()) {
  log.info("Automatic deploying of the managed deployment with name " + d.getDescription().getName() +
    " for the container with name " + container.getName());

代码示例来源:origin: org.jboss.arquillian.container/arquillian-container-test-impl-base

" to custom mode container " + container.getName());
if (!d.isDeployed()) {
  log.info("Automatic deploying of the managed deployment with name " + d.getDescription().getName() +
    " for the container with name " + container.getName());

代码示例来源:origin: org.wildfly.arquillian/wildfly-arquillian-common

if (d.isDeployed()) {
  log.info("Automatic undeploying of the managed deployment with name " + d.getDescription().getName() +
      " from the container with name " + container.getName());

相关文章