Skip to content


Fix tests on windows #28

wants to merge 2 commits into from

3 participants


Attempt to build 'metadata' on Windows platform fails while running 'org.jboss.metadata.ejb.test.extension.ExtensionTestCase'. The root cause of the problem is using of System.getProperty("user.dir") statement to construct part of URL for test schema file - on Windows this results in incorrect URL due to different path separators. Another problem occurs if non-ASCII characters are present in the patch - they need to be properly encoded.

jboss member

substring(5) Why?


this is fixed as part of #41


this PR can be closed

@jfclere jfclere closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 22, 2011
  1. Construct proper URL for test schema location on Windows

    Alexey Makhmutov committed
  2. Support for non-ASCII symbols in test schema path

    Alexey Makhmutov committed
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 2 deletions.
  1. +3 −2 ejb/src/test/java/org/jboss/metadata/ejb/test/common/
5 ejb/src/test/java/org/jboss/metadata/ejb/test/common/
@@ -27,6 +27,7 @@
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import java.util.HashMap;
@@ -64,8 +65,8 @@ public static Document parse(final InputSource is, final Class loader) throws Pa
system.put("", "/schema/trans-timeout-1_0.xsd");
// Somehow this gives a broken URI, see
// system.put(new URL(new File(".").toURI().toURL(), "cache-test.xsd").toString(), "cache-test.xsd");
- system.put("file://" + System.getProperty("user.dir") + "/cache-test.xsd", "cache-test.xsd");
- system.put("file://" + System.getProperty("user.dir") + "/tx-test.xsd", "tx-test.xsd");
+ system.put("file://" + new File(System.getProperty("user.dir"), "cache-test.xsd").toURI().toASCIIString().substring(5), "cache-test.xsd");
+ system.put("file://" + new File(System.getProperty("user.dir"), "tx-test.xsd").toURI().toASCIIString().substring(5), "tx-test.xsd");
parser.setEntityResolver(new EntityResolver()
Something went wrong with that request. Please try again.