@Before public void setUp() { try { deployer.deploy("deployment"); // The failing configurator provokes a RuntimeException in a servlet context listener. // Apparently such an exception needs not cancel the deployment of a Java EE application. // That means deployment fails for some servers and for others not. // => we don't care if there is an exception here or not }catch (Exception e) { } }
@Test public void testXmlInvalid() { try { deployer.deploy(DEPLOYMENT); Assert.fail("exception expected"); }catch (Exception e) { // expected } }
@Test @InSequence(1) public void testPriorityOnTimerStartEvent() { // when try { deployer.deploy("timerStart"); } catch (Exception e) { e.printStackTrace(); Assert.fail("deployment should be successful, i.e. bean for timer start event should get resolved"); } }
@Test public void test() { try { deployer.deploy(DEPLOYMENT); Assert.fail("failure expected"); } catch (Exception e) { // expected } }
@Test @RunAsClient public void testDeploymentFails(){ try { deployer.deploy(DEPLOYMENT_WITH_EJB_PA); Assert.fail("Deployment exception expected"); } catch(Exception e) { // expected } try { deployer.deploy(DEPLOYMENT_WITH_SERVLET_PA); Assert.fail("Deployment exception expected"); } catch(Exception e) { // expected } }
@Test @RunAsClient public void testDeployDroolsFails() { try { deployer.deploy("deployment"); Assert.fail("exception expected"); }catch (Exception e) { // expected } }
@Test @RunAsClient public void testDeployProcessArchive() { try { deployer.deploy("deployment"); Assert.fail("exception expected"); }catch (Exception e) { // expected } }
/** * This is not a real test method. * * @see #testApplicationContextDestroyed(URL, URL) */ @Test(groups = INTEGRATION) @InSequence(1) public void deployArchives() { // In order to use @ArquillianResource URLs we need to deploy both test archives first deployer.deploy(ALPHA_DEPLOYMENT_NAME); deployer.deploy(BRAVO_ARCHIVE_NAME); }
/** * This is not a real test method. * * @see #testEnhancedListenerDoesNotDestroyWeldIfListenerRegistered(URL) */ @Test @InSequence(1) public void deployArchives() { // In order to use @ArquillianResource URLs we need to deploy both test archives first deployer.deploy(TEST); deployer.deploy(ASSERT); }
public void deploy(@Observes DeployDeploymentCommand event) { deployerInst.get().deploy(event.getDeploymentName()); event.setResult("SUCCESS"); }
@Test(expected = IllegalArgumentException.class) public void shouldThrowExceptionOnDeployWhenNotFound() throws Exception { deployer.get().deploy("UNKNOWN_DEPLOYMENT"); }
@Test @RunAsClient @InSequence(2) public void deployMain() { deployer.deploy( MAIN_DEPLOYMENT ); }
@Test @RunAsClient @InSequence(0) public void deployErrorChecking() { deployer.deploy( ERROR_CHECKING_DEPLOYMENT ); }
@Test @InSequence(1) @RunAsClient public void testDeploy() { deployer.deploy("app"); }
@Test(expected = IllegalArgumentException.class) public void shouldThrowExceptionOnDeployWhenContainerNotStarted() throws Exception { DeploymentDescription description = new DeploymentDescription(DEPLOYMENT_NAME, ShrinkWrap.create(JavaArchive.class)); description.setTarget(new TargetDescription("_CONTAINER_STOPPED_")); scenario.get().addDeployment(description); deployer.get().deploy(DEPLOYMENT_NAME); }
@Test(expected = IllegalArgumentException.class) public void shouldThrowExceptionOnDeployWhenContainerNotStarted() throws Exception { DeploymentDescription description = new DeploymentDescription(DEPLOYMENT_NAME, ShrinkWrap.create(JavaArchive.class)); description.setTarget(new TargetDescription("_CONTAINER_STOPPED_")); scenario.get().addDeployment(description); deployer.get().deploy(DEPLOYMENT_NAME); }
@Test public void shouldFireDeploymentEventOnDeploy() throws Exception { DeploymentDescription description = new DeploymentDescription(DEPLOYMENT_NAME, ShrinkWrap.create(JavaArchive.class)); description.shouldBeManaged(false); description.setTarget(new TargetDescription("_DEFAULT_")); scenario.get().addDeployment(description); deployer.get().deploy(DEPLOYMENT_NAME); assertEventFired(DeployDeployment.class, 1); }
@Test public void shouldFireDeploymentEventOnDeploy() throws Exception { DeploymentDescription description = new DeploymentDescription(DEPLOYMENT_NAME, ShrinkWrap.create(JavaArchive.class)); description.shouldBeManaged(false); description.setTarget(new TargetDescription("_DEFAULT_")); scenario.get().addDeployment(description); deployer.get().deploy(DEPLOYMENT_NAME); assertEventFired(DeployDeployment.class, 1); }