[jboss-cvs] JBossAS SVN: r64965 - in trunk/testsuite/src: resources/classloader/leak/war/WEB-INF and 8 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Thu Aug 30 08:32:13 EDT 2007
Author: alex.loubyansky at jboss.com
Date: 2007-08-30 08:32:13 -0400 (Thu, 30 Aug 2007)
New Revision: 64965
Modified:
trunk/testsuite/src/main/org/jboss/test/xml/DDValidatorUnitTestCase.java
trunk/testsuite/src/resources/classloader/leak/war/WEB-INF/jboss-web.xml
trunk/testsuite/src/resources/jca/inflowmdb/META-INF/ejb-jar.xml
trunk/testsuite/src/resources/jcaprops/goodmdb/META-INF/ejb-jar.xml
trunk/testsuite/src/resources/jcaprops/uppergoodmdb/META-INF/ejb-jar.xml
trunk/testsuite/src/resources/scoped/a/ear/META-INF/application.xml
trunk/testsuite/src/resources/scoped/a/ear/META-INF/jboss-app.xml
trunk/testsuite/src/resources/scoped/a/ejb/META-INF/jboss.xml
trunk/testsuite/src/resources/scoped/b/ear/META-INF/application.xml
trunk/testsuite/src/resources/scoped/b/ear/META-INF/jboss-app.xml
trunk/testsuite/src/resources/scoped/b/ejb/META-INF/jboss.xml
trunk/testsuite/src/resources/web/root-context/jboss-web.xml
Log:
JBAS-4643
Modified: trunk/testsuite/src/main/org/jboss/test/xml/DDValidatorUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/xml/DDValidatorUnitTestCase.java 2007-08-30 11:14:53 UTC (rev 64964)
+++ trunk/testsuite/src/main/org/jboss/test/xml/DDValidatorUnitTestCase.java 2007-08-30 12:32:13 UTC (rev 64965)
@@ -25,8 +25,11 @@
import java.io.InputStream;
import java.io.FileFilter;
import java.io.IOException;
-import java.util.Arrays;
import java.util.List;
+import java.util.ArrayList;
+import java.util.Set;
+import java.util.Collections;
+import java.util.HashSet;
import javax.xml.parsers.SAXParserFactory;
import javax.xml.parsers.SAXParser;
import org.xml.sax.SAXParseException;
@@ -55,6 +58,33 @@
FACTORY.setNamespaceAware(true);
}
+ private static final File RESOURCES = new File("resources");
+
+ private static final Set<String> IGNORE = new HashSet<String>();
+ static
+ {
+ // it's invalid on purpose
+ ignore("jmx/undeploy/bad-inf/ejb-jar.xml");
+ // contains property variable
+ ignore("messagedriven/jmscontainerinvoker/META-INF/ejb-jar.xml");
+
+ // these don't include any module
+ ignore("classloader/concurrentloader/application.xml");
+ ignore("classloader/resource/application.xml");
+ ignore("deployers/jbas2904/ear/META-INF/application.xml");
+ ignore("jmx/loading/ext/application.xml");
+ ignore("kernel/deployment/dependspojoear/META-INF/application.xml");
+ ignore("util/scheduler/application.xml");
+ }
+
+ private static void ignore(String path)
+ {
+ if('/' != File.separatorChar)
+ path = path.replace('/', File.separatorChar);
+ path = RESOURCES.getAbsolutePath() + File.separatorChar + path;
+ IGNORE.add(path);
+ }
+
private int total;
private int invalid;
@@ -110,12 +140,18 @@
private void validate(String ddName)
{
- File resources = new File("resources");
- scan(resources, Arrays.asList(ddName), false);
- assertEquals(invalid + " from " + total + " are invalid", 0, invalid);
+ List<String> invalidList = new ArrayList<String>();
+ scan(RESOURCES, Collections.singleton(ddName), invalidList, false);
+ assertEquals(invalid + " from " + total + " are invalid: " + invalidList, 0, invalid);
}
- private void scan(java.io.File f, final List names, final boolean failIfInvalid)
+ /**
+ * @param f the directory in which to search for files
+ * @param names the files to validate
+ * @param invalidList a list of error messages
+ * @param failIfInvalid whether to fail immediately after the first invalid file
+ */
+ private void scan(java.io.File f, final Set<String> names, final List<String> invalidList, final boolean failIfInvalid)
{
f.listFiles(new FileFilter()
{
@@ -123,14 +159,14 @@
{
if (pathname.isDirectory())
{
- scan(pathname, names, failIfInvalid);
+ scan(pathname, names, invalidList, failIfInvalid);
return true;
}
- if (names.contains(pathname.getName()))
+ if (!IGNORE.contains(pathname.getAbsolutePath()) && names.contains(pathname.getName()))
{
++total;
- if (!validate(pathname, failIfInvalid))
+ if (!validate(pathname, invalidList, failIfInvalid))
{
++invalid;
}
@@ -142,7 +178,7 @@
});
}
- private boolean validate(File file, boolean failIfInvalid)
+ private boolean validate(File file, List<String> invalidList, boolean failIfInvalid)
{
InputStream is;
try
@@ -185,6 +221,8 @@
{
getLog().debug(msg.toString());
}
+
+ invalidList.add(msg.toString());
}
else
{
@@ -197,7 +235,7 @@
private static void parse(InputStream xmlIs, final EntityResolver resolver)
{
- SAXParser parser = null;
+ SAXParser parser;
try
{
parser = FACTORY.newSAXParser();
Modified: trunk/testsuite/src/resources/classloader/leak/war/WEB-INF/jboss-web.xml
===================================================================
--- trunk/testsuite/src/resources/classloader/leak/war/WEB-INF/jboss-web.xml 2007-08-30 11:14:53 UTC (rev 64964)
+++ trunk/testsuite/src/resources/classloader/leak/war/WEB-INF/jboss-web.xml 2007-08-30 12:32:13 UTC (rev 64965)
@@ -1,3 +1,7 @@
+<!DOCTYPE jboss-web
+ PUBLIC "-//JBoss//DTD Web Application 2.3V2//EN"
+ "http://www.jboss.org/j2ee/dtd/jboss-web_3_2.dtd">
+
<jboss-web>
<context-root>/classloader-leak</context-root>
</jboss-web>
Modified: trunk/testsuite/src/resources/jca/inflowmdb/META-INF/ejb-jar.xml
===================================================================
--- trunk/testsuite/src/resources/jca/inflowmdb/META-INF/ejb-jar.xml 2007-08-30 11:14:53 UTC (rev 64964)
+++ trunk/testsuite/src/resources/jca/inflowmdb/META-INF/ejb-jar.xml 2007-08-30 12:32:13 UTC (rev 64965)
@@ -11,6 +11,7 @@
<ejb-name>TestMDB</ejb-name>
<ejb-class>org.jboss.test.jca.inflowmdb.TestMDBMessageListener</ejb-class>
<messaging-type>org.jboss.test.jca.inflow.TestMessageListener</messaging-type>
+ <transaction-type>Container</transaction-type>
<activation-config>
<activation-config-property>
<activation-config-property-name>name</activation-config-property-name>
@@ -37,8 +38,7 @@
key3=value3
</activation-config-property-value>
</activation-config-property>
- </activation-config>
- <transaction-type>Container</transaction-type>
+ </activation-config>
</message-driven>
</enterprise-beans>
Modified: trunk/testsuite/src/resources/jcaprops/goodmdb/META-INF/ejb-jar.xml
===================================================================
--- trunk/testsuite/src/resources/jcaprops/goodmdb/META-INF/ejb-jar.xml 2007-08-30 11:14:53 UTC (rev 64964)
+++ trunk/testsuite/src/resources/jcaprops/goodmdb/META-INF/ejb-jar.xml 2007-08-30 12:32:13 UTC (rev 64965)
@@ -13,6 +13,7 @@
<ejb-name>JCAPropsMDB</ejb-name>
<ejb-class>org.jboss.test.jcaprops.support.PropertyTestListenerImpl</ejb-class>
<messaging-type>org.jboss.test.jcaprops.support.PropertyTestListener</messaging-type>
+ <transaction-type>Container</transaction-type>
<activation-config>
<activation-config-property>
<activation-config-property-name>stringAS</activation-config-property-name>
@@ -51,8 +52,7 @@
<activation-config-property-name>doubleAS</activation-config-property-name>
<activation-config-property-value>7e18</activation-config-property-value>
</activation-config-property>
- </activation-config>
- <transaction-type>Container</transaction-type>
+ </activation-config>
</message-driven>
</enterprise-beans>
Modified: trunk/testsuite/src/resources/jcaprops/uppergoodmdb/META-INF/ejb-jar.xml
===================================================================
--- trunk/testsuite/src/resources/jcaprops/uppergoodmdb/META-INF/ejb-jar.xml 2007-08-30 11:14:53 UTC (rev 64964)
+++ trunk/testsuite/src/resources/jcaprops/uppergoodmdb/META-INF/ejb-jar.xml 2007-08-30 12:32:13 UTC (rev 64965)
@@ -13,6 +13,7 @@
<ejb-name>JCAPropsMDB</ejb-name>
<ejb-class>org.jboss.test.jcaprops.support.PropertyTestListenerImpl</ejb-class>
<messaging-type>org.jboss.test.jcaprops.support.PropertyTestListener</messaging-type>
+ <transaction-type>Container</transaction-type>
<activation-config>
<activation-config-property>
<activation-config-property-name>StringAS</activation-config-property-name>
@@ -51,8 +52,7 @@
<activation-config-property-name>DoubleAS</activation-config-property-name>
<activation-config-property-value>7e18</activation-config-property-value>
</activation-config-property>
- </activation-config>
- <transaction-type>Container</transaction-type>
+ </activation-config>
</message-driven>
</enterprise-beans>
Modified: trunk/testsuite/src/resources/scoped/a/ear/META-INF/application.xml
===================================================================
--- trunk/testsuite/src/resources/scoped/a/ear/META-INF/application.xml 2007-08-30 11:14:53 UTC (rev 64964)
+++ trunk/testsuite/src/resources/scoped/a/ear/META-INF/application.xml 2007-08-30 12:32:13 UTC (rev 64965)
@@ -1,4 +1,7 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE application PUBLIC
+ "-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN"
+ "http://java.sun.com/dtd/application_1_3.dtd">
<application>
<display-name>scopedA</display-name>
Modified: trunk/testsuite/src/resources/scoped/a/ear/META-INF/jboss-app.xml
===================================================================
--- trunk/testsuite/src/resources/scoped/a/ear/META-INF/jboss-app.xml 2007-08-30 11:14:53 UTC (rev 64964)
+++ trunk/testsuite/src/resources/scoped/a/ear/META-INF/jboss-app.xml 2007-08-30 12:32:13 UTC (rev 64965)
@@ -1,3 +1,7 @@
+<!DOCTYPE jboss-app
+ PUBLIC "-//JBoss//DTD J2EE Application 1.3V2//EN"
+ "http://www.jboss.org/j2ee/dtd/jboss-app_3_2.dtd">
+
<jboss-app>
<loader-repository>jboss.test:loader=sessionA.ear
<loader-repository-config>java2ParentDelegation=false</loader-repository-config>
Modified: trunk/testsuite/src/resources/scoped/a/ejb/META-INF/jboss.xml
===================================================================
--- trunk/testsuite/src/resources/scoped/a/ejb/META-INF/jboss.xml 2007-08-30 11:14:53 UTC (rev 64964)
+++ trunk/testsuite/src/resources/scoped/a/ejb/META-INF/jboss.xml 2007-08-30 12:32:13 UTC (rev 64965)
@@ -1,4 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS 5.0//EN" "http://www.jboss.org/j2ee/dtd/jboss_5_0.dtd">
<jboss>
<enterprise-beans>
Modified: trunk/testsuite/src/resources/scoped/b/ear/META-INF/application.xml
===================================================================
--- trunk/testsuite/src/resources/scoped/b/ear/META-INF/application.xml 2007-08-30 11:14:53 UTC (rev 64964)
+++ trunk/testsuite/src/resources/scoped/b/ear/META-INF/application.xml 2007-08-30 12:32:13 UTC (rev 64965)
@@ -1,4 +1,7 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE application PUBLIC
+ "-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN"
+ "http://java.sun.com/dtd/application_1_3.dtd">
<application>
<display-name>scopedB</display-name>
Modified: trunk/testsuite/src/resources/scoped/b/ear/META-INF/jboss-app.xml
===================================================================
--- trunk/testsuite/src/resources/scoped/b/ear/META-INF/jboss-app.xml 2007-08-30 11:14:53 UTC (rev 64964)
+++ trunk/testsuite/src/resources/scoped/b/ear/META-INF/jboss-app.xml 2007-08-30 12:32:13 UTC (rev 64965)
@@ -1,3 +1,7 @@
+<!DOCTYPE jboss-app
+ PUBLIC "-//JBoss//DTD J2EE Application 1.3V2//EN"
+ "http://www.jboss.org/j2ee/dtd/jboss-app_3_2.dtd">
+
<jboss-app>
<loader-repository>jboss.test:loader=sessionB.ear
<loader-repository-config>java2ParentDelegation=false</loader-repository-config>
Modified: trunk/testsuite/src/resources/scoped/b/ejb/META-INF/jboss.xml
===================================================================
--- trunk/testsuite/src/resources/scoped/b/ejb/META-INF/jboss.xml 2007-08-30 11:14:53 UTC (rev 64964)
+++ trunk/testsuite/src/resources/scoped/b/ejb/META-INF/jboss.xml 2007-08-30 12:32:13 UTC (rev 64965)
@@ -1,4 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS 5.0//EN" "http://www.jboss.org/j2ee/dtd/jboss_5_0.dtd">
<jboss>
<enterprise-beans>
Modified: trunk/testsuite/src/resources/web/root-context/jboss-web.xml
===================================================================
--- trunk/testsuite/src/resources/web/root-context/jboss-web.xml 2007-08-30 11:14:53 UTC (rev 64964)
+++ trunk/testsuite/src/resources/web/root-context/jboss-web.xml 2007-08-30 12:32:13 UTC (rev 64965)
@@ -1,3 +1,6 @@
+<!DOCTYPE jboss-web
+ PUBLIC "-//JBoss//DTD Web Application 2.3V2//EN"
+ "http://www.jboss.org/j2ee/dtd/jboss-web_3_2.dtd">
<jboss-web>
<context-root />
</jboss-web>
\ No newline at end of file
More information about the jboss-cvs-commits
mailing list