Skip to content

Commit d90f86f

Browse files
committed
GH-2997: Move ARP's internal NTriples reader to tests, and rename
1 parent b8c9b6c commit d90f86f

File tree

8 files changed

+19
-20
lines changed

8 files changed

+19
-20
lines changed

jena-core/src/test/java/org/apache/jena/rdfxml/xmlinput0/ARPTests2.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -545,6 +545,7 @@ public void warning(SAXParseException exception) throws SAXException {
545545
// checkExpected() ;
546546
// }
547547

548+
@SuppressWarnings("removal")
548549
public void testNTripleEscaping() {
549550
String data[][] = {
550551
{ "foo", "foo" },
@@ -555,7 +556,7 @@ public void testNTripleEscaping() {
555556
};
556557
for (String p[] : data ) {
557558
// System.err.println(NTriple.escapeNTriple(p[0]));
558-
Assert.assertEquals("NTriple escaping", p[1],NTriple.escapeNTriple(p[0]) );
559+
Assert.assertEquals("NTriple escaping", p[1],NTripleARP0.escapeNTriple(p[0]) );
559560
}
560561

561562

jena-core/src/main/java/org/apache/jena/rdfxml/xmlinput0/NTriple.java jena-core/src/test/java/org/apache/jena/rdfxml/xmlinput0/NTripleARP0.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@
8585
* </dl>
8686
* @deprecated Legacy. To be removed.
8787
*/
88-
@Deprecated
89-
public class NTriple implements ARPErrorNumbers {
88+
@Deprecated(forRemoval = true)
89+
public class NTripleARP0 implements ARPErrorNumbers {
9090

9191
private static StringBuilder line = new StringBuilder();
9292
private static ARP0 arp;
@@ -198,7 +198,7 @@ static private void lineNumber() {
198198
static void usage() {
199199
System.err.println(
200200
"java <class-path> "
201-
+ NTriple.class.getName()
201+
+ NTripleARP0.class.getName()
202202
+ " ( [ -[xstfurR]][ -b xmlBase -[eiw] NNN[,NNN...] ] [ file ] [ url ] )... ");
203203
System.err.println(
204204
" All options, files and URLs can be intemingled in any order.");

jena-core/src/test/java/org/apache/jena/rdfxml/xmlinput0/NTripleTestSuite.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ Model loadRDF(InFactoryX in, RDFErrorHandler eh, String base)
242242
return loadRDFx(in, eh, base, true, 0);
243243
}
244244

245-
@SuppressWarnings("deprecation")
245+
@SuppressWarnings("removal")
246246
static Model loadRDFx(
247247
InFactoryX in,
248248
RDFErrorHandler eh,
@@ -274,7 +274,7 @@ public void write(int b) throws IOException {
274274
System.setIn(in.open());
275275
System.setOut(out);
276276
try {
277-
NTriple.mainEh(new String[] { "-b", base, "-s" }, th, th);
277+
NTripleARP0.mainEh(new String[] { "-b", base, "-s" }, th, th);
278278
} catch (SimulatedException e) {
279279
if (wantModel)
280280
throw e;

jena-core/src/test/java/org/apache/jena/rdfxml/xmlinput0/TaintingTests.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ public void setUp() {
178178
}
179179

180180
@Override
181-
@SuppressWarnings("deprecation")
181+
@SuppressWarnings("removal")
182182
public void runTest() throws IOException {
183183
ByteArrayOutputStream goodBytes = new ByteArrayOutputStream();
184184
ByteArrayOutputStream badBytes = new ByteArrayOutputStream();
@@ -187,7 +187,7 @@ public void runTest() throws IOException {
187187
try (PrintStream out = new PrintStream(goodBytes); PrintStream err = new PrintStream(badBytes); ) {
188188
System.setOut(out);
189189
System.setErr(err);
190-
NTriple.mainEh(new String[]{"-e","102,136,105,103,108,107,116,106,004,131",
190+
NTripleARP0.mainEh(new String[]{"-e","102,136,105,103,108,107,116,106,004,131",
191191
"-E","-b",base,fileName},this,null);
192192
}
193193
finally {

jena-core/src/main/java/org/apache/jena/rdfxml/xmlinput1/NTriple.java jena-core/src/test/java/org/apache/jena/rdfxml/xmlinput1/NTripleARP1.java

+4-9
Original file line numberDiff line numberDiff line change
@@ -83,20 +83,15 @@
8383
* </dt><dd>
8484
* Ignores numbered error/warning conditions.
8585
* </dl>
86+
* @deprecated Internaluse only To be removed.
8687
*/
87-
@SuppressWarnings("deprecation")
88-
public class NTriple implements ARPErrorNumbers {
88+
@Deprecated(forRemoval = true)
89+
public class NTripleARP1 implements ARPErrorNumbers {
8990

9091
private static StringBuilder line = new StringBuilder();
9192
private static ARP arp;
9293
private static String xmlBase = null;
9394
private static boolean numbers = false;
94-
/** Starts an RDF/XML to NTriple converter.
95-
* @param args The command-line arguments.
96-
*/
97-
static public void main(String args[]) {
98-
mainEh(args, null, null);
99-
}
10095
static StatementHandler andMeToo = null;
10196
/** Starts an RDF/XML to NTriple converter,
10297
* using an error handler, and an ARPHandler.
@@ -197,7 +192,7 @@ static private void lineNumber() {
197192
static void usage() {
198193
System.err.println(
199194
"java <class-path> "
200-
+ NTriple.class.getName()
195+
+ NTripleARP1.class.getName()
201196
+ " ( [ -[xstfurR]][ -b xmlBase -[eiw] NNN[,NNN...] ] [ file ] [ url ] )... ");
202197
System.err.println(
203198
" All options, files and URLs can be intemingled in any order.");

jena-core/src/test/java/org/apache/jena/rdfxml/xmlinput1/NTripleTestSuite.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@ Model loadRDF(InputSupplier in, RDFErrorHandler eh, String base)
226226
return loadRDFx(in, eh, base, true, 0);
227227
}
228228

229+
@SuppressWarnings("removal")
229230
static Model loadRDFx(
230231
InputSupplier in,
231232
RDFErrorHandler eh,
@@ -257,7 +258,7 @@ public void write(int b) throws IOException {
257258
System.setIn(in.open());
258259
System.setOut(out);
259260
try {
260-
NTriple.mainEh(new String[] { "-b", base, "-s" }, th, th);
261+
NTripleARP1.mainEh(new String[] { "-b", base, "-s" }, th, th);
261262
} catch (SimulatedException e) {
262263
if (wantModel)
263264
throw e;

jena-core/src/test/java/org/apache/jena/rdfxml/xmlinput1/TestsARP.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -495,6 +495,7 @@ public void testIRIRules_2a()
495495
// checkExpected() ;
496496
// }
497497

498+
@SuppressWarnings("removal")
498499
public void testNTripleEscaping() {
499500
String data[][] = {
500501
{ "foo", "foo" },
@@ -505,7 +506,7 @@ public void testNTripleEscaping() {
505506
};
506507
for (String p[] : data ) {
507508
// System.err.println(NTriple.escapeNTriple(p[0]));
508-
Assert.assertEquals("NTriple escaping", p[1],NTriple.escapeNTriple(p[0]) );
509+
Assert.assertEquals("NTriple escaping", p[1],NTripleARP1.escapeNTriple(p[0]) );
509510
}
510511

511512

jena-core/src/test/java/org/apache/jena/rdfxml/xmlinput1/TestsTainting.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ public void setUp() {
183183
OntDocumentManager.getInstance().reset(true);
184184
}
185185

186+
@SuppressWarnings("removal")
186187
@Override
187188
public void runTest() throws IOException {
188189
ByteArrayOutputStream goodBytes = new ByteArrayOutputStream();
@@ -192,7 +193,7 @@ public void runTest() throws IOException {
192193
try (PrintStream out = new PrintStream(goodBytes); PrintStream err = new PrintStream(badBytes); ) {
193194
System.setOut(out);
194195
System.setErr(err);
195-
NTriple.mainEh(new String[]{"-e","102,136,105,103,108,107,116,106,004,131",
196+
NTripleARP1.mainEh(new String[]{"-e","102,136,105,103,108,107,116,106,004,131",
196197
"-E","-b",base,fileName},this,null);
197198
}
198199
finally {

0 commit comments

Comments
 (0)