Author: markt Date: Wed May 15 08:38:04 2013 New Revision: 1482723 URL: http://svn.apache.org/r1482723 Log: More deployment tests
Modified: tomcat/trunk/test/org/apache/catalina/startup/TestHostConfigAutomaticDeployment.java Modified: tomcat/trunk/test/org/apache/catalina/startup/TestHostConfigAutomaticDeployment.java URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/startup/TestHostConfigAutomaticDeployment.java?rev=1482723&r1=1482722&r2=1482723&view=diff ============================================================================== --- tomcat/trunk/test/org/apache/catalina/startup/TestHostConfigAutomaticDeployment.java (original) +++ tomcat/trunk/test/org/apache/catalina/startup/TestHostConfigAutomaticDeployment.java Wed May 15 08:38:04 2013 @@ -694,32 +694,43 @@ public class TestHostConfigAutomaticDepl @Test public void testDeleteDirRemoveDir() throws Exception { doTestDelete(false, false, false, false, true, DIR, false, false, false, - false, null); + null); } @Test public void testDeleteWarRemoveWar() throws Exception { doTestDelete(false, false, false, true, false, WAR, false, false, false, - false, null); + null); } @Test public void testDeleteWarDirRemoveDir() throws Exception { - doTestDelete(false, false, false, true, true, DIR, false, false, true, - true, WAR_COOKIE_NAME); + doTestDelete(false, false, false, true, true, DIR, false, true, true, + WAR_COOKIE_NAME); } @Test public void testDeleteWarDirRemoveWar() throws Exception { doTestDelete(false, false, false, true, true, WAR, false, false, false, - false, null); + null); + } + + @Test + public void testDeleteXmlRemoveXml() throws Exception { + doTestDelete(true, false, false, false, false, XML, false, false, false, + null); + } + + // @Test Disable as this currently fails + public void testDeleteXmlDirRemoveDir() throws Exception { + doTestDelete(true, false, false, false, true, DIR, true, false, false, + null); } private void doTestDelete(boolean startXml, boolean startExternalWar, boolean startExternalDir, boolean startWar, boolean startDir, - int toDelete, boolean resultXml, boolean resultExternal, - boolean resultWar, boolean resultDir, String resultCookieName) - throws Exception { + int toDelete, boolean resultXml, boolean resultWar, + boolean resultDir, String resultCookieName) throws Exception { Tomcat tomcat = getTomcatInstance(); StandardHost host = (StandardHost) tomcat.getHost(); @@ -820,13 +831,36 @@ public class TestHostConfigAutomaticDepl Context ctxt = (Context) host.findChild(APP_NAME.getName()); // Check the results - if (!resultXml && !resultWar && !resultDir) { - // App should have been undeployed + if (resultXml) { + if (xml == null) { + Assert.fail(); + } else { + Assert.assertTrue(xml.isFile()); + } + } + if (resultWar) { + if (war == null) { + Assert.fail(); + } else { + Assert.assertTrue(war.isFile()); + } + } + if (resultDir) { + if (dir == null) { + Assert.fail(); + } else { + Assert.assertTrue(dir.isDirectory()); + } + } + + if (!resultXml && (startExternalWar || startExternalDir)) { + Assert.assertNull(ctxt); + } + if (!resultWar && !resultDir) { Assert.assertNull(ctxt); - return; } - if (resultWar) { + if (ctxt != null) { Assert.assertEquals(resultCookieName, ctxt.getSessionCookieName()); } } --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org