You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2014/02/16 17:11:34 UTC

svn commit: r1568787 - /tomcat/tc7.0.x/trunk/test/org/apache/catalina/startup/TestHostConfigAutomaticDeployment.java

Author: markt
Date: Sun Feb 16 16:11:33 2014
New Revision: 1568787

URL: http://svn.apache.org/r1568787
Log:
Clearer error message if we see test failures on Windows due to JVM bug.
Fix some IDE warnings.

Modified:
    tomcat/tc7.0.x/trunk/test/org/apache/catalina/startup/TestHostConfigAutomaticDeployment.java

Modified: tomcat/tc7.0.x/trunk/test/org/apache/catalina/startup/TestHostConfigAutomaticDeployment.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/test/org/apache/catalina/startup/TestHostConfigAutomaticDeployment.java?rev=1568787&r1=1568786&r2=1568787&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/test/org/apache/catalina/startup/TestHostConfigAutomaticDeployment.java (original)
+++ tomcat/tc7.0.x/trunk/test/org/apache/catalina/startup/TestHostConfigAutomaticDeployment.java Sun Feb 16 16:11:33 2014
@@ -920,6 +920,7 @@ public class TestHostConfigAutomaticDepl
         }
         if (!resultWar && !resultDir) {
             if (resultXml) {
+                Assert.assertNotNull(ctxt);
                 Assert.assertEquals(LifecycleState.FAILED, ctxt.getState());
             } else {
                 Assert.assertNull(ctxt);
@@ -1136,14 +1137,22 @@ public class TestHostConfigAutomaticDepl
                 if (ext == null) {
                     Assert.fail();
                 } else {
-                    ext.setLastModified(System.currentTimeMillis() + 5000);
+                    if (!ext.setLastModified(System.currentTimeMillis() + 5000)){
+                        Assert.fail("Failed to set last modified time for " +
+                                "external WAR file. This is expected (due to " +
+                                "a JVM bug) with Java 6 on Windows.");
+                    }
                 }
                 break;
             case WAR:
                 if (war == null) {
                     Assert.fail();
                 } else {
-                    war.setLastModified(System.currentTimeMillis() + 5000);
+                    if (!war.setLastModified(System.currentTimeMillis() + 5000)) {
+                        Assert.fail("Failed to set last modified time for WAR " +
+                                "file. This is expected (due to a JVM bug) " +
+                                "with Java 6 on Windows.");
+                    }
                 }
                 break;
             case DIR:
@@ -1194,6 +1203,7 @@ public class TestHostConfigAutomaticDepl
         }
         if (!resultWar && !resultDir) {
             if (resultXml) {
+                Assert.assertNotNull(newContext);
                 if (!startExternalWar && !startExternalDir) {
                     Assert.assertEquals(LifecycleState.FAILED,
                             newContext.getState());
@@ -1514,6 +1524,7 @@ public class TestHostConfigAutomaticDepl
         }
         if (!resultWar && !resultDir) {
             if (resultXml) {
+                Assert.assertNotNull(newContext);
                 if (!startExternalWar && !startExternalDir) {
                     Assert.assertEquals(LifecycleState.FAILED,
                             newContext.getState());



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org