<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/3.18.3">
</HEAD>
<BODY>
Please don't hardcode paths in tests.<BR>
Remember that tests may be shuffled around.<BR>
I'll introduce a new system properties, pointing to the testsuite dir, evt. to project's root dir.<BR>
<BR>
Also please remember that the testsuite will run agains productized build -<BR>
perhaps the following tests could use XSD's from src/main/resources instead?<BR>
(QA will run against provided EAP, let's not force them to run whole build.)<BR>
<BR>
Thanks,<BR>
Ondra<BR>
<BR>
<BR>
<BR>
public class AbstractValidationUnitTest {<BR>
private static final Map<String, File> JBOSS_SCHEMAS = new HashMap<String, File>();<BR>
private static Map<String, String> NAMESPACE_MAP = new HashMap<String, String>();<BR>
static final File MOD_DIR = new File(System.getProperty("user.dir"));<BR>
static final File TARGET_DIR = new File(MOD_DIR, "../../build/target/");<BR>
private static File BASE_DIR = null;<BR>
<BR>
static {<BR>
NAMESPACE_MAP.put("http://java.sun.com/xml/ns/javaee/javaee_6.xsd", "schema/javaee_6.xsd");<BR>
NAMESPACE_MAP.put("http://www.w3.org/2001/xml.xsd", "schema/xml.xsd");<BR>
final File[] children = TARGET_DIR.listFiles();<BR>
if (children != null) {<BR>
for (File child : children) {<BR>
if (child.getName().startsWith("jboss-")) {<BR>
BASE_DIR = child;<BR>
break;<BR>
}<BR>
}<BR>
if (BASE_DIR != null) {<BR>
final File schemaDir = new File(BASE_DIR, "docs/schema");<BR>
final File[] xsds = schemaDir.listFiles(SchemaFilter.FILTER);<BR>
for (File xsd : xsds) {<BR>
JBOSS_SCHEMAS.put(xsd.getName(), xsd);<BR>
}<BR>
}<BR>
}<BR>
}<BR>
<BR>
</BODY>
</HTML>