Warn to be used wrong fragment name at web.xml!
authorpero <pero@13f79535-47bb-0310-9956-ffa450edef68>
Fri, 14 May 2010 12:07:00 +0000 (12:07 +0000)
committerpero <pero@13f79535-47bb-0310-9956-ffa450edef68>
Fri, 14 May 2010 12:07:00 +0000 (12:07 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@944217 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/catalina/deploy/LocalStrings.properties
java/org/apache/catalina/deploy/WebXml.java
test/org/apache/catalina/deploy/TestWebXmlOrdering.java

index cb6d1ff..c4f0e43 100644 (file)
@@ -41,3 +41,4 @@ webXml.mergeConflictString=The [{0}] with name [{1}] was defined inconsistently
 webXml.multipleOther=Multiple others entries in ordering
 webxml.unrecognisedPublicId=The public ID [{0}] did not match any of the known public ID's for web.xml files so the version could not be identified
 webXml.version.nfe=Unable to parse [{0}] from the version string [{1}]. This component of the version string will be ignored. 
+webXml.wrongFragmentName=Used a wrong fragment name {0} at web.xml absolute-ordering tag!
index 7ee63f6..cd85fc8 100644 (file)
@@ -2101,6 +2101,8 @@ public class WebXml {
                     WebXml fragment = fragments.get(requestedName);
                     if (fragment != null) {
                         orderedFragments.add(fragment);
+                    } else {
+                        log.warn(sm.getString("webXml.wrongFragmentName",requestedName));
                     }
                 }
             }
index a189163..64b59c7 100644 (file)
@@ -144,6 +144,14 @@ public class TestWebXmlOrdering extends TestCase {
         assertFalse(iter.hasNext());
     }
 
+    public void testWebFragmentsAbsoluteWrongFragmentName() {
+        app.addAbsoluteOrdering("a");
+        app.addAbsoluteOrdering("z");
+        Set<WebXml> ordered = WebXml.orderWebFragments(app, fragments);
+        assertEquals(1,ordered.size());
+        assertEquals(fragments.get("a"),ordered.toArray()[0]);
+    }
+    
     public void testOrderWebFragmentsAbsoluteOthersEnd() {
         app.addAbsoluteOrdering("b");
         app.addAbsoluteOrdering("d");