Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Fix tests on windows #28

Closed
wants to merge 2 commits into from

3 participants

@Lerm

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.

@jfclere
Collaborator

substring(5) Why?

@ctomc

this is fixed as part of #41

@ctomc

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 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.
View
5 ejb/src/test/java/org/jboss/metadata/ejb/test/common/ValidationHelper.java
@@ -27,6 +27,7 @@
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
+import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.util.HashMap;
@@ -64,8 +65,8 @@ public static Document parse(final InputSource is, final Class loader) throws Pa
system.put("http://www.jboss.org/j2ee/schema/trans-timeout-1_0.xsd", "/schema/trans-timeout-1_0.xsd");
// Somehow this gives a broken URI, see http://en.wikipedia.org/wiki/File_URI_scheme
// 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()
{
@Override
Something went wrong with that request. Please try again.