/** * Test deployment of an expanded WAR in a custom context. * @throws Exception If anything goes wrong. */ public void testDeployToNonExistingDirectory() throws Exception { WAR war = new WAR("ram:///some/warfile.war"); this.fsManager.resolveFile(war.getFile()).createFile(); AbstractCopyingInstalledLocalDeployer deployer = new TestableCopyingDeployerWithDifferentDirectory( createContainer(createContainerCapability(DeployableType.WAR), null)); try { deployer.deploy(war); fail("Should have thrown a CargoException here"); } catch (CargoException expected) { assertTrue("Incorrect message: " + expected.getMessage(), expected.getMessage().contains("ram:///webapps-nonexisting")); } }