You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jena.apache.org by jp...@apache.org on 2013/09/02 08:46:21 UTC
svn commit: r1519358 [4/5] - in /jena/trunk/jena-spatial: ./ src/ src/main/
src/main/java/ src/main/java/examples/ src/main/java/jena/
src/main/java/org/ src/main/java/org/apache/ src/main/java/org/apache/jena/
src/main/java/org/apache/jena/query/ src/...
Added: jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/AbstractTestIsNearByPF.java
URL: http://svn.apache.org/viewvc/jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/AbstractTestIsNearByPF.java?rev=1519358&view=auto
==============================================================================
--- jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/AbstractTestIsNearByPF.java (added)
+++ jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/AbstractTestIsNearByPF.java Mon Sep 2 06:46:19 2013
@@ -0,0 +1,314 @@
+/*
+ * 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.query.spatial.pfunction;
+
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.apache.jena.atlas.lib.StrUtils;
+import org.apache.jena.query.spatial.AbstractTestDatasetWithSpatialIndex;
+import org.junit.Test;
+
+public abstract class AbstractTestIsNearByPF extends AbstractTestDatasetWithSpatialIndex {
+
+ @Test
+ public void testOneSimpleResult() {
+ final String turtle = StrUtils.strjoinNL(TURTLE_PROLOG, "<"
+ + RESOURCE_BASE + "testOneSimpleResult>",
+ " geo:lat '51.3827'^^xsd:float ;",
+ " geo:long '-2.71909'^^xsd:float ", ".");
+ String queryString = StrUtils.strjoinNL(QUERY_PROLOG, "SELECT ?s",
+ "WHERE {",
+ " ?s spatial:nearby (51.3000 -2.71000 100.0 'miles' -1) .", "}");
+ Set<String> expectedURIs = (new HashSet<String>());
+ expectedURIs
+ .addAll(Arrays
+ .asList((new String[] { "http://example.org/data/resource/testOneSimpleResult" })));
+ doTestSearch(turtle, queryString, expectedURIs);
+ }
+
+ @Test
+ public void testMultipleResults() {
+ String label = "testMultipleResults";
+ final String turtle = StrUtils.strjoinNL(TURTLE_PROLOG, "<"
+ + RESOURCE_BASE + label + "1>",
+ " geo:lat '51.3827'^^xsd:float ;",
+ " geo:long '-2.71909'^^xsd:float ;" , ".",
+ "<" + RESOURCE_BASE + label + "2>",
+ " geo:lat '51.3967'^^xsd:float ;",
+ " geo:long '-3.34333'^^xsd:float ;", ".");
+
+ String queryString = StrUtils.strjoinNL(QUERY_PROLOG, "SELECT ?s",
+ "WHERE {",
+ " ?s spatial:nearby (51.3000 -2.71000 100.0 'miles' -1) .", "}");
+ Set<String> expectedURIs = (new HashSet<String>());
+ expectedURIs.addAll(Arrays.asList((new String[] {
+ "http://example.org/data/resource/" + label + "1",
+ "http://example.org/data/resource/" + label + "2" })));
+ doTestSearch(turtle, queryString, expectedURIs);
+ }
+
+ @Test
+ public void testArgumentListSize() {
+ final String turtle = StrUtils.strjoinNL(TURTLE_PROLOG, "<"
+ + RESOURCE_BASE + "testArgumentListSize>",
+ " geo:lat '51.3827'^^xsd:float ;",
+ " geo:long '-2.71909'^^xsd:float ", ".");
+ String queryString = StrUtils.strjoinNL(QUERY_PROLOG, "SELECT ?s",
+ "WHERE {",
+ " ?s spatial:nearby (51.3000 -2.71000) .", "}");
+ doTestSearchThrowException(turtle, queryString);
+
+ queryString = StrUtils.strjoinNL(QUERY_PROLOG, "SELECT ?s",
+ "WHERE {",
+ " ?s spatial:nearby (51.3000 -2.71000 100 'miles' 1 'another argument') .", "}");
+ doTestSearchThrowException(turtle, queryString);
+ }
+
+ @Test
+ public void testSearchLimitsResults() {
+ String label = "testSearchLimitsResults";
+ final String turtle = StrUtils.strjoinNL(TURTLE_PROLOG, "<"
+ + RESOURCE_BASE + label + "1>",
+ " geo:lat '51.3827'^^xsd:float ;",
+ " geo:long '-2.71909'^^xsd:float ;" , ".",
+ "<" + RESOURCE_BASE + label + "2>",
+ " geo:lat '51.3967'^^xsd:float ;",
+ " geo:long '-3.34333'^^xsd:float ;", ".");
+ String queryString = StrUtils.strjoinNL(QUERY_PROLOG, "SELECT ?s",
+ "WHERE {",
+ " ?s spatial:nearby (51.3000 -2.71000 100.0 1) .", "}");
+ Set<String> expectedURIs = (new HashSet<String>());
+ expectedURIs.addAll( Arrays.asList((
+ new String[]
+ {
+ "http://example.org/data/resource/" + label + "1",
+ "http://example.org/data/resource/" + label + "2"
+ }
+ )));
+ doTestSearch(turtle, queryString, expectedURIs, 1);
+
+
+ queryString = StrUtils.strjoinNL(QUERY_PROLOG, "SELECT ?s",
+ "WHERE {",
+ " ?s spatial:nearby (51.3000 -2.71000 100.0 -1) .", "}");
+ expectedURIs = (new HashSet<String>());
+ expectedURIs.addAll( Arrays.asList((
+ new String[]
+ {
+ "http://example.org/data/resource/" + label + "1",
+ "http://example.org/data/resource/" + label + "2"
+ }
+ )));
+ doTestSearch(turtle, queryString, expectedURIs);
+
+ queryString = StrUtils.strjoinNL(QUERY_PROLOG, "SELECT ?s",
+ "WHERE {",
+ " ?s spatial:nearby (51.3000 -2.71000 100.0 3) .", "}");
+ expectedURIs = (new HashSet<String>());
+ expectedURIs.addAll( Arrays.asList((
+ new String[]
+ {
+ "http://example.org/data/resource/" + label + "1",
+ "http://example.org/data/resource/" + label + "2"
+ }
+ )));
+ doTestSearch(turtle, queryString, expectedURIs);
+
+ queryString = StrUtils.strjoinNL(QUERY_PROLOG, "SELECT ?s",
+ "WHERE {",
+ " ?s spatial:nearby (51.3000 -2.71000 100.0 'something not an integer') .", "}");
+ expectedURIs = (new HashSet<String>());
+ doTestSearch(turtle, queryString, expectedURIs);
+ }
+
+ @Test
+ public void testDistanceUnits() {
+ String label = "testDistanceUnits";
+ final String turtle = StrUtils.strjoinNL(TURTLE_PROLOG, "<"
+ + RESOURCE_BASE + label + "1>",
+ " geo:lat '51.3827'^^xsd:float ;",
+ " geo:long '-2.71909'^^xsd:float ;" , ".",
+ "<" + RESOURCE_BASE + label + "2>",
+ " geo:lat '51.3967'^^xsd:float ;",
+ " geo:long '-3.34333'^^xsd:float ;", ".",
+ "<" + RESOURCE_BASE + label + "3>",
+ " geo:lat '52.4539'^^xsd:float ;",
+ " geo:long '-1.74803'^^xsd:float ;", ".");
+ String queryString = StrUtils.strjoinNL(QUERY_PROLOG, "SELECT ?s",
+ "WHERE {",
+ " ?s spatial:nearby (51.3000 -2.71000 100.0 'miles') .", "}");
+ Set<String> expectedURIs = (new HashSet<String>());
+ expectedURIs.addAll( Arrays.asList((
+ new String[]
+ {
+ "http://example.org/data/resource/" + label + "1",
+ "http://example.org/data/resource/" + label + "2",
+ "http://example.org/data/resource/" + label + "3"
+ }
+ )));
+ doTestSearch(turtle, queryString, expectedURIs);
+
+ queryString = StrUtils.strjoinNL(QUERY_PROLOG, "SELECT ?s",
+ "WHERE {",
+ " ?s spatial:nearby (51.3000 -2.71000 100.0 'mi') .", "}");
+ expectedURIs = (new HashSet<String>());
+ expectedURIs.addAll( Arrays.asList((
+ new String[]
+ {
+ "http://example.org/data/resource/" + label + "1",
+ "http://example.org/data/resource/" + label + "2",
+ "http://example.org/data/resource/" + label + "3"
+ }
+ )));
+ doTestSearch(turtle, queryString, expectedURIs);
+
+ queryString = StrUtils.strjoinNL(QUERY_PROLOG, "SELECT ?s",
+ "WHERE {",
+ " ?s spatial:nearby (51.3000 -2.71000 100.0 'kilometers') .", "}");
+ expectedURIs = (new HashSet<String>());
+ expectedURIs.addAll( Arrays.asList((
+ new String[]
+ {
+ "http://example.org/data/resource/" + label + "1",
+ "http://example.org/data/resource/" + label + "2"
+ }
+ )));
+ doTestSearch(turtle, queryString, expectedURIs);
+
+ queryString = StrUtils.strjoinNL(QUERY_PROLOG, "SELECT ?s",
+ "WHERE {",
+ " ?s spatial:nearby (51.3000 -2.71000 100.0 'km') .", "}");
+ expectedURIs = (new HashSet<String>());
+ expectedURIs.addAll( Arrays.asList((
+ new String[]
+ {
+ "http://example.org/data/resource/" + label + "1",
+ "http://example.org/data/resource/" + label + "2"
+ }
+ )));
+ doTestSearch(turtle, queryString, expectedURIs);
+
+ queryString = StrUtils.strjoinNL(QUERY_PROLOG, "SELECT ?s",
+ "WHERE {",
+ " ?s spatial:nearby (51.3000 -2.71000 10000.0 'meters') .", "}");
+ expectedURIs = (new HashSet<String>());
+ expectedURIs.addAll( Arrays.asList((
+ new String[]
+ {
+ "http://example.org/data/resource/" + label + "1"
+ }
+ )));
+ doTestSearch(turtle, queryString, expectedURIs);
+ queryString = StrUtils.strjoinNL(QUERY_PROLOG, "SELECT ?s",
+ "WHERE {",
+ " ?s spatial:nearby (51.3000 -2.71000 10000.0 'm') .", "}");
+ expectedURIs = (new HashSet<String>());
+ expectedURIs.addAll( Arrays.asList((
+ new String[]
+ {
+ "http://example.org/data/resource/" + label + "1"
+ }
+ )));
+ doTestSearch(turtle, queryString, expectedURIs);
+
+ queryString = StrUtils.strjoinNL(QUERY_PROLOG, "SELECT ?s",
+ "WHERE {",
+ " ?s spatial:nearby (51.3000 -2.71000 1000000.0 'centimeters') .", "}");
+ expectedURIs = (new HashSet<String>());
+ expectedURIs.addAll( Arrays.asList((
+ new String[]
+ {
+ "http://example.org/data/resource/" + label + "1"
+ }
+ )));
+ doTestSearch(turtle, queryString, expectedURIs);
+ queryString = StrUtils.strjoinNL(QUERY_PROLOG, "SELECT ?s",
+ "WHERE {",
+ " ?s spatial:nearby (51.3000 -2.71000 1000000.0 'cm') .", "}");
+ expectedURIs = (new HashSet<String>());
+ expectedURIs.addAll( Arrays.asList((
+ new String[]
+ {
+ "http://example.org/data/resource/" + label + "1"
+ }
+ )));
+ doTestSearch(turtle, queryString, expectedURIs);
+
+ queryString = StrUtils.strjoinNL(QUERY_PROLOG, "SELECT ?s",
+ "WHERE {",
+ " ?s spatial:nearby (51.3000 -2.71000 10000000.0 'milimeters') .", "}");
+ expectedURIs = (new HashSet<String>());
+ expectedURIs.addAll( Arrays.asList((
+ new String[]
+ {
+ "http://example.org/data/resource/" + label + "1"
+ }
+ )));
+ doTestSearch(turtle, queryString, expectedURIs);
+ queryString = StrUtils.strjoinNL(QUERY_PROLOG, "SELECT ?s",
+ "WHERE {",
+ " ?s spatial:nearby (51.3000 -2.71000 10000000.0 'mm') .", "}");
+ expectedURIs = (new HashSet<String>());
+ expectedURIs.addAll( Arrays.asList((
+ new String[]
+ {
+ "http://example.org/data/resource/" + label + "1"
+ }
+ )));
+ doTestSearch(turtle, queryString, expectedURIs);
+
+ queryString = StrUtils.strjoinNL(QUERY_PROLOG, "SELECT ?s",
+ "WHERE {",
+ " ?s spatial:nearby (51.3000 -2.71000 0.09 'degrees') .", "}");
+ expectedURIs = (new HashSet<String>());
+ expectedURIs.addAll( Arrays.asList((
+ new String[]
+ {
+ "http://example.org/data/resource/" + label + "1"
+ }
+ )));
+ doTestSearch(turtle, queryString, expectedURIs);
+ queryString = StrUtils.strjoinNL(QUERY_PROLOG, "SELECT ?s",
+ "WHERE {",
+ " ?s spatial:nearby (51.3000 -2.71000 0.09 'de') .", "}");
+ expectedURIs = (new HashSet<String>());
+ expectedURIs.addAll( Arrays.asList((
+ new String[]
+ {
+ "http://example.org/data/resource/" + label + "1"
+ }
+ )));
+ doTestSearch(turtle, queryString, expectedURIs);
+
+
+ queryString = StrUtils.strjoinNL(QUERY_PROLOG, "SELECT ?s",
+ "WHERE {",
+ " ?s spatial:nearby (51.3000 -2.71000 100.0 1 'mi') .", "}");
+ expectedURIs = (new HashSet<String>());
+ doTestSearch(turtle, queryString, expectedURIs);
+
+ queryString = StrUtils.strjoinNL(QUERY_PROLOG, "SELECT ?s",
+ "WHERE {",
+ " ?s spatial:nearby (51.3000 -2.71000 100.0 'other unsupported unit' -1) .", "}");
+ expectedURIs = (new HashSet<String>());
+ doTestSearch(turtle, queryString, expectedURIs);
+ }
+}
Propchange: jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/AbstractTestIsNearByPF.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/AbstractTestIsWithinBoxPF.java
URL: http://svn.apache.org/viewvc/jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/AbstractTestIsWithinBoxPF.java?rev=1519358&view=auto
==============================================================================
--- jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/AbstractTestIsWithinBoxPF.java (added)
+++ jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/AbstractTestIsWithinBoxPF.java Mon Sep 2 06:46:19 2013
@@ -0,0 +1,142 @@
+/*
+ * 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.query.spatial.pfunction;
+
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.apache.jena.atlas.lib.StrUtils;
+import org.apache.jena.query.spatial.AbstractTestDatasetWithSpatialIndex;
+import org.junit.Test;
+
+public abstract class AbstractTestIsWithinBoxPF extends AbstractTestDatasetWithSpatialIndex {
+
+ @Test
+ public void testOneSimpleResult() {
+ final String turtle = StrUtils.strjoinNL(TURTLE_PROLOG, "<"
+ + RESOURCE_BASE + "testOneSimpleResult>",
+ " geo:lat '51.3827'^^xsd:float ;",
+ " geo:long '-2.71909'^^xsd:float ", ".");
+ String queryString = StrUtils.strjoinNL(QUERY_PROLOG, "SELECT ?s",
+ "WHERE {",
+ " ?s spatial:withinBox (51.1000 -4.0000 51.4000 0.0000 -1) .", "}");
+ Set<String> expectedURIs = (new HashSet<String>());
+ expectedURIs
+ .addAll(Arrays
+ .asList((new String[] { "http://example.org/data/resource/testOneSimpleResult" })));
+ doTestSearch(turtle, queryString, expectedURIs);
+ }
+
+ @Test
+ public void testMultipleResults() {
+ String label = "testMultipleResults";
+ final String turtle = StrUtils.strjoinNL(TURTLE_PROLOG, "<"
+ + RESOURCE_BASE + label + "1>",
+ " geo:lat '51.3827'^^xsd:float ;",
+ " geo:long '-2.71909'^^xsd:float ;" , ".",
+ "<" + RESOURCE_BASE + label + "2>",
+ " geo:lat '51.3967'^^xsd:float ;",
+ " geo:long '-3.34333'^^xsd:float ;", ".");
+
+ String queryString = StrUtils.strjoinNL(QUERY_PROLOG, "SELECT ?s",
+ "WHERE {",
+ " ?s spatial:withinBox (51.1000 -4.0000 51.4000 0.0000 -1) .", "}");
+ Set<String> expectedURIs = (new HashSet<String>());
+ expectedURIs.addAll(Arrays.asList((new String[] {
+ "http://example.org/data/resource/" + label + "1",
+ "http://example.org/data/resource/" + label + "2" })));
+ doTestSearch(turtle, queryString, expectedURIs);
+ }
+
+ @Test
+ public void testArgumentListSize() {
+ final String turtle = StrUtils.strjoinNL(TURTLE_PROLOG, "<"
+ + RESOURCE_BASE + "testArgumentListSize>",
+ " geo:lat '51.3827'^^xsd:float ;",
+ " geo:long '-2.71909'^^xsd:float ", ".");
+ String queryString = StrUtils.strjoinNL(QUERY_PROLOG, "SELECT ?s",
+ "WHERE {",
+ " ?s spatial:withinBox (51.1000 -4.0000 -1) .", "}");
+ doTestSearchThrowException(turtle, queryString);
+
+ queryString = StrUtils.strjoinNL(QUERY_PROLOG, "SELECT ?s",
+ "WHERE {",
+ " ?s spatial:withinBox (51.1000 -4.0000 51.4000 0.0000 -1 'some other argument') .", "}");
+ doTestSearchThrowException(turtle, queryString);
+ }
+
+ @Test
+ public void testSearchLimitsResults() {
+ String label = "testSearchLimitsResults";
+ final String turtle = StrUtils.strjoinNL(TURTLE_PROLOG, "<"
+ + RESOURCE_BASE + label + "1>",
+ " geo:lat '51.3827'^^xsd:float ;",
+ " geo:long '-2.71909'^^xsd:float ;" , ".",
+ "<" + RESOURCE_BASE + label + "2>",
+ " geo:lat '51.3967'^^xsd:float ;",
+ " geo:long '-3.34333'^^xsd:float ;", ".");
+ String queryString = StrUtils.strjoinNL(QUERY_PROLOG, "SELECT ?s",
+ "WHERE {",
+ " ?s spatial:withinBox (51.1000 -4.0000 51.4000 0.0000 1) .", "}");
+ Set<String> expectedURIs = (new HashSet<String>());
+ expectedURIs.addAll( Arrays.asList((
+ new String[]
+ {
+ "http://example.org/data/resource/" + label + "1",
+ "http://example.org/data/resource/" + label + "2"
+ }
+ )));
+ doTestSearch(turtle, queryString, expectedURIs, 1);
+
+
+ queryString = StrUtils.strjoinNL(QUERY_PROLOG, "SELECT ?s",
+ "WHERE {",
+ " ?s spatial:withinBox (51.1000 -4.0000 51.4000 0.0000 -1) .", "}");
+ expectedURIs = (new HashSet<String>());
+ expectedURIs.addAll( Arrays.asList((
+ new String[]
+ {
+ "http://example.org/data/resource/" + label + "1",
+ "http://example.org/data/resource/" + label + "2"
+ }
+ )));
+ doTestSearch(turtle, queryString, expectedURIs);
+
+ queryString = StrUtils.strjoinNL(QUERY_PROLOG, "SELECT ?s",
+ "WHERE {",
+ " ?s spatial:withinBox (51.1000 -4.0000 51.4000 0.0000 3) .", "}");
+ expectedURIs = (new HashSet<String>());
+ expectedURIs.addAll( Arrays.asList((
+ new String[]
+ {
+ "http://example.org/data/resource/" + label + "1",
+ "http://example.org/data/resource/" + label + "2"
+ }
+ )));
+ doTestSearch(turtle, queryString, expectedURIs);
+
+ queryString = StrUtils.strjoinNL(QUERY_PROLOG, "SELECT ?s",
+ "WHERE {",
+ " ?s spatial:withinBox (51.1000 -4.0000 51.4000 0.0000 'something not an integer') .", "}");
+ expectedURIs = (new HashSet<String>());
+ doTestSearch(turtle, queryString, expectedURIs);
+ }
+
+}
Propchange: jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/AbstractTestIsWithinBoxPF.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/AbstractTestIsWithinCirclePF.java
URL: http://svn.apache.org/viewvc/jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/AbstractTestIsWithinCirclePF.java?rev=1519358&view=auto
==============================================================================
--- jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/AbstractTestIsWithinCirclePF.java (added)
+++ jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/AbstractTestIsWithinCirclePF.java Mon Sep 2 06:46:19 2013
@@ -0,0 +1,314 @@
+/*
+ * 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.query.spatial.pfunction;
+
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.apache.jena.atlas.lib.StrUtils;
+import org.apache.jena.query.spatial.AbstractTestDatasetWithSpatialIndex;
+import org.junit.Test;
+
+public abstract class AbstractTestIsWithinCirclePF extends AbstractTestDatasetWithSpatialIndex {
+
+ @Test
+ public void testOneSimpleResult() {
+ final String turtle = StrUtils.strjoinNL(TURTLE_PROLOG, "<"
+ + RESOURCE_BASE + "testOneSimpleResult>",
+ " geo:lat '51.3827'^^xsd:float ;",
+ " geo:long '-2.71909'^^xsd:float ", ".");
+ String queryString = StrUtils.strjoinNL(QUERY_PROLOG, "SELECT ?s",
+ "WHERE {",
+ " ?s spatial:withinCircle (51.3000 -2.71000 100.0 'miles' -1) .", "}");
+ Set<String> expectedURIs = (new HashSet<String>());
+ expectedURIs
+ .addAll(Arrays
+ .asList((new String[] { "http://example.org/data/resource/testOneSimpleResult" })));
+ doTestSearch(turtle, queryString, expectedURIs);
+ }
+
+ @Test
+ public void testMultipleResults() {
+ String label = "testMultipleResults";
+ final String turtle = StrUtils.strjoinNL(TURTLE_PROLOG, "<"
+ + RESOURCE_BASE + label + "1>",
+ " geo:lat '51.3827'^^xsd:float ;",
+ " geo:long '-2.71909'^^xsd:float ;" , ".",
+ "<" + RESOURCE_BASE + label + "2>",
+ " geo:lat '51.3967'^^xsd:float ;",
+ " geo:long '-3.34333'^^xsd:float ;", ".");
+
+ String queryString = StrUtils.strjoinNL(QUERY_PROLOG, "SELECT ?s",
+ "WHERE {",
+ " ?s spatial:withinCircle (51.3000 -2.71000 100.0 'miles' -1) .", "}");
+ Set<String> expectedURIs = (new HashSet<String>());
+ expectedURIs.addAll(Arrays.asList((new String[] {
+ "http://example.org/data/resource/" + label + "1",
+ "http://example.org/data/resource/" + label + "2" })));
+ doTestSearch(turtle, queryString, expectedURIs);
+ }
+
+ @Test
+ public void testArgumentListSize() {
+ final String turtle = StrUtils.strjoinNL(TURTLE_PROLOG, "<"
+ + RESOURCE_BASE + "testArgumentListSize>",
+ " geo:lat '51.3827'^^xsd:float ;",
+ " geo:long '-2.71909'^^xsd:float ", ".");
+ String queryString = StrUtils.strjoinNL(QUERY_PROLOG, "SELECT ?s",
+ "WHERE {",
+ " ?s spatial:withinCircle (51.3000 -2.71000) .", "}");
+ doTestSearchThrowException(turtle, queryString);
+
+ queryString = StrUtils.strjoinNL(QUERY_PROLOG, "SELECT ?s",
+ "WHERE {",
+ " ?s spatial:withinCircle (51.3000 -2.71000 100 'miles' 1 'another argument') .", "}");
+ doTestSearchThrowException(turtle, queryString);
+ }
+
+ @Test
+ public void testSearchLimitsResults() {
+ String label = "testSearchLimitsResults";
+ final String turtle = StrUtils.strjoinNL(TURTLE_PROLOG, "<"
+ + RESOURCE_BASE + label + "1>",
+ " geo:lat '51.3827'^^xsd:float ;",
+ " geo:long '-2.71909'^^xsd:float ;" , ".",
+ "<" + RESOURCE_BASE + label + "2>",
+ " geo:lat '51.3967'^^xsd:float ;",
+ " geo:long '-3.34333'^^xsd:float ;", ".");
+ String queryString = StrUtils.strjoinNL(QUERY_PROLOG, "SELECT ?s",
+ "WHERE {",
+ " ?s spatial:withinCircle (51.3000 -2.71000 100.0 1) .", "}");
+ Set<String> expectedURIs = (new HashSet<String>());
+ expectedURIs.addAll( Arrays.asList((
+ new String[]
+ {
+ "http://example.org/data/resource/" + label + "1",
+ "http://example.org/data/resource/" + label + "2"
+ }
+ )));
+ doTestSearch(turtle, queryString, expectedURIs, 1);
+
+
+ queryString = StrUtils.strjoinNL(QUERY_PROLOG, "SELECT ?s",
+ "WHERE {",
+ " ?s spatial:withinCircle (51.3000 -2.71000 100.0 -1) .", "}");
+ expectedURIs = (new HashSet<String>());
+ expectedURIs.addAll( Arrays.asList((
+ new String[]
+ {
+ "http://example.org/data/resource/" + label + "1",
+ "http://example.org/data/resource/" + label + "2"
+ }
+ )));
+ doTestSearch(turtle, queryString, expectedURIs);
+
+ queryString = StrUtils.strjoinNL(QUERY_PROLOG, "SELECT ?s",
+ "WHERE {",
+ " ?s spatial:withinCircle (51.3000 -2.71000 100.0 3) .", "}");
+ expectedURIs = (new HashSet<String>());
+ expectedURIs.addAll( Arrays.asList((
+ new String[]
+ {
+ "http://example.org/data/resource/" + label + "1",
+ "http://example.org/data/resource/" + label + "2"
+ }
+ )));
+ doTestSearch(turtle, queryString, expectedURIs);
+
+ queryString = StrUtils.strjoinNL(QUERY_PROLOG, "SELECT ?s",
+ "WHERE {",
+ " ?s spatial:withinCircle (51.3000 -2.71000 100.0 'something not an integer') .", "}");
+ expectedURIs = (new HashSet<String>());
+ doTestSearch(turtle, queryString, expectedURIs);
+ }
+
+ @Test
+ public void testDistanceUnits() {
+ String label = "testDistanceUnits";
+ final String turtle = StrUtils.strjoinNL(TURTLE_PROLOG, "<"
+ + RESOURCE_BASE + label + "1>",
+ " geo:lat '51.3827'^^xsd:float ;",
+ " geo:long '-2.71909'^^xsd:float ;" , ".",
+ "<" + RESOURCE_BASE + label + "2>",
+ " geo:lat '51.3967'^^xsd:float ;",
+ " geo:long '-3.34333'^^xsd:float ;", ".",
+ "<" + RESOURCE_BASE + label + "3>",
+ " geo:lat '52.4539'^^xsd:float ;",
+ " geo:long '-1.74803'^^xsd:float ;", ".");
+ String queryString = StrUtils.strjoinNL(QUERY_PROLOG, "SELECT ?s",
+ "WHERE {",
+ " ?s spatial:withinCircle (51.3000 -2.71000 100.0 'miles') .", "}");
+ Set<String> expectedURIs = (new HashSet<String>());
+ expectedURIs.addAll( Arrays.asList((
+ new String[]
+ {
+ "http://example.org/data/resource/" + label + "1",
+ "http://example.org/data/resource/" + label + "2",
+ "http://example.org/data/resource/" + label + "3"
+ }
+ )));
+ doTestSearch(turtle, queryString, expectedURIs);
+
+ queryString = StrUtils.strjoinNL(QUERY_PROLOG, "SELECT ?s",
+ "WHERE {",
+ " ?s spatial:withinCircle (51.3000 -2.71000 100.0 'mi') .", "}");
+ expectedURIs = (new HashSet<String>());
+ expectedURIs.addAll( Arrays.asList((
+ new String[]
+ {
+ "http://example.org/data/resource/" + label + "1",
+ "http://example.org/data/resource/" + label + "2",
+ "http://example.org/data/resource/" + label + "3"
+ }
+ )));
+ doTestSearch(turtle, queryString, expectedURIs);
+
+ queryString = StrUtils.strjoinNL(QUERY_PROLOG, "SELECT ?s",
+ "WHERE {",
+ " ?s spatial:withinCircle (51.3000 -2.71000 100.0 'kilometers') .", "}");
+ expectedURIs = (new HashSet<String>());
+ expectedURIs.addAll( Arrays.asList((
+ new String[]
+ {
+ "http://example.org/data/resource/" + label + "1",
+ "http://example.org/data/resource/" + label + "2"
+ }
+ )));
+ doTestSearch(turtle, queryString, expectedURIs);
+
+ queryString = StrUtils.strjoinNL(QUERY_PROLOG, "SELECT ?s",
+ "WHERE {",
+ " ?s spatial:withinCircle (51.3000 -2.71000 100.0 'km') .", "}");
+ expectedURIs = (new HashSet<String>());
+ expectedURIs.addAll( Arrays.asList((
+ new String[]
+ {
+ "http://example.org/data/resource/" + label + "1",
+ "http://example.org/data/resource/" + label + "2"
+ }
+ )));
+ doTestSearch(turtle, queryString, expectedURIs);
+
+ queryString = StrUtils.strjoinNL(QUERY_PROLOG, "SELECT ?s",
+ "WHERE {",
+ " ?s spatial:withinCircle (51.3000 -2.71000 10000.0 'meters') .", "}");
+ expectedURIs = (new HashSet<String>());
+ expectedURIs.addAll( Arrays.asList((
+ new String[]
+ {
+ "http://example.org/data/resource/" + label + "1"
+ }
+ )));
+ doTestSearch(turtle, queryString, expectedURIs);
+ queryString = StrUtils.strjoinNL(QUERY_PROLOG, "SELECT ?s",
+ "WHERE {",
+ " ?s spatial:withinCircle (51.3000 -2.71000 10000.0 'm') .", "}");
+ expectedURIs = (new HashSet<String>());
+ expectedURIs.addAll( Arrays.asList((
+ new String[]
+ {
+ "http://example.org/data/resource/" + label + "1"
+ }
+ )));
+ doTestSearch(turtle, queryString, expectedURIs);
+
+ queryString = StrUtils.strjoinNL(QUERY_PROLOG, "SELECT ?s",
+ "WHERE {",
+ " ?s spatial:withinCircle (51.3000 -2.71000 1000000.0 'centimeters') .", "}");
+ expectedURIs = (new HashSet<String>());
+ expectedURIs.addAll( Arrays.asList((
+ new String[]
+ {
+ "http://example.org/data/resource/" + label + "1"
+ }
+ )));
+ doTestSearch(turtle, queryString, expectedURIs);
+ queryString = StrUtils.strjoinNL(QUERY_PROLOG, "SELECT ?s",
+ "WHERE {",
+ " ?s spatial:withinCircle (51.3000 -2.71000 1000000.0 'cm') .", "}");
+ expectedURIs = (new HashSet<String>());
+ expectedURIs.addAll( Arrays.asList((
+ new String[]
+ {
+ "http://example.org/data/resource/" + label + "1"
+ }
+ )));
+ doTestSearch(turtle, queryString, expectedURIs);
+
+ queryString = StrUtils.strjoinNL(QUERY_PROLOG, "SELECT ?s",
+ "WHERE {",
+ " ?s spatial:withinCircle (51.3000 -2.71000 10000000.0 'milimeters') .", "}");
+ expectedURIs = (new HashSet<String>());
+ expectedURIs.addAll( Arrays.asList((
+ new String[]
+ {
+ "http://example.org/data/resource/" + label + "1"
+ }
+ )));
+ doTestSearch(turtle, queryString, expectedURIs);
+ queryString = StrUtils.strjoinNL(QUERY_PROLOG, "SELECT ?s",
+ "WHERE {",
+ " ?s spatial:withinCircle (51.3000 -2.71000 10000000.0 'mm') .", "}");
+ expectedURIs = (new HashSet<String>());
+ expectedURIs.addAll( Arrays.asList((
+ new String[]
+ {
+ "http://example.org/data/resource/" + label + "1"
+ }
+ )));
+ doTestSearch(turtle, queryString, expectedURIs);
+
+ queryString = StrUtils.strjoinNL(QUERY_PROLOG, "SELECT ?s",
+ "WHERE {",
+ " ?s spatial:withinCircle (51.3000 -2.71000 0.09 'degrees') .", "}");
+ expectedURIs = (new HashSet<String>());
+ expectedURIs.addAll( Arrays.asList((
+ new String[]
+ {
+ "http://example.org/data/resource/" + label + "1"
+ }
+ )));
+ doTestSearch(turtle, queryString, expectedURIs);
+ queryString = StrUtils.strjoinNL(QUERY_PROLOG, "SELECT ?s",
+ "WHERE {",
+ " ?s spatial:withinCircle (51.3000 -2.71000 0.09 'de') .", "}");
+ expectedURIs = (new HashSet<String>());
+ expectedURIs.addAll( Arrays.asList((
+ new String[]
+ {
+ "http://example.org/data/resource/" + label + "1"
+ }
+ )));
+ doTestSearch(turtle, queryString, expectedURIs);
+
+
+ queryString = StrUtils.strjoinNL(QUERY_PROLOG, "SELECT ?s",
+ "WHERE {",
+ " ?s spatial:withinCircle (51.3000 -2.71000 100.0 1 'mi') .", "}");
+ expectedURIs = (new HashSet<String>());
+ doTestSearch(turtle, queryString, expectedURIs);
+
+ queryString = StrUtils.strjoinNL(QUERY_PROLOG, "SELECT ?s",
+ "WHERE {",
+ " ?s spatial:withinCircle (51.3000 -2.71000 100.0 'other unsupported unit' -1) .", "}");
+ expectedURIs = (new HashSet<String>());
+ doTestSearch(turtle, queryString, expectedURIs);
+ }
+}
Propchange: jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/AbstractTestIsWithinCirclePF.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/AbstractTestNorthPF.java
URL: http://svn.apache.org/viewvc/jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/AbstractTestNorthPF.java?rev=1519358&view=auto
==============================================================================
--- jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/AbstractTestNorthPF.java (added)
+++ jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/AbstractTestNorthPF.java Mon Sep 2 06:46:19 2013
@@ -0,0 +1,142 @@
+/*
+ * 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.query.spatial.pfunction;
+
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.apache.jena.atlas.lib.StrUtils;
+import org.apache.jena.query.spatial.AbstractTestDatasetWithSpatialIndex;
+import org.junit.Test;
+
+public abstract class AbstractTestNorthPF extends AbstractTestDatasetWithSpatialIndex {
+
+ @Test
+ public void testOneSimpleResult() {
+ final String turtle = StrUtils.strjoinNL(TURTLE_PROLOG, "<"
+ + RESOURCE_BASE + "testOneSimpleResult>",
+ " geo:lat '51.3827'^^xsd:float ;",
+ " geo:long '-2.71909'^^xsd:float ", ".");
+ String queryString = StrUtils.strjoinNL(QUERY_PROLOG, "SELECT ?s",
+ "WHERE {",
+ " ?s spatial:north (51.3000 0.0000 -1) .", "}");
+ Set<String> expectedURIs = (new HashSet<String>());
+ expectedURIs
+ .addAll(Arrays
+ .asList((new String[] { "http://example.org/data/resource/testOneSimpleResult" })));
+ doTestSearch(turtle, queryString, expectedURIs);
+ }
+
+ @Test
+ public void testMultipleResults() {
+ String label = "testMultipleResults";
+ final String turtle = StrUtils.strjoinNL(TURTLE_PROLOG, "<"
+ + RESOURCE_BASE + label + "1>",
+ " geo:lat '51.3827'^^xsd:float ;",
+ " geo:long '-2.71909'^^xsd:float ;" , ".",
+ "<" + RESOURCE_BASE + label + "2>",
+ " geo:lat '51.3967'^^xsd:float ;",
+ " geo:long '-3.34333'^^xsd:float ;", ".");
+
+ String queryString = StrUtils.strjoinNL(QUERY_PROLOG, "SELECT ?s",
+ "WHERE {",
+ " ?s spatial:north (51.3000 0.0000 -1) .", "}");
+ Set<String> expectedURIs = (new HashSet<String>());
+ expectedURIs.addAll(Arrays.asList((new String[] {
+ "http://example.org/data/resource/" + label + "1",
+ "http://example.org/data/resource/" + label + "2" })));
+ doTestSearch(turtle, queryString, expectedURIs);
+ }
+
+ @Test
+ public void testArgumentListSize() {
+ final String turtle = StrUtils.strjoinNL(TURTLE_PROLOG, "<"
+ + RESOURCE_BASE + "testArgumentListSize>",
+ " geo:lat '51.3827'^^xsd:float ;",
+ " geo:long '-2.71909'^^xsd:float ", ".");
+ String queryString = StrUtils.strjoinNL(QUERY_PROLOG, "SELECT ?s",
+ "WHERE {",
+ " ?s spatial:north (51.3000) .", "}");
+ doTestSearchThrowException(turtle, queryString);
+
+ queryString = StrUtils.strjoinNL(QUERY_PROLOG, "SELECT ?s",
+ "WHERE {",
+ " ?s spatial:north (51.3000 0.0000 -1 'another argument') .", "}");
+ doTestSearchThrowException(turtle, queryString);
+ }
+
+ @Test
+ public void testSearchLimitsResults() {
+ String label = "testSearchLimitsResults";
+ final String turtle = StrUtils.strjoinNL(TURTLE_PROLOG, "<"
+ + RESOURCE_BASE + label + "1>",
+ " geo:lat '51.3827'^^xsd:float ;",
+ " geo:long '-2.71909'^^xsd:float ;" , ".",
+ "<" + RESOURCE_BASE + label + "2>",
+ " geo:lat '51.3967'^^xsd:float ;",
+ " geo:long '-3.34333'^^xsd:float ;", ".");
+ String queryString = StrUtils.strjoinNL(QUERY_PROLOG, "SELECT ?s",
+ "WHERE {",
+ " ?s spatial:north (51.3000 0.0000 1) .", "}");
+ Set<String> expectedURIs = (new HashSet<String>());
+ expectedURIs.addAll( Arrays.asList((
+ new String[]
+ {
+ "http://example.org/data/resource/" + label + "1",
+ "http://example.org/data/resource/" + label + "2"
+ }
+ )));
+ doTestSearch(turtle, queryString, expectedURIs, 1);
+
+
+ queryString = StrUtils.strjoinNL(QUERY_PROLOG, "SELECT ?s",
+ "WHERE {",
+ " ?s spatial:north (51.3000 0.0000 -1) .", "}");
+ expectedURIs = (new HashSet<String>());
+ expectedURIs.addAll( Arrays.asList((
+ new String[]
+ {
+ "http://example.org/data/resource/" + label + "1",
+ "http://example.org/data/resource/" + label + "2"
+ }
+ )));
+ doTestSearch(turtle, queryString, expectedURIs);
+
+ queryString = StrUtils.strjoinNL(QUERY_PROLOG, "SELECT ?s",
+ "WHERE {",
+ " ?s spatial:north (51.3000 0.0000 3) .", "}");
+ expectedURIs = (new HashSet<String>());
+ expectedURIs.addAll( Arrays.asList((
+ new String[]
+ {
+ "http://example.org/data/resource/" + label + "1",
+ "http://example.org/data/resource/" + label + "2"
+ }
+ )));
+ doTestSearch(turtle, queryString, expectedURIs);
+
+ queryString = StrUtils.strjoinNL(QUERY_PROLOG, "SELECT ?s",
+ "WHERE {",
+ " ?s spatial:north (51.3000 0.0000 'something not an integer') .", "}");
+ expectedURIs = (new HashSet<String>());
+ doTestSearch(turtle, queryString, expectedURIs);
+ }
+
+}
Propchange: jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/AbstractTestNorthPF.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/AbstractTestSouthPF.java
URL: http://svn.apache.org/viewvc/jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/AbstractTestSouthPF.java?rev=1519358&view=auto
==============================================================================
--- jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/AbstractTestSouthPF.java (added)
+++ jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/AbstractTestSouthPF.java Mon Sep 2 06:46:19 2013
@@ -0,0 +1,142 @@
+/*
+ * 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.query.spatial.pfunction;
+
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.apache.jena.atlas.lib.StrUtils;
+import org.apache.jena.query.spatial.AbstractTestDatasetWithSpatialIndex;
+import org.junit.Test;
+
+public abstract class AbstractTestSouthPF extends AbstractTestDatasetWithSpatialIndex {
+
+ @Test
+ public void testOneSimpleResult() {
+ final String turtle = StrUtils.strjoinNL(TURTLE_PROLOG, "<"
+ + RESOURCE_BASE + "testOneSimpleResult>",
+ " geo:lat '51.1481'^^xsd:float ;",
+ " geo:long '-0.190278'^^xsd:float ", ".");
+ String queryString = StrUtils.strjoinNL(QUERY_PROLOG, "SELECT ?s",
+ "WHERE {",
+ " ?s spatial:south (51.3000 0.0000 -1) .", "}");
+ Set<String> expectedURIs = (new HashSet<String>());
+ expectedURIs
+ .addAll(Arrays
+ .asList((new String[] { "http://example.org/data/resource/testOneSimpleResult" })));
+ doTestSearch(turtle, queryString, expectedURIs);
+ }
+
+ @Test
+ public void testMultipleResults() {
+ String label = "testMultipleResults";
+ final String turtle = StrUtils.strjoinNL(TURTLE_PROLOG, "<"
+ + RESOURCE_BASE + label + "1>",
+ " geo:lat '51.1481'^^xsd:float ;",
+ " geo:long '-0.190278'^^xsd:float ;" , ".",
+ "<" + RESOURCE_BASE + label + "2>",
+ " geo:lat '51.0123'^^xsd:float ;",
+ " geo:long '-0.123456'^^xsd:float ;", ".");
+
+ String queryString = StrUtils.strjoinNL(QUERY_PROLOG, "SELECT ?s",
+ "WHERE {",
+ " ?s spatial:south (51.3000 0.0000 -1) .", "}");
+ Set<String> expectedURIs = (new HashSet<String>());
+ expectedURIs.addAll(Arrays.asList((new String[] {
+ "http://example.org/data/resource/" + label + "1",
+ "http://example.org/data/resource/" + label + "2" })));
+ doTestSearch(turtle, queryString, expectedURIs);
+ }
+
+ @Test
+ public void testArgumentListSize() {
+ final String turtle = StrUtils.strjoinNL(TURTLE_PROLOG, "<"
+ + RESOURCE_BASE + "testArgumentListSize>",
+ " geo:lat '51.3827'^^xsd:float ;",
+ " geo:long '-2.71909'^^xsd:float ", ".");
+ String queryString = StrUtils.strjoinNL(QUERY_PROLOG, "SELECT ?s",
+ "WHERE {",
+ " ?s spatial:south (51.3000) .", "}");
+ doTestSearchThrowException(turtle, queryString);
+
+ queryString = StrUtils.strjoinNL(QUERY_PROLOG, "SELECT ?s",
+ "WHERE {",
+ " ?s spatial:south (51.3000 0.0000 -1 'another argument') .", "}");
+ doTestSearchThrowException(turtle, queryString);
+ }
+
+ @Test
+ public void testSearchLimitsResults() {
+ String label = "testSearchLimitsResults";
+ final String turtle = StrUtils.strjoinNL(TURTLE_PROLOG, "<"
+ + RESOURCE_BASE + label + "1>",
+ " geo:lat '51.1481'^^xsd:float ;",
+ " geo:long '-0.190278'^^xsd:float ;" , ".",
+ "<" + RESOURCE_BASE + label + "2>",
+ " geo:lat '51.0123'^^xsd:float ;",
+ " geo:long '-0.123456'^^xsd:float ;", ".");
+ String queryString = StrUtils.strjoinNL(QUERY_PROLOG, "SELECT ?s",
+ "WHERE {",
+ " ?s spatial:south (51.3000 0.0000 1) .", "}");
+ Set<String> expectedURIs = (new HashSet<String>());
+ expectedURIs.addAll( Arrays.asList((
+ new String[]
+ {
+ "http://example.org/data/resource/" + label + "1",
+ "http://example.org/data/resource/" + label + "2"
+ }
+ )));
+ doTestSearch(turtle, queryString, expectedURIs, 1);
+
+
+ queryString = StrUtils.strjoinNL(QUERY_PROLOG, "SELECT ?s",
+ "WHERE {",
+ " ?s spatial:south (51.3000 0.0000 -1) .", "}");
+ expectedURIs = (new HashSet<String>());
+ expectedURIs.addAll( Arrays.asList((
+ new String[]
+ {
+ "http://example.org/data/resource/" + label + "1",
+ "http://example.org/data/resource/" + label + "2"
+ }
+ )));
+ doTestSearch(turtle, queryString, expectedURIs);
+
+ queryString = StrUtils.strjoinNL(QUERY_PROLOG, "SELECT ?s",
+ "WHERE {",
+ " ?s spatial:south (51.3000 0.0000 3) .", "}");
+ expectedURIs = (new HashSet<String>());
+ expectedURIs.addAll( Arrays.asList((
+ new String[]
+ {
+ "http://example.org/data/resource/" + label + "1",
+ "http://example.org/data/resource/" + label + "2"
+ }
+ )));
+ doTestSearch(turtle, queryString, expectedURIs);
+
+ queryString = StrUtils.strjoinNL(QUERY_PROLOG, "SELECT ?s",
+ "WHERE {",
+ " ?s spatial:south (51.3000 0.0000 'something not an integer') .", "}");
+ expectedURIs = (new HashSet<String>());
+ doTestSearch(turtle, queryString, expectedURIs);
+ }
+
+}
Propchange: jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/AbstractTestSouthPF.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/AbstractTestWestPF.java
URL: http://svn.apache.org/viewvc/jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/AbstractTestWestPF.java?rev=1519358&view=auto
==============================================================================
--- jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/AbstractTestWestPF.java (added)
+++ jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/AbstractTestWestPF.java Mon Sep 2 06:46:19 2013
@@ -0,0 +1,141 @@
+/*
+ * 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.query.spatial.pfunction;
+
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.apache.jena.atlas.lib.StrUtils;
+import org.apache.jena.query.spatial.AbstractTestDatasetWithSpatialIndex;
+import org.junit.Test;
+
+public abstract class AbstractTestWestPF extends AbstractTestDatasetWithSpatialIndex {
+
+ @Test
+ public void testOneSimpleResult() {
+ final String turtle = StrUtils.strjoinNL(TURTLE_PROLOG, "<"
+ + RESOURCE_BASE + "testOneSimpleResult>",
+ " geo:lat '51.3827'^^xsd:float ;",
+ " geo:long '-2.71909'^^xsd:float ", ".");
+ String queryString = StrUtils.strjoinNL(QUERY_PROLOG, "SELECT ?s",
+ "WHERE {",
+ " ?s spatial:west (51.3000 0.0000 -1) .", "}");
+ Set<String> expectedURIs = (new HashSet<String>());
+ expectedURIs
+ .addAll(Arrays
+ .asList((new String[] { "http://example.org/data/resource/testOneSimpleResult" })));
+ doTestSearch(turtle, queryString, expectedURIs);
+ }
+
+ @Test
+ public void testMultipleResults() {
+ String label = "testMultipleResults";
+ final String turtle = StrUtils.strjoinNL(TURTLE_PROLOG, "<"
+ + RESOURCE_BASE + label + "1>",
+ " geo:lat '51.3827'^^xsd:float ;",
+ " geo:long '-2.71909'^^xsd:float ;" , ".",
+ "<" + RESOURCE_BASE + label + "2>",
+ " geo:lat '51.3967'^^xsd:float ;",
+ " geo:long '-3.34333'^^xsd:float ;", ".");
+
+ String queryString = StrUtils.strjoinNL(QUERY_PROLOG, "SELECT ?s",
+ "WHERE {",
+ " ?s spatial:west (51.3000 0.0000 -1) .", "}");
+ Set<String> expectedURIs = (new HashSet<String>());
+ expectedURIs.addAll(Arrays.asList((new String[] {
+ "http://example.org/data/resource/" + label + "1",
+ "http://example.org/data/resource/" + label + "2" })));
+ doTestSearch(turtle, queryString, expectedURIs);
+ }
+
+ @Test
+ public void testArgumentListSize() {
+ final String turtle = StrUtils.strjoinNL(TURTLE_PROLOG, "<"
+ + RESOURCE_BASE + "testArgumentListSize>",
+ " geo:lat '51.3827'^^xsd:float ;",
+ " geo:long '-2.71909'^^xsd:float ", ".");
+ String queryString = StrUtils.strjoinNL(QUERY_PROLOG, "SELECT ?s",
+ "WHERE {",
+ " ?s spatial:west (51.3000) .", "}");
+ doTestSearchThrowException(turtle, queryString);
+
+ queryString = StrUtils.strjoinNL(QUERY_PROLOG, "SELECT ?s",
+ "WHERE {",
+ " ?s spatial:west (51.3000 0.0000 -1 'another argument') .", "}");
+ doTestSearchThrowException(turtle, queryString);
+ }
+
+ @Test
+ public void testSearchLimitsResults() {
+ String label = "testSearchLimitsResults";
+ final String turtle = StrUtils.strjoinNL(TURTLE_PROLOG, "<"
+ + RESOURCE_BASE + label + "1>",
+ " geo:lat '51.3827'^^xsd:float ;",
+ " geo:long '-2.71909'^^xsd:float ;" , ".",
+ "<" + RESOURCE_BASE + label + "2>",
+ " geo:lat '51.3967'^^xsd:float ;",
+ " geo:long '-3.34333'^^xsd:float ;", ".");
+ String queryString = StrUtils.strjoinNL(QUERY_PROLOG, "SELECT ?s",
+ "WHERE {",
+ " ?s spatial:west (51.3000 0.0000 1) .", "}");
+ Set<String> expectedURIs = (new HashSet<String>());
+ expectedURIs.addAll( Arrays.asList((
+ new String[]
+ {
+ "http://example.org/data/resource/" + label + "1",
+ "http://example.org/data/resource/" + label + "2"
+ }
+ )));
+ doTestSearch(turtle, queryString, expectedURIs, 1);
+
+
+ queryString = StrUtils.strjoinNL(QUERY_PROLOG, "SELECT ?s",
+ "WHERE {",
+ " ?s spatial:west (51.3000 0.0000 -1) .", "}");
+ expectedURIs = (new HashSet<String>());
+ expectedURIs.addAll( Arrays.asList((
+ new String[]
+ {
+ "http://example.org/data/resource/" + label + "1",
+ "http://example.org/data/resource/" + label + "2"
+ }
+ )));
+ doTestSearch(turtle, queryString, expectedURIs);
+
+ queryString = StrUtils.strjoinNL(QUERY_PROLOG, "SELECT ?s",
+ "WHERE {",
+ " ?s spatial:west (51.3000 0.0000 3) .", "}");
+ expectedURIs = (new HashSet<String>());
+ expectedURIs.addAll( Arrays.asList((
+ new String[]
+ {
+ "http://example.org/data/resource/" + label + "1",
+ "http://example.org/data/resource/" + label + "2"
+ }
+ )));
+ doTestSearch(turtle, queryString, expectedURIs);
+
+ queryString = StrUtils.strjoinNL(QUERY_PROLOG, "SELECT ?s",
+ "WHERE {",
+ " ?s spatial:west (51.3000 0.0000 'something not an integer') .", "}");
+ expectedURIs = (new HashSet<String>());
+ doTestSearch(turtle, queryString, expectedURIs);
+ }
+}
Propchange: jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/AbstractTestWestPF.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/lucene/TestEastPFWithLuceneSpatialIndex.java
URL: http://svn.apache.org/viewvc/jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/lucene/TestEastPFWithLuceneSpatialIndex.java?rev=1519358&view=auto
==============================================================================
--- jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/lucene/TestEastPFWithLuceneSpatialIndex.java (added)
+++ jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/lucene/TestEastPFWithLuceneSpatialIndex.java Mon Sep 2 06:46:19 2013
@@ -0,0 +1,47 @@
+/*
+ * 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.query.spatial.pfunction.lucene;
+
+import java.io.File;
+import java.io.IOException;
+
+import org.apache.jena.query.spatial.SpatialSearchUtil;
+import org.apache.jena.query.spatial.pfunction.AbstractTestEastPF;
+import org.junit.After;
+import org.junit.Before;
+
+/**
+ * This abstract class defines a setup configuration for a dataset with a Lucene
+ * index.
+ */
+public class TestEastPFWithLuceneSpatialIndex extends
+ AbstractTestEastPF {
+
+ @Before
+ public void init() throws IOException {
+ dataset = SpatialSearchUtil.initInMemoryDatasetWithLuceneSpatitalIndex();
+ }
+
+ @After
+ public void destroy() {
+ SpatialSearchUtil.deleteOldLuceneIndexDir();
+ }
+
+
+}
Propchange: jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/lucene/TestEastPFWithLuceneSpatialIndex.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/lucene/TestIntersectsBoxPFWithLuceneSpatialIndex.java
URL: http://svn.apache.org/viewvc/jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/lucene/TestIntersectsBoxPFWithLuceneSpatialIndex.java?rev=1519358&view=auto
==============================================================================
--- jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/lucene/TestIntersectsBoxPFWithLuceneSpatialIndex.java (added)
+++ jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/lucene/TestIntersectsBoxPFWithLuceneSpatialIndex.java Mon Sep 2 06:46:19 2013
@@ -0,0 +1,47 @@
+/*
+ * 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.query.spatial.pfunction.lucene;
+
+import java.io.File;
+import java.io.IOException;
+
+import org.apache.jena.query.spatial.SpatialSearchUtil;
+import org.apache.jena.query.spatial.pfunction.AbstractTestIntersectsBoxPF;
+import org.junit.After;
+import org.junit.Before;
+
+/**
+ * This abstract class defines a setup configuration for a dataset with a Lucene
+ * index.
+ */
+public class TestIntersectsBoxPFWithLuceneSpatialIndex extends
+ AbstractTestIntersectsBoxPF {
+
+ @Before
+ public void init() throws IOException {
+ dataset = SpatialSearchUtil.initInMemoryDatasetWithLuceneSpatitalIndex();
+ }
+
+ @After
+ public void destroy() {
+ SpatialSearchUtil.deleteOldLuceneIndexDir();
+ }
+
+
+}
Propchange: jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/lucene/TestIntersectsBoxPFWithLuceneSpatialIndex.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/lucene/TestIsNearByPFWithLuceneSpatialIndex.java
URL: http://svn.apache.org/viewvc/jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/lucene/TestIsNearByPFWithLuceneSpatialIndex.java?rev=1519358&view=auto
==============================================================================
--- jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/lucene/TestIsNearByPFWithLuceneSpatialIndex.java (added)
+++ jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/lucene/TestIsNearByPFWithLuceneSpatialIndex.java Mon Sep 2 06:46:19 2013
@@ -0,0 +1,47 @@
+/*
+ * 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.query.spatial.pfunction.lucene;
+
+import java.io.File;
+import java.io.IOException;
+
+import org.apache.jena.query.spatial.SpatialSearchUtil;
+import org.apache.jena.query.spatial.pfunction.AbstractTestIsNearByPF;
+import org.junit.After;
+import org.junit.Before;
+
+/**
+ * This abstract class defines a setup configuration for a dataset with a Lucene
+ * index.
+ */
+public class TestIsNearByPFWithLuceneSpatialIndex extends
+ AbstractTestIsNearByPF {
+
+ @Before
+ public void init() throws IOException {
+ dataset = SpatialSearchUtil.initInMemoryDatasetWithLuceneSpatitalIndex();
+ }
+
+ @After
+ public void destroy() {
+ SpatialSearchUtil.deleteOldLuceneIndexDir();
+ }
+
+
+}
Propchange: jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/lucene/TestIsNearByPFWithLuceneSpatialIndex.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/lucene/TestIsWithinBoxPFWithLuceneSpatialIndex.java
URL: http://svn.apache.org/viewvc/jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/lucene/TestIsWithinBoxPFWithLuceneSpatialIndex.java?rev=1519358&view=auto
==============================================================================
--- jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/lucene/TestIsWithinBoxPFWithLuceneSpatialIndex.java (added)
+++ jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/lucene/TestIsWithinBoxPFWithLuceneSpatialIndex.java Mon Sep 2 06:46:19 2013
@@ -0,0 +1,47 @@
+/*
+ * 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.query.spatial.pfunction.lucene;
+
+import java.io.File;
+import java.io.IOException;
+
+import org.apache.jena.query.spatial.SpatialSearchUtil;
+import org.apache.jena.query.spatial.pfunction.AbstractTestIsWithinBoxPF;
+import org.junit.After;
+import org.junit.Before;
+
+/**
+ * This abstract class defines a setup configuration for a dataset with a Lucene
+ * index.
+ */
+public class TestIsWithinBoxPFWithLuceneSpatialIndex extends
+ AbstractTestIsWithinBoxPF {
+
+ @Before
+ public void init() throws IOException {
+ dataset = SpatialSearchUtil.initInMemoryDatasetWithLuceneSpatitalIndex();
+ }
+
+ @After
+ public void destroy() {
+ SpatialSearchUtil.deleteOldLuceneIndexDir();
+ }
+
+
+}
Propchange: jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/lucene/TestIsWithinBoxPFWithLuceneSpatialIndex.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/lucene/TestIsWithinCirclePFWithLuceneSpatialIndex.java
URL: http://svn.apache.org/viewvc/jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/lucene/TestIsWithinCirclePFWithLuceneSpatialIndex.java?rev=1519358&view=auto
==============================================================================
--- jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/lucene/TestIsWithinCirclePFWithLuceneSpatialIndex.java (added)
+++ jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/lucene/TestIsWithinCirclePFWithLuceneSpatialIndex.java Mon Sep 2 06:46:19 2013
@@ -0,0 +1,47 @@
+/*
+ * 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.query.spatial.pfunction.lucene;
+
+import java.io.File;
+import java.io.IOException;
+
+import org.apache.jena.query.spatial.SpatialSearchUtil;
+import org.apache.jena.query.spatial.pfunction.AbstractTestIsWithinCirclePF;
+import org.junit.After;
+import org.junit.Before;
+
+/**
+ * This abstract class defines a setup configuration for a dataset with a Lucene
+ * index.
+ */
+public class TestIsWithinCirclePFWithLuceneSpatialIndex extends
+ AbstractTestIsWithinCirclePF {
+
+ @Before
+ public void init() throws IOException {
+ dataset = SpatialSearchUtil.initInMemoryDatasetWithLuceneSpatitalIndex();
+ }
+
+ @After
+ public void destroy() {
+ SpatialSearchUtil.deleteOldLuceneIndexDir();
+ }
+
+
+}
Propchange: jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/lucene/TestIsWithinCirclePFWithLuceneSpatialIndex.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/lucene/TestNorthPFWithLuceneSpatialIndex.java
URL: http://svn.apache.org/viewvc/jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/lucene/TestNorthPFWithLuceneSpatialIndex.java?rev=1519358&view=auto
==============================================================================
--- jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/lucene/TestNorthPFWithLuceneSpatialIndex.java (added)
+++ jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/lucene/TestNorthPFWithLuceneSpatialIndex.java Mon Sep 2 06:46:19 2013
@@ -0,0 +1,46 @@
+/*
+ * 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.query.spatial.pfunction.lucene;
+
+import java.io.IOException;
+
+import org.apache.jena.query.spatial.SpatialSearchUtil;
+import org.apache.jena.query.spatial.pfunction.AbstractTestNorthPF;
+import org.junit.After;
+import org.junit.Before;
+
+/**
+ * This abstract class defines a setup configuration for a dataset with a Lucene
+ * index.
+ */
+public class TestNorthPFWithLuceneSpatialIndex extends
+ AbstractTestNorthPF {
+
+ @Before
+ public void init() throws IOException {
+ dataset = SpatialSearchUtil.initInMemoryDatasetWithLuceneSpatitalIndex();
+ }
+
+ @After
+ public void destroy() {
+ SpatialSearchUtil.deleteOldLuceneIndexDir();
+ }
+
+
+}
Propchange: jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/lucene/TestNorthPFWithLuceneSpatialIndex.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/lucene/TestSouthPFWithLuceneSpatialIndex.java
URL: http://svn.apache.org/viewvc/jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/lucene/TestSouthPFWithLuceneSpatialIndex.java?rev=1519358&view=auto
==============================================================================
--- jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/lucene/TestSouthPFWithLuceneSpatialIndex.java (added)
+++ jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/lucene/TestSouthPFWithLuceneSpatialIndex.java Mon Sep 2 06:46:19 2013
@@ -0,0 +1,47 @@
+/*
+ * 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.query.spatial.pfunction.lucene;
+
+import java.io.File;
+import java.io.IOException;
+
+import org.apache.jena.query.spatial.SpatialSearchUtil;
+import org.apache.jena.query.spatial.pfunction.AbstractTestSouthPF;
+import org.junit.After;
+import org.junit.Before;
+
+/**
+ * This abstract class defines a setup configuration for a dataset with a Lucene
+ * index.
+ */
+public class TestSouthPFWithLuceneSpatialIndex extends
+ AbstractTestSouthPF {
+
+ @Before
+ public void init() throws IOException {
+ dataset = SpatialSearchUtil.initInMemoryDatasetWithLuceneSpatitalIndex();
+ }
+
+ @After
+ public void destroy() {
+ SpatialSearchUtil.deleteOldLuceneIndexDir();
+ }
+
+
+}
Propchange: jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/lucene/TestSouthPFWithLuceneSpatialIndex.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/lucene/TestWestPFWithLuceneSpatialIndex.java
URL: http://svn.apache.org/viewvc/jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/lucene/TestWestPFWithLuceneSpatialIndex.java?rev=1519358&view=auto
==============================================================================
--- jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/lucene/TestWestPFWithLuceneSpatialIndex.java (added)
+++ jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/lucene/TestWestPFWithLuceneSpatialIndex.java Mon Sep 2 06:46:19 2013
@@ -0,0 +1,45 @@
+/*
+ * 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.query.spatial.pfunction.lucene;
+
+import java.io.File;
+import java.io.IOException;
+
+import org.apache.jena.query.spatial.SpatialSearchUtil;
+import org.apache.jena.query.spatial.pfunction.AbstractTestWestPF;
+import org.junit.After;
+import org.junit.Before;
+
+/**
+ * This abstract class defines a setup configuration for a dataset with a Lucene
+ * index.
+ */
+public class TestWestPFWithLuceneSpatialIndex extends
+ AbstractTestWestPF {
+
+ @Before
+ public void init() throws IOException {
+ dataset = SpatialSearchUtil.initInMemoryDatasetWithLuceneSpatitalIndex();
+ }
+
+ @After
+ public void destroy() {
+ SpatialSearchUtil.deleteOldLuceneIndexDir();
+ }
+}
Propchange: jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/lucene/TestWestPFWithLuceneSpatialIndex.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/solr/TestEastPFWithEmbeddedSolrSpatialIndex.java
URL: http://svn.apache.org/viewvc/jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/solr/TestEastPFWithEmbeddedSolrSpatialIndex.java?rev=1519358&view=auto
==============================================================================
--- jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/solr/TestEastPFWithEmbeddedSolrSpatialIndex.java (added)
+++ jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/solr/TestEastPFWithEmbeddedSolrSpatialIndex.java Mon Sep 2 06:46:19 2013
@@ -0,0 +1,49 @@
+/*
+ * 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.query.spatial.pfunction.solr;
+
+import java.io.IOException;
+
+import org.apache.jena.query.spatial.SpatialIndexSolr;
+import org.apache.jena.query.spatial.SpatialQuery;
+import org.apache.jena.query.spatial.SpatialSearchUtil;
+import org.apache.jena.query.spatial.pfunction.AbstractTestEastPF;
+import org.junit.After;
+import org.junit.Before;
+
+/**
+ * This abstract class defines a setup configuration for a dataset with a Lucene
+ * index.
+ */
+public class TestEastPFWithEmbeddedSolrSpatialIndex extends
+ AbstractTestEastPF {
+
+ @Before
+ public void init() throws IOException {
+ dataset = SpatialSearchUtil.initInMemoryDatasetWithSolrSpatitalIndex();
+ }
+
+ @After
+ public void destroy() {
+ SpatialIndexSolr index = (SpatialIndexSolr) dataset.getContext().get(SpatialQuery.spatialIndex) ;
+ index.getServer().shutdown();
+ SpatialSearchUtil.deleteOldSolrDataDir();
+ }
+
+}
Propchange: jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/solr/TestEastPFWithEmbeddedSolrSpatialIndex.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/solr/TestIntersectsBoxPFWithEmbeddedSolrSpatialIndex.java
URL: http://svn.apache.org/viewvc/jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/solr/TestIntersectsBoxPFWithEmbeddedSolrSpatialIndex.java?rev=1519358&view=auto
==============================================================================
--- jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/solr/TestIntersectsBoxPFWithEmbeddedSolrSpatialIndex.java (added)
+++ jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/solr/TestIntersectsBoxPFWithEmbeddedSolrSpatialIndex.java Mon Sep 2 06:46:19 2013
@@ -0,0 +1,46 @@
+/*
+ * 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.query.spatial.pfunction.solr;
+
+import java.io.IOException;
+
+import org.apache.jena.query.spatial.SpatialIndexSolr;
+import org.apache.jena.query.spatial.SpatialQuery;
+import org.apache.jena.query.spatial.SpatialSearchUtil;
+import org.apache.jena.query.spatial.pfunction.AbstractTestIntersectsBoxPF;
+import org.junit.After;
+import org.junit.Before;
+
+
+public class TestIntersectsBoxPFWithEmbeddedSolrSpatialIndex extends
+ AbstractTestIntersectsBoxPF {
+
+ @Before
+ public void init() throws IOException {
+ dataset = SpatialSearchUtil.initInMemoryDatasetWithSolrSpatitalIndex();
+ }
+
+ @After
+ public void destroy() {
+ SpatialIndexSolr index = (SpatialIndexSolr) dataset.getContext().get(SpatialQuery.spatialIndex) ;
+ index.getServer().shutdown();
+ SpatialSearchUtil.deleteOldSolrDataDir();
+ }
+
+}
Propchange: jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/solr/TestIntersectsBoxPFWithEmbeddedSolrSpatialIndex.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/solr/TestIsNearByPFWithEmbeddedSolrSpatialIndex.java
URL: http://svn.apache.org/viewvc/jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/solr/TestIsNearByPFWithEmbeddedSolrSpatialIndex.java?rev=1519358&view=auto
==============================================================================
--- jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/solr/TestIsNearByPFWithEmbeddedSolrSpatialIndex.java (added)
+++ jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/solr/TestIsNearByPFWithEmbeddedSolrSpatialIndex.java Mon Sep 2 06:46:19 2013
@@ -0,0 +1,43 @@
+/**
+ * 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.query.spatial.pfunction.solr;
+
+import java.io.IOException;
+
+import org.apache.jena.query.spatial.SpatialIndexSolr;
+import org.apache.jena.query.spatial.SpatialQuery;
+import org.apache.jena.query.spatial.SpatialSearchUtil;
+import org.apache.jena.query.spatial.pfunction.AbstractTestIsNearByPF;
+import org.junit.After;
+import org.junit.Before;
+
+public class TestIsNearByPFWithEmbeddedSolrSpatialIndex extends AbstractTestIsNearByPF {
+
+ @Before
+ public void init() throws IOException {
+ dataset = SpatialSearchUtil.initInMemoryDatasetWithSolrSpatitalIndex();
+ }
+
+ @After
+ public void destroy() {
+ SpatialIndexSolr index = (SpatialIndexSolr) dataset.getContext().get(SpatialQuery.spatialIndex) ;
+ index.getServer().shutdown();
+ SpatialSearchUtil.deleteOldSolrDataDir();
+ }
+}
Propchange: jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/solr/TestIsNearByPFWithEmbeddedSolrSpatialIndex.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/solr/TestIsWithinBoxPFWithEmbeddedSolrSpatialIndex.java
URL: http://svn.apache.org/viewvc/jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/solr/TestIsWithinBoxPFWithEmbeddedSolrSpatialIndex.java?rev=1519358&view=auto
==============================================================================
--- jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/solr/TestIsWithinBoxPFWithEmbeddedSolrSpatialIndex.java (added)
+++ jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/solr/TestIsWithinBoxPFWithEmbeddedSolrSpatialIndex.java Mon Sep 2 06:46:19 2013
@@ -0,0 +1,50 @@
+/*
+ * 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.query.spatial.pfunction.solr;
+
+import java.io.File;
+import java.io.IOException;
+
+import org.apache.jena.query.spatial.SpatialIndexSolr;
+import org.apache.jena.query.spatial.SpatialQuery;
+import org.apache.jena.query.spatial.SpatialSearchUtil;
+import org.apache.jena.query.spatial.pfunction.AbstractTestIsWithinBoxPF;
+import org.junit.After;
+import org.junit.Before;
+
+/**
+ * This abstract class defines a setup configuration for a dataset with a Lucene
+ * index.
+ */
+public class TestIsWithinBoxPFWithEmbeddedSolrSpatialIndex extends
+ AbstractTestIsWithinBoxPF {
+
+ @Before
+ public void init() throws IOException {
+ dataset = SpatialSearchUtil.initInMemoryDatasetWithSolrSpatitalIndex();
+ }
+
+ @After
+ public void destroy() {
+ SpatialIndexSolr index = (SpatialIndexSolr) dataset.getContext().get(SpatialQuery.spatialIndex) ;
+ index.getServer().shutdown();
+ SpatialSearchUtil.deleteOldSolrDataDir();
+ }
+
+}
Propchange: jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/solr/TestIsWithinBoxPFWithEmbeddedSolrSpatialIndex.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/solr/TestIsWithinCirclePFWithEmbeddedSolrSpatialIndex.java
URL: http://svn.apache.org/viewvc/jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/solr/TestIsWithinCirclePFWithEmbeddedSolrSpatialIndex.java?rev=1519358&view=auto
==============================================================================
--- jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/solr/TestIsWithinCirclePFWithEmbeddedSolrSpatialIndex.java (added)
+++ jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/solr/TestIsWithinCirclePFWithEmbeddedSolrSpatialIndex.java Mon Sep 2 06:46:19 2013
@@ -0,0 +1,43 @@
+/**
+ * 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.query.spatial.pfunction.solr;
+
+import java.io.IOException;
+
+import org.apache.jena.query.spatial.SpatialIndexSolr;
+import org.apache.jena.query.spatial.SpatialQuery;
+import org.apache.jena.query.spatial.SpatialSearchUtil;
+import org.apache.jena.query.spatial.pfunction.AbstractTestIsWithinCirclePF;
+import org.junit.After;
+import org.junit.Before;
+
+public class TestIsWithinCirclePFWithEmbeddedSolrSpatialIndex extends AbstractTestIsWithinCirclePF {
+
+ @Before
+ public void init() throws IOException {
+ dataset = SpatialSearchUtil.initInMemoryDatasetWithSolrSpatitalIndex();
+ }
+
+ @After
+ public void destroy() {
+ SpatialIndexSolr index = (SpatialIndexSolr) dataset.getContext().get(SpatialQuery.spatialIndex) ;
+ index.getServer().shutdown();
+ SpatialSearchUtil.deleteOldSolrDataDir();
+ }
+}
Propchange: jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/solr/TestIsWithinCirclePFWithEmbeddedSolrSpatialIndex.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/solr/TestNorthPFWithEmbeddedSolrSpatialIndex.java
URL: http://svn.apache.org/viewvc/jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/solr/TestNorthPFWithEmbeddedSolrSpatialIndex.java?rev=1519358&view=auto
==============================================================================
--- jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/solr/TestNorthPFWithEmbeddedSolrSpatialIndex.java (added)
+++ jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/solr/TestNorthPFWithEmbeddedSolrSpatialIndex.java Mon Sep 2 06:46:19 2013
@@ -0,0 +1,50 @@
+/*
+ * 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.query.spatial.pfunction.solr;
+
+import java.io.File;
+import java.io.IOException;
+
+import org.apache.jena.query.spatial.SpatialIndexSolr;
+import org.apache.jena.query.spatial.SpatialQuery;
+import org.apache.jena.query.spatial.SpatialSearchUtil;
+import org.apache.jena.query.spatial.pfunction.AbstractTestNorthPF;
+import org.junit.After;
+import org.junit.Before;
+
+/**
+ * This abstract class defines a setup configuration for a dataset with a Lucene
+ * index.
+ */
+public class TestNorthPFWithEmbeddedSolrSpatialIndex extends
+ AbstractTestNorthPF {
+
+ @Before
+ public void init() throws IOException {
+ dataset = SpatialSearchUtil.initInMemoryDatasetWithSolrSpatitalIndex();
+ }
+
+ @After
+ public void destroy() {
+ SpatialIndexSolr index = (SpatialIndexSolr) dataset.getContext().get(SpatialQuery.spatialIndex) ;
+ index.getServer().shutdown();
+ SpatialSearchUtil.deleteOldSolrDataDir();
+ }
+
+}
Propchange: jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/solr/TestNorthPFWithEmbeddedSolrSpatialIndex.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/solr/TestSouthPFWithEmbeddedSolrSpatialIndex.java
URL: http://svn.apache.org/viewvc/jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/solr/TestSouthPFWithEmbeddedSolrSpatialIndex.java?rev=1519358&view=auto
==============================================================================
--- jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/solr/TestSouthPFWithEmbeddedSolrSpatialIndex.java (added)
+++ jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/solr/TestSouthPFWithEmbeddedSolrSpatialIndex.java Mon Sep 2 06:46:19 2013
@@ -0,0 +1,49 @@
+/*
+ * 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.query.spatial.pfunction.solr;
+
+import java.io.IOException;
+
+import org.apache.jena.query.spatial.SpatialIndexSolr;
+import org.apache.jena.query.spatial.SpatialQuery;
+import org.apache.jena.query.spatial.SpatialSearchUtil;
+import org.apache.jena.query.spatial.pfunction.AbstractTestSouthPF;
+import org.junit.After;
+import org.junit.Before;
+
+/**
+ * This abstract class defines a setup configuration for a dataset with a Lucene
+ * index.
+ */
+public class TestSouthPFWithEmbeddedSolrSpatialIndex extends
+ AbstractTestSouthPF {
+
+ @Before
+ public void init() throws IOException {
+ dataset = SpatialSearchUtil.initInMemoryDatasetWithSolrSpatitalIndex();
+ }
+
+ @After
+ public void destroy() {
+ SpatialIndexSolr index = (SpatialIndexSolr) dataset.getContext().get(SpatialQuery.spatialIndex) ;
+ index.getServer().shutdown();
+ SpatialSearchUtil.deleteOldSolrDataDir();
+ }
+
+}
Propchange: jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/solr/TestSouthPFWithEmbeddedSolrSpatialIndex.java
------------------------------------------------------------------------------
svn:mime-type = text/plain