mirror of https://github.com/apache/activemq.git
Make sure we test the examples/conf broker xml files.
This commit is contained in:
parent
3345e6ca25
commit
c643e7f631
|
@ -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>
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue