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

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

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

Deployment.<init>介绍

暂无

代码示例

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

public DeploymentScenario addDeployment(DeploymentDescription deployment) {
  Validate.notNull(deployment, "Deployment must be specified");
  validateNotSameNameAndTypeOfDeployment(deployment);
  validateNotSameArchiveAndSameTarget(deployment);
  this.deployments.add(new Deployment(deployment));
  return this;
}

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

public DeploymentScenario addDeployment(DeploymentDescription deployment) {
  Validate.notNull(deployment, "Deployment must be specified");
  validateNotSameNameAndTypeOfDeployment(deployment);
  validateNotSameArchiveAndSameTarget(deployment);
  this.deployments.add(new Deployment(deployment));
  return this;
}

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

@Test
public void shouldTransformException() throws Exception {
  TestExceptionDeployThrower.shouldThrow = new IllegalStateException();
  Mockito.when(serviceLoader.all(DeploymentExceptionTransformer.class))
    .thenReturn(Collections.singletonList(transformer));
  Mockito.when(transformer.transform(TestExceptionDeployThrower.shouldThrow))
    .thenReturn(new IllegalArgumentException());
  fire(new DeployDeployment(
    container,
    new Deployment(new DeploymentDescription("test", ShrinkWrap.create(JavaArchive.class))
      .setExpectedException(IllegalArgumentException.class))));
}

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

@Test
public void shouldCallDeploymentTransformers() throws Exception {
  TestExceptionDeployThrower.shouldThrow =
    new DeploymentException("Could not handle ba", new IllegalArgumentException());
  Mockito.when(serviceLoader.all(DeploymentExceptionTransformer.class))
    .thenReturn(Collections.singletonList(transformer));
  fire(new DeployDeployment(
    container,
    new Deployment(new DeploymentDescription("test", ShrinkWrap.create(JavaArchive.class))
      .setExpectedException(IllegalArgumentException.class))));
  Mockito.verify(transformer, Mockito.times(1)).transform(Mockito.isA(Exception.class));
}

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

@Test
public void shouldCallDeploymentTransformersWithEmptyCauseException() throws Exception {
  TestExceptionDeployThrower.shouldThrow =
    new DeploymentException("Could not handle ba", null);
  Mockito.when(serviceLoader.all(DeploymentExceptionTransformer.class))
    .thenReturn(Collections.singletonList(transformer));
  fire(new DeployDeployment(
    container,
    new Deployment(new DeploymentDescription("test", ShrinkWrap.create(JavaArchive.class))
      .setExpectedException(DeploymentException.class))));
  Mockito.verify(transformer, Mockito.times(1)).transform(TestExceptionDeployThrower.shouldThrow);
}

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

@Test(expected = DeploymentException.class)
public void shouldRethrowExceptionIfWrongExpectedType() throws Exception {
  TestExceptionDeployThrower.shouldThrow =
    new DeploymentException("Could not handle ba", new NullPointerException());
  Mockito.when(serviceLoader.all(DeploymentExceptionTransformer.class))
    .thenReturn(Collections.singletonList(transformer));
  fire(new DeployDeployment(
    container,
    new Deployment(new DeploymentDescription("test", ShrinkWrap.create(JavaArchive.class))
      .setExpectedException(IllegalArgumentException.class))));
}

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

@Test
public void shouldSwallawExceptionIfExpectedAndDeploymentExceptionIsFieldOfThrown() throws Exception {
  MyDeploymentException myException = new MyDeploymentException("My special exception", new NullPointerException());
  TestExceptionDeployThrower.shouldThrow = myException;
  Mockito.when(serviceLoader.all(DeploymentExceptionTransformer.class))
    .thenReturn(Collections.singletonList(transformer));
  Mockito.when(transformer.transform(TestExceptionDeployThrower.shouldThrow)).thenReturn(
    myException.getDeploymentException());
  fire(new DeployDeployment(container, new Deployment(new DeploymentDescription("test",
    ShrinkWrap.create(JavaArchive.class)).setExpectedException(NullPointerException.class))));
}

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

@Test(expected = DeploymentException.class)
public void shouldRethrowExceptionIfExpectedNotSet() throws Exception {
  TestExceptionDeployThrower.shouldThrow =
    new DeploymentException("Could not handle ba", new NullPointerException());
  fire(new DeployDeployment(
    container,
    new Deployment(new DeploymentDescription("test", ShrinkWrap.create(JavaArchive.class)))));
}

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

@Test
public void shouldSwallawExceptionIfExpectedAndDeploymentExceptionIsFieldOfThrownAndCauseOfOther() throws Exception {
  IllegalArgumentException recursiveException = new IllegalArgumentException(new MyDeploymentException(
    "My special exception", new NullPointerException()));
  TestExceptionDeployThrower.shouldThrow = recursiveException;
  Mockito.when(serviceLoader.all(DeploymentExceptionTransformer.class))
    .thenReturn(Collections.singletonList(transformer));
  Mockito.when(transformer.transform(TestExceptionDeployThrower.shouldThrow)).thenReturn(
    ((MyDeploymentException) recursiveException.getCause()).getDeploymentException());
  fire(new DeployDeployment(container, new Deployment(new DeploymentDescription("test",
    ShrinkWrap.create(JavaArchive.class)).setExpectedException(NullPointerException.class))));
}

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

@Test
public void shouldSwallowExceptionIfExpected() throws Exception {
  TestExceptionDeployThrower.shouldThrow =
    new DeploymentException("Could not handle ba", new NullPointerException());
  fire(new DeployDeployment(
    container,
    new Deployment(new DeploymentDescription("test", ShrinkWrap.create(JavaArchive.class))
      .setExpectedException(NullPointerException.class))));
}

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

@Test(expected = RuntimeException.class)
public void shouldThrowExceptionIfExpectedButNoExceptionThrown() throws Exception {
  TestExceptionDeployThrower.shouldThrow = null;
  fire(new DeployDeployment(
    container,
    new Deployment(new DeploymentDescription("test", ShrinkWrap.create(JavaArchive.class))
      .setExpectedException(IllegalArgumentException.class))));
}

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

.thenReturn(new ContainerImpl("Z", deployableContainer, new ContainerDefImpl("Z")));
Deployment deploymentZ = new Deployment(new DeploymentDescription("Z", ShrinkWrap.create(JavaArchive.class))
  .setTarget(new TargetDescription("Z")));
Deployment deploymentX = new Deployment(new DeploymentDescription("X", ShrinkWrap.create(JavaArchive.class))
  .setTarget(new TargetDescription("X")));

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

.thenReturn(new ContainerImpl("Z", deployableContainer, new ContainerDefImpl("Z")));
Deployment deploymentZ = new Deployment(new DeploymentDescription("Z", ShrinkWrap.create(JavaArchive.class))
  .setTarget(new TargetDescription("Z")));
Deployment deploymentX = new Deployment(new DeploymentDescription("X", ShrinkWrap.create(JavaArchive.class))
  .setTarget(new TargetDescription("X")));

相关文章