jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject [3/8] jena git commit: Layout change -- spaces to tabs, to reduce PR diffsize.
Date Tue, 17 Mar 2015 15:56:02 GMT
Layout change -- spaces to tabs, to reduce PR diffsize.


Project: http://git-wip-us.apache.org/repos/asf/jena/repo
Commit: http://git-wip-us.apache.org/repos/asf/jena/commit/6a017a98
Tree: http://git-wip-us.apache.org/repos/asf/jena/tree/6a017a98
Diff: http://git-wip-us.apache.org/repos/asf/jena/diff/6a017a98

Branch: refs/heads/master
Commit: 6a017a982a5d408c55a64839a3d0ed84a49ded63
Parents: f07c4c3
Author: Chris Dollin <ehog.hedge@googlemail.com>
Authored: Tue Mar 17 13:41:39 2015 +0000
Committer: Chris Dollin <ehog.hedge@googlemail.com>
Committed: Tue Mar 17 13:41:39 2015 +0000

----------------------------------------------------------------------
 .../assembler/TestTextDatasetAssembler.java     | 238 +++++++++----------
 1 file changed, 119 insertions(+), 119 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/jena/blob/6a017a98/jena-text/src/test/java/org/apache/jena/query/text/assembler/TestTextDatasetAssembler.java
----------------------------------------------------------------------
diff --git a/jena-text/src/test/java/org/apache/jena/query/text/assembler/TestTextDatasetAssembler.java
b/jena-text/src/test/java/org/apache/jena/query/text/assembler/TestTextDatasetAssembler.java
index 49d064d..e745d2e 100644
--- a/jena-text/src/test/java/org/apache/jena/query/text/assembler/TestTextDatasetAssembler.java
+++ b/jena-text/src/test/java/org/apache/jena/query/text/assembler/TestTextDatasetAssembler.java
@@ -44,124 +44,124 @@ import com.hp.hpl.jena.vocabulary.RDF ;
  */
 public class TestTextDatasetAssembler extends AbstractTestTextAssembler {
 
-    private static final String TESTBASE = "http://example.org/testDatasetAssembler/";
-
-    private static final Resource spec1;
-    private static final Resource noDatasetPropertySpec;
-    private static final Resource noIndexPropertySpec;
-    private static final Resource customTextDocProducerSpec;
-    private static final Resource customDyadicTextDocProducerSpec;
-
-    @Test
-    public void testSimpleDatasetAssembler() {
-        Dataset dataset = (Dataset) Assembler.general.open(spec1);
-        assertTrue(dataset.getContext().get(TextQuery.textIndex) instanceof TextIndexLucene);
-    }
-
-    @Test(expected = AssemblerException.class)
-    public void testErrorOnNoDataset() {
-        Assembler.general.open(noDatasetPropertySpec);
-    }
-
-    @Test(expected = AssemblerException.class)
-    public void testErrorOnNoIndex() {
-        Assembler.general.open(noIndexPropertySpec);
-    }
-
-    @Test
-    public void testCustomTextDocProducer() {
-        Dataset dataset = (Dataset)Assembler.general.open(customTextDocProducerSpec) ;
-        DatasetGraphText dsgText = (DatasetGraphText)dataset.asDatasetGraph() ;
-    assertTrue(dsgText.getMonitor() instanceof CustomTextDocProducer) ;
-    dataset.close();
-    }
-
-    @Test
-    public void testCustomTextDocProducerDyadicConstructor() {
-        Dataset dataset = (Dataset)Assembler.general.open(customDyadicTextDocProducerSpec)
;
-        DatasetGraphText dsgText = (DatasetGraphText)dataset.asDatasetGraph() ;
-    assertTrue(dsgText.getMonitor() instanceof CustomDyadicTextDocProducer) ;
-    
-    Node G= NodeFactory.createURI("http://example.com/G");
-    Node S = NodeFactory.createURI("http://example.com/S");
-    Node P = NodeFactory.createURI("http://example.com/P");
-    Node O = NodeFactory.createLiteral("http://example.com/O");
-    
-    dsgText.begin(ReadWrite.WRITE);
-    dsgText.add(G, S, P, O);
-    dsgText.commit();
-    dataset.close();
-    }
-
-    static {
-        TextAssembler.init();
-        AssemblerTDB.init();
-        spec1 =
-                model.createResource(TESTBASE + "spec1")
-                     .addProperty(RDF.type, TextVocab.textDataset)
-                     .addProperty(TextVocab.pDataset, SIMPLE_DATASET_SPEC)
-                     .addProperty(TextVocab.pIndex, SIMPLE_INDEX_SPEC3);
-        noDatasetPropertySpec =
-                model.createResource(TESTBASE + "noDatasetPropertySpec")
-                     .addProperty(RDF.type, TextVocab.textDataset)
-                     .addProperty(TextVocab.pIndex, SIMPLE_INDEX_SPEC4);
-        noIndexPropertySpec =
-                model.createResource(TESTBASE + "noIndexPropertySpec")
-                     .addProperty(RDF.type, TextVocab.textDataset)
-                     .addProperty(TextVocab.pDataset, SIMPLE_DATASET_SPEC);
-        customTextDocProducerSpec =
-        model.createResource(TESTBASE + "customTextDocProducerSpec")
-             .addProperty(RDF.type, TextVocab.textDataset)
-             .addProperty(TextVocab.pDataset, SIMPLE_DATASET_SPEC)
-             .addProperty(TextVocab.pIndex, SIMPLE_INDEX_SPEC5)
-             .addProperty(TextVocab.pTextDocProducer, model.createResource("java:org.apache.jena.query.text.assembler.TestTextDatasetAssembler$CustomTextDocProducer"));
-
-        customDyadicTextDocProducerSpec =
-        model.createResource(TESTBASE + "customDyadicTextDocProducerSpec")
-             .addProperty(RDF.type, TextVocab.textDataset)
-             .addProperty(TextVocab.pDataset, SIMPLE_DATASET_SPEC)
-             .addProperty(TextVocab.pIndex, SIMPLE_INDEX_SPEC5)
-             .addProperty(TextVocab.pTextDocProducer, model.createResource("java:org.apache.jena.query.text.assembler.TestTextDatasetAssembler$CustomDyadicTextDocProducer"));
-
-    }
-
-    private static class CustomTextDocProducer implements TextDocProducer {
-        
-        public CustomTextDocProducer(TextIndex textIndex) { }
-
-    @Override
-    public void start() { }
-
-    @Override
-    public void finish() { }
-
-    @Override
-    public void change(QuadAction qaction, Node g, Node s, Node p, Node o) { }
-    }
-
-
-    private static class CustomDyadicTextDocProducer implements TextDocProducer {
-        
-        final DatasetGraph dg;
-        Node lastSubject = null;
-
-        public CustomDyadicTextDocProducer(DatasetGraph dg, TextIndex textIndex) { 
-            this.dg = dg;
-        }
-
-    @Override
-    public void start() { }
-
-    @Override
-    public void finish() { 
-        Iterator<Quad> qi = dg.find(null, lastSubject, Node.ANY, Node.ANY);
-        while (qi.hasNext()) qi.next();
-    }
-
-    @Override
-    public void change(QuadAction qaction, Node g, Node s, Node p, Node o) { 
-        lastSubject = s;
-    }
-    }
+	private static final String TESTBASE = "http://example.org/testDatasetAssembler/";
+
+	private static final Resource spec1;
+	private static final Resource noDatasetPropertySpec;
+	private static final Resource noIndexPropertySpec;
+	private static final Resource customTextDocProducerSpec;
+	private static final Resource customDyadicTextDocProducerSpec;
+
+	@Test
+	public void testSimpleDatasetAssembler() {
+		Dataset dataset = (Dataset) Assembler.general.open(spec1);
+		assertTrue(dataset.getContext().get(TextQuery.textIndex) instanceof TextIndexLucene);
+	}
+
+	@Test(expected = AssemblerException.class)
+	public void testErrorOnNoDataset() {
+	    Assembler.general.open(noDatasetPropertySpec);
+	}
+
+	@Test(expected = AssemblerException.class)
+	public void testErrorOnNoIndex() {
+	    Assembler.general.open(noIndexPropertySpec);
+	}
+
+	@Test
+	public void testCustomTextDocProducer() {
+	    Dataset dataset = (Dataset)Assembler.general.open(customTextDocProducerSpec) ;
+	    DatasetGraphText dsgText = (DatasetGraphText)dataset.asDatasetGraph() ;
+	assertTrue(dsgText.getMonitor() instanceof CustomTextDocProducer) ;
+	dataset.close();
+	}
+
+	@Test
+	public void testCustomTextDocProducerDyadicConstructor() {
+	    Dataset dataset = (Dataset)Assembler.general.open(customDyadicTextDocProducerSpec) ;
+	    DatasetGraphText dsgText = (DatasetGraphText)dataset.asDatasetGraph() ;
+	assertTrue(dsgText.getMonitor() instanceof CustomDyadicTextDocProducer) ;
+	
+	Node G= NodeFactory.createURI("http://example.com/G");
+	Node S = NodeFactory.createURI("http://example.com/S");
+	Node P = NodeFactory.createURI("http://example.com/P");
+	Node O = NodeFactory.createLiteral("http://example.com/O");
+	
+	dsgText.begin(ReadWrite.WRITE);
+	dsgText.add(G, S, P, O);
+	dsgText.commit();
+	dataset.close();
+	}
+
+	static {
+		TextAssembler.init();
+		AssemblerTDB.init();
+		spec1 =
+				model.createResource(TESTBASE + "spec1")
+				     .addProperty(RDF.type, TextVocab.textDataset)
+				     .addProperty(TextVocab.pDataset, SIMPLE_DATASET_SPEC)
+				     .addProperty(TextVocab.pIndex, SIMPLE_INDEX_SPEC3);
+		noDatasetPropertySpec =
+				model.createResource(TESTBASE + "noDatasetPropertySpec")
+				     .addProperty(RDF.type, TextVocab.textDataset)
+				     .addProperty(TextVocab.pIndex, SIMPLE_INDEX_SPEC4);
+		noIndexPropertySpec =
+				model.createResource(TESTBASE + "noIndexPropertySpec")
+				     .addProperty(RDF.type, TextVocab.textDataset)
+				     .addProperty(TextVocab.pDataset, SIMPLE_DATASET_SPEC);
+		customTextDocProducerSpec =
+		model.createResource(TESTBASE + "customTextDocProducerSpec")
+		     .addProperty(RDF.type, TextVocab.textDataset)
+		     .addProperty(TextVocab.pDataset, SIMPLE_DATASET_SPEC)
+		     .addProperty(TextVocab.pIndex, SIMPLE_INDEX_SPEC5)
+		     .addProperty(TextVocab.pTextDocProducer, model.createResource("java:org.apache.jena.query.text.assembler.TestTextDatasetAssembler$CustomTextDocProducer"));
+
+		customDyadicTextDocProducerSpec =
+		model.createResource(TESTBASE + "customDyadicTextDocProducerSpec")
+		     .addProperty(RDF.type, TextVocab.textDataset)
+		     .addProperty(TextVocab.pDataset, SIMPLE_DATASET_SPEC)
+		     .addProperty(TextVocab.pIndex, SIMPLE_INDEX_SPEC5)
+		     .addProperty(TextVocab.pTextDocProducer, model.createResource("java:org.apache.jena.query.text.assembler.TestTextDatasetAssembler$CustomDyadicTextDocProducer"));
+
+	}
+
+	private static class CustomTextDocProducer implements TextDocProducer {
+	    
+	    public CustomTextDocProducer(TextIndex textIndex) { }
+
+	@Override
+	public void start() { }
+
+	@Override
+	public void finish() { }
+
+	@Override
+	public void change(QuadAction qaction, Node g, Node s, Node p, Node o) { }
+	}
+
+
+	private static class CustomDyadicTextDocProducer implements TextDocProducer {
+	    
+		final DatasetGraph dg;
+		Node lastSubject = null;
+
+		public CustomDyadicTextDocProducer(DatasetGraph dg, TextIndex textIndex) { 
+			this.dg = dg;
+		}
+
+	@Override
+	public void start() { }
+
+	@Override
+	public void finish() { 
+		Iterator<Quad> qi = dg.find(null, lastSubject, Node.ANY, Node.ANY);
+		while (qi.hasNext()) qi.next();
+	}
+
+	@Override
+	public void change(QuadAction qaction, Node g, Node s, Node p, Node o) { 
+		lastSubject = s;
+	}
+	}
 
 }


Mime
View raw message