afs commented on code in PR #2401:
URL: https://github.com/apache/jena/pull/2401#discussion_r1556135442
##########
jena-arq/src/test/java/org/apache/jena/riot/TestRDFParser.java:
##########
@@ -51,44 +54,64 @@ public class TestRDFParser {
private static String DIR = "testing/RIOT/Parser/";
private static String testdata = "@prefix : <http://example/ns#> . :x :x
_:b .";
- @Test public void source_not_uri_01() {
+ private static String testLarge;
Review Comment:
This doesn't test a transaction is used.
##########
jena-arq/src/test/java/org/apache/jena/riot/TestRDFParser.java:
##########
@@ -51,44 +54,64 @@ public class TestRDFParser {
private static String DIR = "testing/RIOT/Parser/";
private static String testdata = "@prefix : <http://example/ns#> . :x :x
_:b .";
- @Test public void source_not_uri_01() {
+ private static String testLarge;
+
+ private static long LARGE_SIZE = 100_000;
+
+ static {
+ DatasetGraph g = DatasetGraphFactory.create();
Review Comment:
```suggestion
DatasetGraph dsg = DatasetGraphFactory.create();
```
etc. `g` is "graph" in many places.
##########
jena-arq/src/test/java/org/apache/jena/riot/TestRDFParser.java:
##########
@@ -51,44 +54,64 @@ public class TestRDFParser {
private static String DIR = "testing/RIOT/Parser/";
private static String testdata = "@prefix : <http://example/ns#> . :x :x
_:b .";
- @Test public void source_not_uri_01() {
+ private static String testLarge;
+
+ private static long LARGE_SIZE = 100_000;
+
+ static {
Review Comment:
Use `@BeforeAll`/`@BeforeClass` here?
##########
jena-arq/src/test/java/org/apache/jena/riot/TestRDFParser.java:
##########
@@ -265,11 +296,34 @@ public void parser_fragment() {
private void testNormalization(String input, String output,
RDFParserBuilder builder) {
Graph graph = GraphFactory.createGraphMem();
- String x = PREFIX+":s :p "+input;
+ String x = PREFIX + ":s :p " + input;
builder.source(new StringReader(x)).parse(graph);
assertEquals(1, graph.size());
Node objExpected = SSE.parseNode(output);
Node objObtained = graph.find(s, p, null).next().getObject();
assertEquals(objExpected, objObtained);
}
+
+ @Test
Review Comment:
A better test would be to parse illegal data, then test that the parse error
aborts the transaction and the dataset is empty.
##########
jena-arq/src/main/java/org/apache/jena/riot/RDFParser.java:
##########
@@ -55,6 +55,7 @@
import org.apache.jena.sparql.core.DatasetGraphFactory;
import org.apache.jena.sparql.graph.GraphFactory;
import org.apache.jena.sparql.util.Context;
+import org.apache.jena.system.Txn;
Review Comment:
Unused import.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]