Make sure we test the examples/conf broker xml files.

This commit is contained in:
Hiram Chirino 2013-10-10 12:19:06 -04:00
parent 3345e6ca25
commit c643e7f631
2 changed files with 10 additions and 4 deletions

View File

@ -551,7 +551,7 @@
<directory>src/release/conf</directory>
</resource>
<resource>
<directory>src/sample-conf</directory>
<directory>src/release/examples/conf</directory>
</resource>
</resources>
</configuration>

View File

@ -22,6 +22,7 @@ import java.io.File;
import java.io.FileFilter;
import java.io.IOException;
import java.io.InputStream;
import java.util.HashSet;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
@ -32,6 +33,7 @@ import org.xml.sax.ErrorHandler;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import org.xml.sax.SAXParseException;
import scala.actors.threadpool.Arrays;
public class ValidateXMLConfigTest {
@ -48,12 +50,16 @@ public class ValidateXMLConfigTest {
public void validateExampleConfig() throws Exception {
// resource:copy-resource brings all config files into target/conf
File sampleConfDir = new File("target/conf");
final HashSet<String> skipped = new HashSet<String>(Arrays.asList(new String[]{
"resin-web.xml", "web.xml"
}));
for (File xmlFile : sampleConfDir.listFiles(new FileFilter() {
public boolean accept(File pathname) {
return pathname.isFile() && pathname.getName().endsWith("xml");
return pathname.isFile() && pathname.getName().endsWith("xml") && !skipped.contains(pathname.getName());
}})) {
validateXML(xmlFile);
}
}