jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jpz6311...@apache.org
Subject svn commit: r1597283 - in /jena/trunk/jena-arq/src/test: java/org/apache/jena/riot/lang/TestLangCSV.java resources/test.csv
Date Sat, 24 May 2014 13:16:29 GMT
Author: jpz6311whu
Date: Sat May 24 13:16:28 2014
New Revision: 1597283

URL: http://svn.apache.org/r1597283
Log:
add unit test for LangCSV (JENA-444)

Added:
    jena/trunk/jena-arq/src/test/java/org/apache/jena/riot/lang/TestLangCSV.java   (with props)
    jena/trunk/jena-arq/src/test/resources/test.csv

Added: jena/trunk/jena-arq/src/test/java/org/apache/jena/riot/lang/TestLangCSV.java
URL: http://svn.apache.org/viewvc/jena/trunk/jena-arq/src/test/java/org/apache/jena/riot/lang/TestLangCSV.java?rev=1597283&view=auto
==============================================================================
--- jena/trunk/jena-arq/src/test/java/org/apache/jena/riot/lang/TestLangCSV.java (added)
+++ jena/trunk/jena-arq/src/test/java/org/apache/jena/riot/lang/TestLangCSV.java Sat May 24
13:16:28 2014
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jena.riot.lang;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+
+import org.apache.jena.atlas.junit.BaseTest;
+import org.apache.jena.riot.RDFDataMgr;
+import org.apache.jena.riot.RDFLanguages;
+import org.junit.Test;
+
+import com.hp.hpl.jena.rdf.model.Model;
+import com.hp.hpl.jena.rdf.model.ModelFactory;
+import com.hp.hpl.jena.util.PrintUtil;
+
+public class TestLangCSV extends BaseTest
+{
+	  @Test public void RDFDataMgrReadTest() throws FileNotFoundException{
+		  String file = "src/test/resources/test.csv";
+		  FileReader r= new FileReader(new File (file));
+		  Model m = ModelFactory.createDefaultModel() ;
+		  RDFDataMgr.read(m, r, file, RDFLanguages.CSV) ;
+		  assertEquals(6, m.size()) ;
+		  PrintUtil.printOut(m.listStatements());
+	  }
+}

Propchange: jena/trunk/jena-arq/src/test/java/org/apache/jena/riot/lang/TestLangCSV.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: jena/trunk/jena-arq/src/test/resources/test.csv
URL: http://svn.apache.org/viewvc/jena/trunk/jena-arq/src/test/resources/test.csv?rev=1597283&view=auto
==============================================================================
--- jena/trunk/jena-arq/src/test/resources/test.csv (added)
+++ jena/trunk/jena-arq/src/test/resources/test.csv Sat May 24 13:16:28 2014
@@ -0,0 +1,3 @@
+Town,Population
+Southton,123000.0 
+Northville,654000 



Mime
View raw message