struts-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lukaszlen...@apache.org
Subject [10/50] [abbrv] struts git commit: WW-3710 Adds test to proof support for wildcards in <include/>
Date Fri, 15 Jul 2016 13:18:37 GMT
WW-3710 Adds test to proof support for wildcards in <include/>


Project: http://git-wip-us.apache.org/repos/asf/struts/repo
Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/dad437bd
Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/dad437bd
Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/dad437bd

Branch: refs/heads/master
Commit: dad437bd06a015c673157097d41c7c5f25b7f84f
Parents: fd33dc8
Author: Lukasz Lenart <lukaszlenart@apache.org>
Authored: Tue Jan 5 08:16:26 2016 +0100
Committer: Lukasz Lenart <lukasz.lenart@gmail.com>
Committed: Tue Jan 19 16:18:00 2016 +0100

----------------------------------------------------------------------
 .../providers/XmlConfigurationProviderTest.java     | 16 ++++++++++++++++
 .../providers/xwork-test-include-wildcard.xml       |  8 ++++++++
 2 files changed, 24 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/struts/blob/dad437bd/core/src/test/java/com/opensymphony/xwork2/config/providers/XmlConfigurationProviderTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/com/opensymphony/xwork2/config/providers/XmlConfigurationProviderTest.java
b/core/src/test/java/com/opensymphony/xwork2/config/providers/XmlConfigurationProviderTest.java
index b161d02..6d324cf 100644
--- a/core/src/test/java/com/opensymphony/xwork2/config/providers/XmlConfigurationProviderTest.java
+++ b/core/src/test/java/com/opensymphony/xwork2/config/providers/XmlConfigurationProviderTest.java
@@ -31,6 +31,7 @@ import java.net.URL;
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
+import java.util.Set;
 
 
 public class XmlConfigurationProviderTest extends ConfigurationTestBase {
@@ -198,4 +199,19 @@ public class XmlConfigurationProviderTest extends ConfigurationTestBase
{
         assertTrue(!provider.needsReload());
     }
 
+    public void testIncludeWithWildcard() throws Exception {
+        String configFile = "com/opensymphony/xwork2/config/providers/xwork-test-include-wildcard.xml";
+        buildConfigurationProvider(configFile);
+
+        Set<String> loadedFileNames = configuration.getLoadedFileNames();
+        assertEquals(8, loadedFileNames.size());
+        assertTrue(loadedFileNames.contains("com/opensymphony/xwork2/config/providers/xwork-include-after-package.xml"));
+        assertTrue(loadedFileNames.contains("com/opensymphony/xwork2/config/providers/xwork-include-after-package-2.xml"));
+        assertTrue(loadedFileNames.contains("com/opensymphony/xwork2/config/providers/xwork-include-before-package.xml"));
+        assertTrue(loadedFileNames.contains("com/opensymphony/xwork2/config/providers/xwork-include-before-package-2.xml"));
+        assertTrue(loadedFileNames.contains("com/opensymphony/xwork2/config/providers/xwork-include-parent.xml"));
+        assertTrue(loadedFileNames.contains("com/opensymphony/xwork2/config/providers/xwork-test-include-wildcard.xml"));
+        assertTrue(loadedFileNames.contains("xwork-test-beans.xml"));
+        assertTrue(loadedFileNames.contains("xwork-test-default.xml"));
+    }
 }

http://git-wip-us.apache.org/repos/asf/struts/blob/dad437bd/core/src/test/resources/com/opensymphony/xwork2/config/providers/xwork-test-include-wildcard.xml
----------------------------------------------------------------------
diff --git a/core/src/test/resources/com/opensymphony/xwork2/config/providers/xwork-test-include-wildcard.xml
b/core/src/test/resources/com/opensymphony/xwork2/config/providers/xwork-test-include-wildcard.xml
new file mode 100644
index 0000000..6bf5cc6
--- /dev/null
+++ b/core/src/test/resources/com/opensymphony/xwork2/config/providers/xwork-test-include-wildcard.xml
@@ -0,0 +1,8 @@
+<!DOCTYPE xwork PUBLIC
+    "-//Apache Struts//XWork 2.1//EN"
+    "http://struts.apache.org/dtds/xwork-2.1.dtd"
+    >
+
+<xwork>
+  <include file="com/opensymphony/xwork2/config/providers/xwork-include-*.xml"/>
+</xwork>


Mime
View raw message