You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jena.apache.org by an...@apache.org on 2011/06/16 10:32:55 UTC
svn commit: r1136322 - in
/incubator/jena/Jena2/ARQ/trunk/src-test/com/hp/hpl/jena/sparql/resultset:
TS_ResultSet.java TestResultSetFormat.java TestResultSetFormat1.java
TestResultSetFormat2.java
Author: andy
Date: Thu Jun 16 08:32:55 2011
New Revision: 1136322
URL: http://svn.apache.org/viewvc?rev=1136322&view=rev
Log:
Add test for bad format TSV.
Reorganise to have parameterized and non-parameterized tests
JENA-72
Added:
incubator/jena/Jena2/ARQ/trunk/src-test/com/hp/hpl/jena/sparql/resultset/TestResultSetFormat1.java (contents, props changed)
- copied, changed from r1136315, incubator/jena/Jena2/ARQ/trunk/src-test/com/hp/hpl/jena/sparql/resultset/TestResultSetFormat.java
incubator/jena/Jena2/ARQ/trunk/src-test/com/hp/hpl/jena/sparql/resultset/TestResultSetFormat2.java (with props)
Removed:
incubator/jena/Jena2/ARQ/trunk/src-test/com/hp/hpl/jena/sparql/resultset/TestResultSetFormat.java
Modified:
incubator/jena/Jena2/ARQ/trunk/src-test/com/hp/hpl/jena/sparql/resultset/TS_ResultSet.java
Modified: incubator/jena/Jena2/ARQ/trunk/src-test/com/hp/hpl/jena/sparql/resultset/TS_ResultSet.java
URL: http://svn.apache.org/viewvc/incubator/jena/Jena2/ARQ/trunk/src-test/com/hp/hpl/jena/sparql/resultset/TS_ResultSet.java?rev=1136322&r1=1136321&r2=1136322&view=diff
==============================================================================
--- incubator/jena/Jena2/ARQ/trunk/src-test/com/hp/hpl/jena/sparql/resultset/TS_ResultSet.java (original)
+++ incubator/jena/Jena2/ARQ/trunk/src-test/com/hp/hpl/jena/sparql/resultset/TS_ResultSet.java Thu Jun 16 08:32:55 2011
@@ -12,7 +12,8 @@ import org.junit.runners.Suite ;
@RunWith(Suite.class)
@Suite.SuiteClasses( {
TestResultSet.class
- , TestResultSetFormat.class
+ , TestResultSetFormat1.class
+ , TestResultSetFormat2.class
//, TestResultSetCompare.class
})
public class TS_ResultSet
Copied: incubator/jena/Jena2/ARQ/trunk/src-test/com/hp/hpl/jena/sparql/resultset/TestResultSetFormat1.java (from r1136315, incubator/jena/Jena2/ARQ/trunk/src-test/com/hp/hpl/jena/sparql/resultset/TestResultSetFormat.java)
URL: http://svn.apache.org/viewvc/incubator/jena/Jena2/ARQ/trunk/src-test/com/hp/hpl/jena/sparql/resultset/TestResultSetFormat1.java?p2=incubator/jena/Jena2/ARQ/trunk/src-test/com/hp/hpl/jena/sparql/resultset/TestResultSetFormat1.java&p1=incubator/jena/Jena2/ARQ/trunk/src-test/com/hp/hpl/jena/sparql/resultset/TestResultSetFormat.java&r1=1136315&r2=1136322&rev=1136322&view=diff
==============================================================================
--- incubator/jena/Jena2/ARQ/trunk/src-test/com/hp/hpl/jena/sparql/resultset/TestResultSetFormat.java (original)
+++ incubator/jena/Jena2/ARQ/trunk/src-test/com/hp/hpl/jena/sparql/resultset/TestResultSetFormat1.java Thu Jun 16 08:32:55 2011
@@ -26,7 +26,7 @@ import com.hp.hpl.jena.sparql.sse.SSE ;
import com.hp.hpl.jena.sparql.sse.builders.BuilderResultSet ;
@RunWith(Parameterized.class)
-public class TestResultSetFormat
+public class TestResultSetFormat1
{
static String[] $rs1 = {
@@ -56,7 +56,7 @@ public class TestResultSetFormat
private final String[] $rs ;
- public TestResultSetFormat(String[] rs)
+ public TestResultSetFormat1(String[] rs)
{
this.$rs = rs ;
}
@@ -110,7 +110,6 @@ public class TestResultSetFormat
ByteArrayOutputStream out = new ByteArrayOutputStream() ;
ResultSetFormatter.outputAsCSV(out, rs) ;
}
-
}
/*
Propchange: incubator/jena/Jena2/ARQ/trunk/src-test/com/hp/hpl/jena/sparql/resultset/TestResultSetFormat1.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: incubator/jena/Jena2/ARQ/trunk/src-test/com/hp/hpl/jena/sparql/resultset/TestResultSetFormat2.java
URL: http://svn.apache.org/viewvc/incubator/jena/Jena2/ARQ/trunk/src-test/com/hp/hpl/jena/sparql/resultset/TestResultSetFormat2.java?rev=1136322&view=auto
==============================================================================
--- incubator/jena/Jena2/ARQ/trunk/src-test/com/hp/hpl/jena/sparql/resultset/TestResultSetFormat2.java (added)
+++ incubator/jena/Jena2/ARQ/trunk/src-test/com/hp/hpl/jena/sparql/resultset/TestResultSetFormat2.java Thu Jun 16 08:32:55 2011
@@ -0,0 +1,58 @@
+/*
+ * (c) Copyright 2009 Talis Systems Ltd
+ * (c) Copyright 2011 Epimorphics Ltd.
+ * All rights reserved.
+ * [See end of file]
+ */
+
+package com.hp.hpl.jena.sparql.resultset;
+
+import java.io.ByteArrayInputStream ;
+
+import org.junit.Test ;
+import org.openjena.atlas.lib.StrUtils ;
+
+import com.hp.hpl.jena.query.ResultSet ;
+import com.hp.hpl.jena.query.ResultSetFactory ;
+
+public class TestResultSetFormat2
+{
+ @Test public void resultset_10()
+ {
+ // This is illegal
+ // Two vars, row of 3 values.
+ String x = "?x\t?y\n'a'\t'b'\t'c'" ;
+ byte[] b = StrUtils.asUTF8bytes(x) ;
+ ByteArrayInputStream in = new ByteArrayInputStream(b) ;
+ ResultSet rs2 = ResultSetFactory.fromTSV(in) ;
+ }
+
+}
+
+/*
+ * (c) Copyright 2009 Talis Systems Ltd
+ * (c) Copyright 2011 Epimorphics Ltd.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
\ No newline at end of file
Propchange: incubator/jena/Jena2/ARQ/trunk/src-test/com/hp/hpl/jena/sparql/resultset/TestResultSetFormat2.java
------------------------------------------------------------------------------
svn:mime-type = text/plain