Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


Fix tests on windows #28

wants to merge 2 commits into from

3 participants

Alexey Makhmutov Tomaz Cerar Jean-Frederic Clere
Alexey Makhmutov

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.

Jean-Frederic Clere

substring(5) Why?

Tomaz Cerar

this is fixed as part of #41

Tomaz Cerar

this PR can be closed

Jean-Frederic Clere 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 authored
  2. Support for non-ASCII symbols in test schema path

    Alexey Makhmutov authored
This page is out of date. Refresh to see the latest.
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.