1818import java .net .URL ;
1919import java .util .Collection ;
2020import java .util .Iterator ;
21+ import java .util .Locale ;
2122
2223import org .eclipse .rdf4j .model .IRI ;
2324import org .eclipse .rdf4j .model .Statement ;
3132import org .eclipse .rdf4j .rio .helpers .StatementCollector ;
3233import org .hamcrest .CoreMatchers ;
3334import org .hamcrest .Matchers ;
35+ import org .junit .After ;
3436import org .junit .Before ;
3537import org .junit .Test ;
3638
@@ -44,10 +46,15 @@ public class RDFXMLParserTest {
4446
4547 private ParseErrorCollector el ;
4648
49+ private Locale platformLocale ;
50+
4751 @ Before
4852 public void setUp ()
4953 throws Exception
5054 {
55+ platformLocale = Locale .getDefault ();
56+
57+ Locale .setDefault (Locale .ENGLISH );
5158 vf = SimpleValueFactory .getInstance ();
5259 parser = new RDFXMLParser ();
5360 sc = new StatementCollector ();
@@ -56,6 +63,13 @@ public void setUp()
5663 parser .setParseErrorListener (el );
5764 }
5865
66+ @ After
67+ public void tearDown ()
68+ throws Exception
69+ {
70+ Locale .setDefault (platformLocale );
71+ }
72+
5973 @ Test
6074 public void rdfXmlLoadedFromInsideAJarResolvesRelativeUris ()
6175 throws Exception
@@ -121,7 +135,8 @@ public void testRDFXMLWhitespace()
121135 public void testFatalErrorPrologContent ()
122136 throws Exception
123137 {
124- // Temporarily override System.err to verify that nothing is being printed to it for this test
138+ // Temporarily override System.err to verify that nothing is being
139+ // printed to it for this test
125140 PrintStream oldErr = System .err ;
126141 ByteArrayOutputStream tempErr = new ByteArrayOutputStream ();
127142 System .setErr (new PrintStream (tempErr ));
@@ -134,13 +149,14 @@ public void testFatalErrorPrologContent()
134149 parser .parse (in , "" );
135150 }
136151 catch (RDFParseException e ) {
137- // FIXME exact error message is locale-dependent. Just fall through, error is expected. See #280.
138- // assertEquals("Content is not allowed in prolog. [line 1, column 1]", e.getMessage());
152+ assertEquals ("Content is not allowed in prolog. [line 1, column 1]" , e .getMessage ());
139153 }
140154 finally {
141- // Reset System Error output to ensure that we don't interfere with other tests
155+ // Reset System Error output to ensure that we don't interfere with
156+ // other tests
142157 System .setErr (oldErr );
143- // Reset System Out output to ensure that we don't interfere with other tests
158+ // Reset System Out output to ensure that we don't interfere with
159+ // other tests
144160 System .setOut (oldOut );
145161 }
146162 // Verify nothing was printed to System.err during test
0 commit comments