[jboss-cvs] JBossAS SVN: r82191 - in projects/metadata/tags: 1.0.0.CR12 and 2 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Dec 10 09:12:28 EST 2008


Author: alex.loubyansky at jboss.com
Date: 2008-12-10 09:12:28 -0500 (Wed, 10 Dec 2008)
New Revision: 82191

Added:
   projects/metadata/tags/1.0.0.CR12/
   projects/metadata/tags/1.0.0.CR12/pom.xml
   projects/metadata/tags/1.0.0.CR12/src/test/java/org/jboss/test/metadata/xml/
   projects/metadata/tags/1.0.0.CR12/src/test/java/org/jboss/test/metadata/xml/XmlValidationUnitTestCase.java
Removed:
   projects/metadata/tags/1.0.0.CR12/pom.xml
   projects/metadata/tags/1.0.0.CR12/src/test/java/org/jboss/test/metadata/xml/XmlValidationUnitTestCase.java
Log:
[maven-release-plugin]  copy for tag 1.0.0.CR12

Copied: projects/metadata/tags/1.0.0.CR12 (from rev 82187, projects/metadata/trunk)

Deleted: projects/metadata/tags/1.0.0.CR12/pom.xml
===================================================================
--- projects/metadata/trunk/pom.xml	2008-12-10 11:58:21 UTC (rev 82187)
+++ projects/metadata/tags/1.0.0.CR12/pom.xml	2008-12-10 14:12:28 UTC (rev 82191)
@@ -1,179 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-  <modelVersion>4.0.0</modelVersion>
-  <parent>
-    <groupId>org.jboss</groupId>
-    <artifactId>jboss-parent</artifactId>
-    <version>4.0.CR1</version>
-  </parent>
-  <groupId>org.jboss.metadata</groupId>
-  <artifactId>jboss-metadata</artifactId>
-  <packaging>jar</packaging>
-  <version>1.0.0-SNAPSHOT</version>
-  <name>JBoss Metadata</name>
-  <url>http://www.jboss.org</url>
-  <description>The common JavaEE metadata classes</description>
-  <scm>
-    <connection>scm:svn:http://anonsvn.jboss.org/repos/jbossas/projects/metadata/trunk/</connection>
-    <developerConnection>scm:svn:https://svn.jboss.org/repos/jbossas/projects/metadata/trunk/</developerConnection>
-  </scm>
-
-  <build>
-    <outputDirectory>${profile.outputDirectory}</outputDirectory>
-    <testOutputDirectory>${profile.testOutputDirectory}</testOutputDirectory>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-surefire-plugin</artifactId>
-        <version>2.4.3</version>
-        <configuration>
-          <printSummary>true</printSummary>
-          <disableXmlReport>false</disableXmlReport>
-          <redirectTestOutputToFile>true</redirectTestOutputToFile>
-          <includes>
-            <include>**/*TestCase.java</include>
-          </includes>          
-        </configuration>
-      </plugin>      
-    </plugins>
-  </build>
-
-  <!-- 
-    Eclipse settings have been removed from parent. This needs to be
-    done via an eclipse profile.
-    http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4085896#4085896 
-    -->
-  <profiles>
-    <profile>
-      <id>default</id>
-      <activation>
-        <activeByDefault>true</activeByDefault>
-      </activation>
-      <properties>
-        <profile.outputDirectory>target/classes</profile.outputDirectory>
-        <profile.testOutputDirectory>target/tests-classes</profile.testOutputDirectory>
-      </properties>
-    </profile>
-    
-    <profile>
-      <id>eclipse</id>
-      <properties>
-        <profile.outputDirectory>eclipse-target/classes</profile.outputDirectory>
-        <profile.testOutputDirectory>eclipse-target/tests-classes</profile.testOutputDirectory>
-      </properties>
-    </profile>
-  </profiles>
-
-  <!-- Compile Dependencies -->
-  <dependencies>
-
-    <dependency>
-      <groupId>org.jboss.logging</groupId>
-      <artifactId>jboss-logging-spi</artifactId>
-      <version>2.0.5.GA</version>
-    </dependency>
-    
-    <dependency>
-      <groupId>org.jboss</groupId>
-      <artifactId>jboss-common-core</artifactId>
-      <version>2.2.8.GA</version>
-    </dependency>
-    
-    <dependency>
-      <groupId>org.jboss.ejb3</groupId>
-      <artifactId>jboss-ejb3-ext-api</artifactId>
-      <version>0.4</version>
-    </dependency>
-    
-    <dependency>
-      <groupId>org.jboss.javaee</groupId>
-      <artifactId>jboss-ejb-api</artifactId>
-      <version>3.0.0.GA</version>
-    </dependency>
-    
-    <dependency>
-      <groupId>org.jboss.javaee</groupId>
-      <artifactId>jboss-jms-api</artifactId>
-      <version>1.1.0.GA</version>
-    </dependency>
-
-    <dependency>
-      <groupId>org.hibernate</groupId>
-      <artifactId>ejb3-persistence</artifactId>
-      <version>1.0.2.GA</version>
-    </dependency>
-      
-    <dependency>
-      <groupId>org.jboss.javaee</groupId>
-      <artifactId>jboss-transaction-api</artifactId>
-      <version>1.0.1.GA</version>
-    </dependency>
-    
-    <dependency>
-      <groupId>org.jboss.ws</groupId>
-      <artifactId>jbossws-spi</artifactId>
-      <version>1.0.6.GA</version>
-    </dependency>
-    
-    <dependency>
-      <groupId>jboss.jbossws</groupId>
-      <artifactId>jboss-jaxws</artifactId>
-      <version>3.0.1-native-2.0.4.GA</version>
-    </dependency>
-
-    <dependency>
-      <groupId>org.jboss</groupId>
-      <artifactId>jbossxb</artifactId>
-      <version>2.0.0.GA</version>
-      <exclusions>
-        <exclusion>
-          <groupId>jboss</groupId>
-          <artifactId>jboss-common-logging-spi</artifactId>
-        </exclusion>
-        <exclusion>
-          <groupId>javax.xml.bind</groupId>
-          <artifactId>jaxb-api</artifactId>
-        </exclusion>          
-      </exclusions>       
-    </dependency>
-    
-    <dependency>
-      <groupId>org.jboss</groupId>
-      <artifactId>jboss-vfs</artifactId>
-      <version>2.0.0.CR1</version>    
-    </dependency>
-
-    <dependency>
-      <groupId>org.jboss</groupId>
-      <artifactId>jboss-mdr</artifactId>
-      <version>2.0.0.GA</version>
-    </dependency>
-
-    <dependency>
-      <groupId>sun-jaxb</groupId>
-      <artifactId>jaxb-api</artifactId>
-      <version>2.1.4</version>
-   </dependency>
-      
-    <dependency>
-      <groupId>apache-xerces</groupId>
-      <artifactId>xml-apis</artifactId>
-      <version>2.9.1</version>    
-    </dependency>
-    
-    <!-- Test Dependencies -->
-    <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-      <version>4.4</version>
-      <scope>test</scope>
-    </dependency>
-    
-    <dependency>
-      <groupId>org.jboss.test</groupId>
-      <artifactId>jboss-test</artifactId>
-      <version>1.1.2.GA</version>
-      <scope>test</scope>
-    </dependency>
-  </dependencies>
-
-</project>
\ No newline at end of file

Copied: projects/metadata/tags/1.0.0.CR12/pom.xml (from rev 82190, projects/metadata/trunk/pom.xml)
===================================================================
--- projects/metadata/tags/1.0.0.CR12/pom.xml	                        (rev 0)
+++ projects/metadata/tags/1.0.0.CR12/pom.xml	2008-12-10 14:12:28 UTC (rev 82191)
@@ -0,0 +1,179 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.jboss</groupId>
+    <artifactId>jboss-parent</artifactId>
+    <version>4.0.CR1</version>
+  </parent>
+  <groupId>org.jboss.metadata</groupId>
+  <artifactId>jboss-metadata</artifactId>
+  <packaging>jar</packaging>
+  <version>1.0.0.CR12</version>
+  <name>JBoss Metadata</name>
+  <url>http://www.jboss.org</url>
+  <description>The common JavaEE metadata classes</description>
+  <scm>
+    <connection>scm:svn:http://anonsvn.jboss.org/repos/jbossas/projects/metadata/tags/1.0.0.CR12</connection>
+    <developerConnection>scm:svn:https://svn.jboss.org/repos/jbossas/projects/metadata/tags/1.0.0.CR12</developerConnection>
+  </scm>
+
+  <build>
+    <outputDirectory>${profile.outputDirectory}</outputDirectory>
+    <testOutputDirectory>${profile.testOutputDirectory}</testOutputDirectory>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-surefire-plugin</artifactId>
+        <version>2.4.3</version>
+        <configuration>
+          <printSummary>true</printSummary>
+          <disableXmlReport>false</disableXmlReport>
+          <redirectTestOutputToFile>true</redirectTestOutputToFile>
+          <includes>
+            <include>**/*TestCase.java</include>
+          </includes>          
+        </configuration>
+      </plugin>      
+    </plugins>
+  </build>
+
+  <!-- 
+    Eclipse settings have been removed from parent. This needs to be
+    done via an eclipse profile.
+    http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4085896#4085896 
+    -->
+  <profiles>
+    <profile>
+      <id>default</id>
+      <activation>
+        <activeByDefault>true</activeByDefault>
+      </activation>
+      <properties>
+        <profile.outputDirectory>target/classes</profile.outputDirectory>
+        <profile.testOutputDirectory>target/tests-classes</profile.testOutputDirectory>
+      </properties>
+    </profile>
+    
+    <profile>
+      <id>eclipse</id>
+      <properties>
+        <profile.outputDirectory>eclipse-target/classes</profile.outputDirectory>
+        <profile.testOutputDirectory>eclipse-target/tests-classes</profile.testOutputDirectory>
+      </properties>
+    </profile>
+  </profiles>
+
+  <!-- Compile Dependencies -->
+  <dependencies>
+
+    <dependency>
+      <groupId>org.jboss.logging</groupId>
+      <artifactId>jboss-logging-spi</artifactId>
+      <version>2.0.5.GA</version>
+    </dependency>
+    
+    <dependency>
+      <groupId>org.jboss</groupId>
+      <artifactId>jboss-common-core</artifactId>
+      <version>2.2.8.GA</version>
+    </dependency>
+    
+    <dependency>
+      <groupId>org.jboss.ejb3</groupId>
+      <artifactId>jboss-ejb3-ext-api</artifactId>
+      <version>0.4</version>
+    </dependency>
+    
+    <dependency>
+      <groupId>org.jboss.javaee</groupId>
+      <artifactId>jboss-ejb-api</artifactId>
+      <version>3.0.0.GA</version>
+    </dependency>
+    
+    <dependency>
+      <groupId>org.jboss.javaee</groupId>
+      <artifactId>jboss-jms-api</artifactId>
+      <version>1.1.0.GA</version>
+    </dependency>
+
+    <dependency>
+      <groupId>org.hibernate</groupId>
+      <artifactId>ejb3-persistence</artifactId>
+      <version>1.0.2.GA</version>
+    </dependency>
+      
+    <dependency>
+      <groupId>org.jboss.javaee</groupId>
+      <artifactId>jboss-transaction-api</artifactId>
+      <version>1.0.1.GA</version>
+    </dependency>
+    
+    <dependency>
+      <groupId>org.jboss.ws</groupId>
+      <artifactId>jbossws-spi</artifactId>
+      <version>1.0.6.GA</version>
+    </dependency>
+    
+    <dependency>
+      <groupId>jboss.jbossws</groupId>
+      <artifactId>jboss-jaxws</artifactId>
+      <version>3.0.1-native-2.0.4.GA</version>
+    </dependency>
+
+    <dependency>
+      <groupId>org.jboss</groupId>
+      <artifactId>jbossxb</artifactId>
+      <version>2.0.0.GA</version>
+      <exclusions>
+        <exclusion>
+          <groupId>jboss</groupId>
+          <artifactId>jboss-common-logging-spi</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>javax.xml.bind</groupId>
+          <artifactId>jaxb-api</artifactId>
+        </exclusion>          
+      </exclusions>       
+    </dependency>
+    
+    <dependency>
+      <groupId>org.jboss</groupId>
+      <artifactId>jboss-vfs</artifactId>
+      <version>2.0.0.CR1</version>    
+    </dependency>
+
+    <dependency>
+      <groupId>org.jboss</groupId>
+      <artifactId>jboss-mdr</artifactId>
+      <version>2.0.0.GA</version>
+    </dependency>
+
+    <dependency>
+      <groupId>sun-jaxb</groupId>
+      <artifactId>jaxb-api</artifactId>
+      <version>2.1.4</version>
+   </dependency>
+      
+    <dependency>
+      <groupId>apache-xerces</groupId>
+      <artifactId>xml-apis</artifactId>
+      <version>2.9.1</version>    
+    </dependency>
+    
+    <!-- Test Dependencies -->
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>4.4</version>
+      <scope>test</scope>
+    </dependency>
+    
+    <dependency>
+      <groupId>org.jboss.test</groupId>
+      <artifactId>jboss-test</artifactId>
+      <version>1.1.2.GA</version>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+
+</project>
\ No newline at end of file

Copied: projects/metadata/tags/1.0.0.CR12/src/test/java/org/jboss/test/metadata/xml (from rev 82188, projects/metadata/trunk/src/test/java/org/jboss/test/metadata/xml)

Deleted: projects/metadata/tags/1.0.0.CR12/src/test/java/org/jboss/test/metadata/xml/XmlValidationUnitTestCase.java
===================================================================
--- projects/metadata/trunk/src/test/java/org/jboss/test/metadata/xml/XmlValidationUnitTestCase.java	2008-12-10 14:02:02 UTC (rev 82188)
+++ projects/metadata/tags/1.0.0.CR12/src/test/java/org/jboss/test/metadata/xml/XmlValidationUnitTestCase.java	2008-12-10 14:12:28 UTC (rev 82191)
@@ -1,190 +0,0 @@
-/*
-  * JBoss, Home of Professional Open Source
-  * Copyright 2005, JBoss Inc., and individual contributors as indicated
-  * by the @authors tag. See the copyright.txt in the distribution for a
-  * full listing of individual contributors.
-  *
-  * This is free software; you can redistribute it and/or modify it
-  * under the terms of the GNU Lesser General Public License as
-  * published by the Free Software Foundation; either version 2.1 of
-  * the License, or (at your option) any later version.
-  *
-  * This software is distributed in the hope that it will be useful,
-  * but WITHOUT ANY WARRANTY; without even the implied warranty of
-  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-  * Lesser General Public License for more details.
-  *
-  * You should have received a copy of the GNU Lesser General Public
-  * License along with this software; if not, write to the Free
-  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-  */
-package org.jboss.test.metadata.xml;
-
-import java.io.File;
-import java.io.FileFilter;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
-
-import org.jboss.util.xml.JBossEntityResolver;
-import org.xml.sax.EntityResolver;
-import org.xml.sax.ErrorHandler;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-import org.xml.sax.XMLReader;
-import org.xml.sax.helpers.DefaultHandler;
-
-import junit.framework.TestCase;
-
-/**
- * A XmlValidationUnitTestCase.
- * 
- * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
- * @version $Revision: 1.1 $
- */
-public class XmlValidationUnitTestCase extends TestCase
-{
-   private static final SAXParserFactory FACTORY;
-   private static final Set<String> IGNORE = new HashSet<String>();
-   
-   static
-   {
-      FACTORY = SAXParserFactory.newInstance();
-      FACTORY.setNamespaceAware(true);
-      FACTORY.setValidating(true);
-      
-      IGNORE.add("log4j.xml");
-   }
-   
-   private static final EntityResolver RESOLVER = new JBossEntityResolver();
-   
-   private int total;
-   private int invalid;
-   
-   public void testValidation() throws Exception
-   {
-      String resourcesPath = System.getProperty("user.dir") + File.separatorChar + "src" + File.separatorChar + "test" + File.separatorChar + "resources";
-      File resourcesDir = new File(resourcesPath);
-      
-      final Set<String> names = new HashSet<String>();
-      
-      resourcesDir.listFiles(new FileFilter()
-      {
-         public boolean accept(File pathname)
-         {
-            if(".svn".equals(pathname.getName()))
-               return false;
-
-            if(pathname.isDirectory())
-               pathname.listFiles(this);
-            
-            if(pathname.getName().endsWith(".xml") && !IGNORE.contains(pathname.getName()))
-            {
-               names.add(pathname.getName());
-               try
-               {
-                  validate(pathname);
-               }
-               catch(SAXException e)
-               {
-                  ++invalid;
-               }
-               ++total;
-            }
-
-            return false;
-         }
-      });
-   
-      assertEquals("Zero invalid files among total of " + total, 0, invalid);
-   }
-   
-   private static boolean validate(File xmlFile) throws SAXException
-   {
-      SAXParser parser;      
-      try
-      {
-         parser = FACTORY.newSAXParser();
-      }
-      catch (Exception e)
-      {
-         throw new IllegalStateException("Failed to instantiate a SAX parser: " + e.getMessage());
-      }
-
-      try
-      {
-         parser.getXMLReader().setFeature("http://apache.org/xml/features/validation/schema", true);
-      }
-      catch (SAXException e)
-      {
-         throw new IllegalStateException("Schema validation feature is not supported by the parser: " + e.getMessage());
-      }
-
-      
-      InputStream is;
-      try
-      {
-         is = xmlFile.toURL().openStream();
-      }
-      catch (Exception e)
-      {
-         throw new IllegalStateException("Failed to open file: " + xmlFile.getAbsolutePath(), e);
-      }
-
-      try
-      {
-         parser.parse(is, new DefaultHandler()
-         {
-            public void warning(SAXParseException e)
-            {
-            }
-
-            public void error(SAXParseException e) throws SAXException
-            {
-               throw e;
-            }
-
-            public void fatalError(SAXParseException e) throws SAXException
-            {
-               throw e;
-            }
-
-            public InputSource resolveEntity(String publicId, String systemId) throws SAXException
-            {
-               InputSource is = null;
-               if (RESOLVER != null)
-               {
-                  try
-                  {
-                     is = RESOLVER.resolveEntity(publicId, systemId);
-                  }
-                  catch (Exception e)
-                  {
-                     throw new IllegalStateException("Failed to resolveEntity " + systemId + ": " + systemId);
-                  }
-               }
-
-               if (is == null)
-               {
-                  throw new SAXException("Failed to resolve entity: publicId=" + publicId + " systemId=" + systemId);
-               }
-
-               return is;
-            }
-         });
-      }
-      catch (IOException e)
-      {
-         throw new IllegalStateException("Failed to read file: " + xmlFile.getAbsolutePath(), e);
-      }
-
-      return true;
-   }
-}

Copied: projects/metadata/tags/1.0.0.CR12/src/test/java/org/jboss/test/metadata/xml/XmlValidationUnitTestCase.java (from rev 82189, projects/metadata/trunk/src/test/java/org/jboss/test/metadata/xml/XmlValidationUnitTestCase.java)
===================================================================
--- projects/metadata/tags/1.0.0.CR12/src/test/java/org/jboss/test/metadata/xml/XmlValidationUnitTestCase.java	                        (rev 0)
+++ projects/metadata/tags/1.0.0.CR12/src/test/java/org/jboss/test/metadata/xml/XmlValidationUnitTestCase.java	2008-12-10 14:12:28 UTC (rev 82191)
@@ -0,0 +1,191 @@
+/*
+  * JBoss, Home of Professional Open Source
+  * Copyright 2005, JBoss Inc., and individual contributors as indicated
+  * by the @authors tag. See the copyright.txt in the distribution for a
+  * full listing of individual contributors.
+  *
+  * This is free software; you can redistribute it and/or modify it
+  * under the terms of the GNU Lesser General Public License as
+  * published by the Free Software Foundation; either version 2.1 of
+  * the License, or (at your option) any later version.
+  *
+  * This software is distributed in the hope that it will be useful,
+  * but WITHOUT ANY WARRANTY; without even the implied warranty of
+  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+  * Lesser General Public License for more details.
+  *
+  * You should have received a copy of the GNU Lesser General Public
+  * License along with this software; if not, write to the Free
+  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+  */
+package org.jboss.test.metadata.xml;
+
+import java.io.File;
+import java.io.FileFilter;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Set;
+
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+
+import org.jboss.util.xml.JBossEntityResolver;
+import org.xml.sax.EntityResolver;
+import org.xml.sax.ErrorHandler;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
+import org.xml.sax.XMLReader;
+import org.xml.sax.helpers.DefaultHandler;
+
+import junit.framework.TestCase;
+
+/**
+ * A XmlValidationUnitTestCase.
+ * 
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+public class XmlValidationUnitTestCase extends TestCase
+{
+   private static final SAXParserFactory FACTORY;
+   private static final Set<String> IGNORE = new HashSet<String>();
+   
+   static
+   {
+      FACTORY = SAXParserFactory.newInstance();
+      FACTORY.setNamespaceAware(true);
+      FACTORY.setValidating(true);
+      
+      IGNORE.add("log4j.xml");
+   }
+   
+   private static final EntityResolver RESOLVER = new JBossEntityResolver();
+   
+   private int total;
+   private int invalid;
+   
+   public void testValidation() throws Exception
+   {
+      String resourcesPath = System.getProperty("user.dir") + File.separatorChar + "src" + File.separatorChar + "test" + File.separatorChar + "resources";
+      File resourcesDir = new File(resourcesPath);
+      
+      final Set<String> names = new HashSet<String>();
+      
+      resourcesDir.listFiles(new FileFilter()
+      {
+         public boolean accept(File pathname)
+         {
+            if(".svn".equals(pathname.getName()))
+               return false;
+
+            if(pathname.isDirectory())
+               pathname.listFiles(this);
+            
+            if(pathname.getName().endsWith(".xml") && !IGNORE.contains(pathname.getName()))
+            {
+               names.add(pathname.getName());
+               try
+               {
+                  validate(pathname);
+               }
+               catch(SAXException e)
+               {
+                  ++invalid;
+               }
+               ++total;
+            }
+
+            return false;
+         }
+      });
+   
+      // TODO there are currently 30 expected
+      assertEquals("Zero invalid files among total of " + total, 30, invalid);
+   }
+   
+   private static boolean validate(File xmlFile) throws SAXException
+   {
+      SAXParser parser;      
+      try
+      {
+         parser = FACTORY.newSAXParser();
+      }
+      catch (Exception e)
+      {
+         throw new IllegalStateException("Failed to instantiate a SAX parser: " + e.getMessage());
+      }
+
+      try
+      {
+         parser.getXMLReader().setFeature("http://apache.org/xml/features/validation/schema", true);
+      }
+      catch (SAXException e)
+      {
+         throw new IllegalStateException("Schema validation feature is not supported by the parser: " + e.getMessage());
+      }
+
+      
+      InputStream is;
+      try
+      {
+         is = xmlFile.toURL().openStream();
+      }
+      catch (Exception e)
+      {
+         throw new IllegalStateException("Failed to open file: " + xmlFile.getAbsolutePath(), e);
+      }
+
+      try
+      {
+         parser.parse(is, new DefaultHandler()
+         {
+            public void warning(SAXParseException e)
+            {
+            }
+
+            public void error(SAXParseException e) throws SAXException
+            {
+               throw e;
+            }
+
+            public void fatalError(SAXParseException e) throws SAXException
+            {
+               throw e;
+            }
+
+            public InputSource resolveEntity(String publicId, String systemId) throws SAXException
+            {
+               InputSource is = null;
+               if (RESOLVER != null)
+               {
+                  try
+                  {
+                     is = RESOLVER.resolveEntity(publicId, systemId);
+                  }
+                  catch (Exception e)
+                  {
+                     throw new IllegalStateException("Failed to resolveEntity " + systemId + ": " + systemId);
+                  }
+               }
+
+               if (is == null)
+               {
+                  throw new SAXException("Failed to resolve entity: publicId=" + publicId + " systemId=" + systemId);
+               }
+
+               return is;
+            }
+         });
+      }
+      catch (IOException e)
+      {
+         throw new IllegalStateException("Failed to read file: " + xmlFile.getAbsolutePath(), e);
+      }
+
+      return true;
+   }
+}




More information about the jboss-cvs-commits mailing list