public Void call() throws Exception { for (Deployment d : suiteDeploymentScenario.deployments()) { deploymentEvent.fire(new DeployDeployment(findContainer(registry, event.getDeployableContainer()), d)); } return null; } });
public Void call() throws Exception { for (Deployment d : suiteDeploymentScenario.deployments()) { deploymentEvent.fire(new UnDeployDeployment(findContainer(registry, event.getDeployableContainer()), d)); } return null; } });
public Void call() throws Exception { for (Deployment d : suiteDeploymentScenario.deployments()) { deploymentEvent.fire(new UnDeployDeployment(findContainer(registry, event.getDeployableContainer()), d)); } return null; } });
public Void call() throws Exception { for (Deployment d : suiteDeploymentScenario.deployments()) { deploymentEvent.fire(new DeployDeployment(findContainer(registry, event.getDeployableContainer()), d)); } return null; } });
private void verifyScenario(String... names) { DeploymentScenario scenario = getManager().resolve(DeploymentScenario.class); Assert.assertEquals(names.length, scenario.deployments().size()); for (int i = 0; i < names.length; i++) { contains(scenario.deployments(), names[i]); } }
private void verifyScenario(String... names) { DeploymentScenario scenario = getManager().resolve(DeploymentScenario.class); Assert.assertEquals(names.length, scenario.deployments().size()); for (int i = 0; i < names.length; i++) { contains(scenario.deployments(), names[i]); } }
public Void call() throws Exception { for (Deployment d : suiteDeploymentScenario.deployments()) { deploymentEvent.fire(new DeployDeployment(findContainer(registry, event.getDeployableContainer()), d)); } return null; } });
/** * Verifies that deployments for Warp tests are all testable */ public void verifyWarpDeployment(@Observes DeploymentScenario deploymentScenario) { if (WarpCommons.isWarpTest(testClass.get().getJavaClass())) { for (Deployment deployment : deploymentScenario.deployments()) { DeploymentDescription description = deployment.getDescription(); if (!description.testable()) { throw new IllegalArgumentException( "Warp deployments must be testable: " + testClass.get().getJavaClass() + " - check that you have @Deployment(testable=true)"); } } } } }
public Void call() throws Exception { for (Deployment d : suiteDeploymentScenario.deployments()) { deploymentEvent.fire(new UnDeployDeployment(findContainer(registry, event.getDeployableContainer()), d)); } return null; } });
@Test public void shouldAllowMultipleArchiveDeploymentsWithSameArchiveNameWithDifferentTargets() { DeploymentScenario scenario = new DeploymentScenario(); scenario.addDeployment( new DeploymentDescription(DEFAULT_NAME, ShrinkWrap.create(JavaArchive.class, "test.jar")) .setTarget(TargetDescription.DEFAULT)); scenario.addDeployment( new DeploymentDescription("B", ShrinkWrap.create(JavaArchive.class, "test.jar")) .setTarget(new TargetDescription("B"))); Assert.assertEquals(2, scenario.deployments().size()); }
@Test public void shouldAllowMultipleArchiveDeploymentsWithSameArchiveNameWithDifferentTargets() { DeploymentScenario scenario = new DeploymentScenario(); scenario.addDeployment( new DeploymentDescription(DEFAULT_NAME, ShrinkWrap.create(JavaArchive.class, "test.jar")) .setTarget(TargetDescription.DEFAULT)); scenario.addDeployment( new DeploymentDescription("B", ShrinkWrap.create(JavaArchive.class, "test.jar")) .setTarget(new TargetDescription("B"))); Assert.assertEquals(2, scenario.deployments().size()); }
@Test // ARQ-971 @SuppressWarnings("unchecked") public void shouldFilterNullAuxiliaryArchiveAppenderResulsts() throws Exception { when(serviceLoader.all(eq(AuxiliaryArchiveAppender.class))) .thenReturn( create(AuxiliaryArchiveAppender.class, injectorInst.get().inject(new NullAuxiliaryArchiveAppender()))); addContainer(CONTAINER_NAME_1); addProtocol(PROTOCOL_NAME_1, true); fire(createEvent(DeploymentWithDefaults.class)); CallMap spi = getManager().resolve(CallMap.class); Assert.assertTrue(spi.wasCalled(AuxiliaryArchiveAppender.class)); DeploymentScenario scenario = getManager().resolve(DeploymentScenario.class); Assert.assertEquals(1, scenario.deployments().size()); ArgumentCaptor<TestDeployment> captor = ArgumentCaptor.forClass(TestDeployment.class); verify(packager).generateDeployment(captor.capture(), Mockito.any(Collection.class)); Assert.assertEquals(0, captor.getValue().getAuxiliaryArchives().size()); }
@Test // ARQ-971 @SuppressWarnings("unchecked") public void shouldFilterNullAuxiliaryArchiveAppenderResulsts() throws Exception { when(serviceLoader.all(eq(AuxiliaryArchiveAppender.class))) .thenReturn( create(AuxiliaryArchiveAppender.class, injectorInst.get().inject(new NullAuxiliaryArchiveAppender()))); addContainer(CONTAINER_NAME_1); addProtocol(PROTOCOL_NAME_1, true); fire(createEvent(DeploymentWithDefaults.class)); CallMap spi = getManager().resolve(CallMap.class); Assert.assertTrue(spi.wasCalled(AuxiliaryArchiveAppender.class)); DeploymentScenario scenario = getManager().resolve(DeploymentScenario.class); Assert.assertEquals(1, scenario.deployments().size()); ArgumentCaptor<TestDeployment> captor = ArgumentCaptor.forClass(TestDeployment.class); verify(packager).generateDeployment(captor.capture(), Mockito.any(Collection.class)); Assert.assertEquals(0, captor.getValue().getAuxiliaryArchives().size()); }
for (Deployment deployment : scenario.deployments()) { Container container = conReg.getContainer(deployment.getDescription().getTarget()); if ("custom".equalsIgnoreCase(container.getContainerConfiguration().getMode())) {
for (Deployment deployment : scenario.deployments()) { Container container = conReg.getContainer(deployment.getDescription().getTarget()); if ("custom".equalsIgnoreCase(container.getContainerConfiguration().getMode())) {
@Test public void shouldAddAdditionalObserverClasses() { addContainer("test-contianer").getContainerConfiguration().setMode("suite"); addProtocol(PROTOCOL_NAME_1, true); fire(createEvent(DeploymentWithObserver.class)); DeploymentScenario scenario = getManager().resolve(DeploymentScenario.class); Archive<?> archive = scenario.deployments().get(0).getDescription().getArchive(); verifyThatIsContainedInArchive(archive, DeploymentWithObserver.class); verifyThatIsContainedInArchive(archive, ObserverClass.class); verifyThatIsContainedInArchive(archive, SecondObserverClass.class); }
@Test public void shouldAddAdditionalObserverClasses() { addContainer("test-contianer").getContainerConfiguration().setMode("suite"); addProtocol(PROTOCOL_NAME_1, true); fire(createEvent(DeploymentWithObserver.class)); DeploymentScenario scenario = getManager().resolve(DeploymentScenario.class); Archive<?> archive = scenario.deployments().get(0).getDescription().getArchive(); verifyThatIsContainedInArchive(archive, DeploymentWithObserver.class); verifyThatIsContainedInArchive(archive, ObserverClass.class); verifyThatIsContainedInArchive(archive, SecondObserverClass.class); }
private void buildTestableDeployments(DeploymentScenario scenario, TestClass testCase, ProtocolRegistry protoReg) { for (Deployment deployment : scenario.deployments()) { DeploymentDescription description = deployment.getDescription(); if (!description.testable() || !description.isArchiveDeployment()) {
private void buildTestableDeployments(DeploymentScenario scenario, TestClass testCase, ProtocolRegistry protoReg) { for (Deployment deployment : scenario.deployments()) { DeploymentDescription description = deployment.getDescription(); if (!description.testable() || !description.isArchiveDeployment()) {