tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1226385 - /tomcat/trunk/test/org/apache/catalina/startup/TestWebRuleSet.java
Date Mon, 02 Jan 2012 10:31:07 GMT
Author: markt
Date: Mon Jan  2 10:31:06 2012
New Revision: 1226385

URL: http://svn.apache.org/viewvc?rev=1226385&view=rev
Log:
Add some debug that might explain why Gump runs are failing

Modified:
    tomcat/trunk/test/org/apache/catalina/startup/TestWebRuleSet.java

Modified: tomcat/trunk/test/org/apache/catalina/startup/TestWebRuleSet.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/startup/TestWebRuleSet.java?rev=1226385&r1=1226384&r2=1226385&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/catalina/startup/TestWebRuleSet.java (original)
+++ tomcat/trunk/test/org/apache/catalina/startup/TestWebRuleSet.java Mon Jan  2 10:31:06
2012
@@ -46,14 +46,14 @@ public class TestWebRuleSet {
 
         WebXml webXml = new WebXml();
 
-        assertTrue(parse(webXml, "web-fragment-1name.xml", true));
+        parse(webXml, "web-fragment-1name.xml", true, true);
         assertEquals("name1", webXml.getName());
     }
 
 
     @Test
     public void testMultipleNameInWebFragmentXml() throws Exception {
-        assertFalse(parse(new WebXml(), "web-fragment-2name.xml", true));
+        parse(new WebXml(), "web-fragment-2name.xml", true, false);
     }
 
 
@@ -62,7 +62,7 @@ public class TestWebRuleSet {
 
         WebXml webXml = new WebXml();
 
-        assertTrue(parse(webXml, "web-fragment-1ordering.xml", true));
+        parse(webXml, "web-fragment-1ordering.xml", true, true);
         assertEquals(1, webXml.getBeforeOrdering().size());
         assertTrue(webXml.getBeforeOrdering().contains("bar"));
     }
@@ -70,7 +70,7 @@ public class TestWebRuleSet {
 
     @Test
     public void testMultipleOrderingInWebFragmentXml() throws Exception {
-        assertFalse(parse(new WebXml(), "web-fragment-2ordering.xml", true));
+        parse(new WebXml(), "web-fragment-2ordering.xml", true, false);
     }
 
 
@@ -79,7 +79,7 @@ public class TestWebRuleSet {
 
         WebXml webXml = new WebXml();
 
-        assertTrue(parse(webXml, "web-1ordering.xml", false));
+        parse(webXml, "web-1ordering.xml", false, true);
         assertEquals(1, webXml.getAbsoluteOrdering().size());
         assertTrue(webXml.getAbsoluteOrdering().contains("bar"));
     }
@@ -87,34 +87,34 @@ public class TestWebRuleSet {
 
     @Test
     public void testMultipleOrderingInWebXml() throws Exception {
-        assertFalse(parse(new WebXml(), "web-2ordering.xml", false));
+        parse(new WebXml(), "web-2ordering.xml", false, false);
     }
 
 
     @Test
     public void testRecycle() throws Exception {
         // Name
-        assertFalse(parse(new WebXml(), "web-fragment-2name.xml", true));
-        assertTrue(parse(new WebXml(), "web-fragment-1name.xml", true));
-        assertFalse(parse(new WebXml(), "web-fragment-2name.xml", true));
-        assertTrue(parse(new WebXml(), "web-fragment-1name.xml", true));
+        parse(new WebXml(), "web-fragment-2name.xml", true, false);
+        parse(new WebXml(), "web-fragment-1name.xml", true, true);
+        parse(new WebXml(), "web-fragment-2name.xml", true, false);
+        parse(new WebXml(), "web-fragment-1name.xml", true, true);
 
         // Relative ordering
-        assertFalse(parse(new WebXml(), "web-fragment-2ordering.xml", true));
-        assertTrue(parse(new WebXml(), "web-fragment-1ordering.xml", true));
-        assertFalse(parse(new WebXml(), "web-fragment-2ordering.xml", true));
-        assertTrue(parse(new WebXml(), "web-fragment-1ordering.xml", true));
+        parse(new WebXml(), "web-fragment-2ordering.xml", true, false);
+        parse(new WebXml(), "web-fragment-1ordering.xml", true, true);
+        parse(new WebXml(), "web-fragment-2ordering.xml", true, false);
+        parse(new WebXml(), "web-fragment-1ordering.xml", true, true);
 
         // Absolute ordering
-        assertFalse(parse(new WebXml(), "web-2ordering.xml", false));
-        assertTrue(parse(new WebXml(), "web-1ordering.xml", false));
-        assertFalse(parse(new WebXml(), "web-2ordering.xml", false));
-        assertTrue(parse(new WebXml(), "web-1ordering.xml", false));
+        parse(new WebXml(), "web-2ordering.xml", false, false);
+        parse(new WebXml(), "web-1ordering.xml", false, true);
+        parse(new WebXml(), "web-2ordering.xml", false, false);
+        parse(new WebXml(), "web-1ordering.xml", false, true);
 }
 
 
-    private synchronized boolean parse(WebXml webXml, String target,
-            boolean fragment) {
+    private synchronized void parse(WebXml webXml, String target,
+            boolean fragment, boolean expected) {
 
         Digester d;
         if (fragment) {
@@ -135,9 +135,17 @@ public class TestWebRuleSet {
         try {
             d.parse(is);
         } catch (Exception e) {
+            if (expected) {
+                // Didn't expect an exception
+                e.printStackTrace();
+            }
             result = false;
         }
 
-        return result;
+        if (expected) {
+            assertTrue(result);
+        } else {
+            assertFalse(result);
+        }
     }
 }



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


Mime
View raw message