Author: rwesten
Date: Thu Jun 13 09:20:10 2013
New Revision: 1492592
URL: http://svn.apache.org/r1492592
Log:
STANBOL-1104: added integration test for the new Features introduced by
STANBOL-1105 and STANBOL-1106
Modified:
stanbol/trunk/integration-tests/src/test/java/org/apache/stanbol/entityhub/it/query/DbpediaQueryTest.java
Modified:
stanbol/trunk/integration-tests/src/test/java/org/apache/stanbol/entityhub/it/query/DbpediaQueryTest.java
URL:
http://svn.apache.org/viewvc/stanbol/trunk/integration-tests/src/test/java/org/apache/stanbol/entityhub/it/query/DbpediaQueryTest.java?rev=1492592&r1=1492591&r2=1492592&view=diff
==============================================================================
---
stanbol/trunk/integration-tests/src/test/java/org/apache/stanbol/entityhub/it/query/DbpediaQueryTest.java
(original)
+++
stanbol/trunk/integration-tests/src/test/java/org/apache/stanbol/entityhub/it/query/DbpediaQueryTest.java
Thu Jun 13 09:20:10 2013
@@ -165,6 +165,7 @@ public abstract class DbpediaQueryTest e
test.setLanguage("en");
executeQuery(test);
}
+
@Test
public void testFindSpecificFieldQuery() throws IOException, JSONException
{
//TODO: there is no other text field as rdfs:label in the dbpedia
@@ -624,4 +625,33 @@ public abstract class DbpediaQueryTest e
executeQuery(test);
}
+ @Test
+ public void testBoostAndProximityRanking() throws IOException,
JSONException {
+ //test features added with STANBOL-1105, STANBOL-1106
+ FieldQueryTestCase test = new FieldQueryTestCase(
+ "{ "+
+ "'selected': ["+
+
"'http:\\/\\/www.w3.org\\/2000\\/01\\/rdf-schema#label'],"+
+ "'offset': '0',"+
+ "'limit': '3',"+
+ "'constraints': [{ "+
+ "'type': 'text', "+
+ "'text': ['Frankfurt','Main','Flughafen'], "+
+ "'language': ['de', 'en'], "+
+ "'field':
'http:\\/\\/www.w3.org\\/2000\\/01\\/rdf-schema#label', "+
+ "'boost': 12.34," +
+ "'proximityRanking': true"+
+ "}]"+
+ "}",
+ Arrays.asList( //list of expected results
+ "http://dbpedia.org/resource/Frankfurt_Airport",
+ "http://dbpedia.org/resource/Frankfurt",
+// this query selects Main instead of Airport, as Main has the same label in
German and English
+// "http://dbpedia.org/resource/Airport"),
+ "http://dbpedia.org/resource/Main"),
+ Arrays.asList( //list of required fields for results
+ "http://www.w3.org/2000/01/rdf-schema#label"));
+ //now execute the test
+ executeQuery(test);
+ }
}