Moved KorapNode to server/Node
diff --git a/Changes b/Changes
index f976dc9..6c63f35 100644
--- a/Changes
+++ b/Changes
@@ -1,18 +1,19 @@
0.50.1 2015-02-26
- [feature] Deserialization of arbitrary elements with attributes (margaretha)
- - [cleanup] Extract KrillMeta from Krill,
- rename KorapQuery to KrillQuery,
- extract QueryBuilder from KrillQuery,
+ - [cleanup] Extracted KrillMeta from Krill,
+ renamed KorapQuery to KrillQuery,
+ extracted QueryBuilder from KrillQuery,
renamed KorapIndexer to index/Indexer,
renamed KorapDocument to model/AbstractDocument,
renamed KorapMatch to response/Match,
renamed KorapIndex to KrillIndex,
renamed KorapCollection to KrillCollection,
- move collector classes from index to response,
+ moved collector classes from index to response,
renamed KorapDate to KrillDate,
renamed KorapArray to KrillArray,
renamed KorapByte to KrillByte,
- renamed KorapString to KrillString (diewald)
+ renamed KorapString to KrillString,
+ moved KorapNode to server/Node (diewald)
- [documentation] Improved documentation for API classes (diewald)
0.50 2015-02-23
diff --git a/src/test/java/de/ids_mannheim/korap/node/TestDatabase.java b/src/test/java/de/ids_mannheim/korap/server/TestDatabase.java
similarity index 94%
rename from src/test/java/de/ids_mannheim/korap/node/TestDatabase.java
rename to src/test/java/de/ids_mannheim/korap/server/TestDatabase.java
index 22a8b0c..e86e2c1 100644
--- a/src/test/java/de/ids_mannheim/korap/node/TestDatabase.java
+++ b/src/test/java/de/ids_mannheim/korap/server/TestDatabase.java
@@ -1,4 +1,4 @@
-package de.ids_mannheim.korap.node;
+package de.ids_mannheim.korap.server;
import de.ids_mannheim.korap.response.MatchCollector;
import de.ids_mannheim.korap.response.collector.MatchCollectorDB;
@@ -25,11 +25,11 @@
@Before
public void setUp() throws Exception {
- Class.forName("org.sqlite.JDBC");
- conn = DriverManager.getConnection("jdbc:sqlite::memory:");
- this.stat = conn.createStatement();
- stat.executeUpdate("CREATE TABLE IF NOT EXISTS people (name TEXT, age INTEGER);");
- conn.setAutoCommit(false);
+ Class.forName("org.sqlite.JDBC");
+ conn = DriverManager.getConnection("jdbc:sqlite::memory:");
+ this.stat = conn.createStatement();
+ stat.executeUpdate("CREATE TABLE IF NOT EXISTS people (name TEXT, age INTEGER);");
+ conn.setAutoCommit(false);
};
@Test
diff --git a/src/test/java/de/ids_mannheim/korap/node/TestResource.java b/src/test/java/de/ids_mannheim/korap/server/TestResource.java
similarity index 77%
rename from src/test/java/de/ids_mannheim/korap/node/TestResource.java
rename to src/test/java/de/ids_mannheim/korap/server/TestResource.java
index 3b2db54..a4aeaae 100644
--- a/src/test/java/de/ids_mannheim/korap/node/TestResource.java
+++ b/src/test/java/de/ids_mannheim/korap/server/TestResource.java
@@ -1,4 +1,4 @@
-package de.ids_mannheim.korap.node;
+package de.ids_mannheim.korap.server;
import java.io.*;
import java.util.ArrayList;
@@ -19,7 +19,7 @@
import java.io.FileInputStream;
-import de.ids_mannheim.korap.KorapNode;
+import de.ids_mannheim.korap.server.Node;
import de.ids_mannheim.korap.KorapResult;
import de.ids_mannheim.korap.response.KorapResponse;
import static de.ids_mannheim.korap.util.KrillString.*;
@@ -36,7 +36,7 @@
@Before
public void setUp () throws Exception {
// start the server
- server = KorapNode.startServer("milena", (String) null);
+ server = Node.startServer("milena", (String) null);
// create the client
Client c = ClientBuilder.newClient();
@@ -55,7 +55,7 @@
clientConfig.getFeatures().put(JSONConfiguration.FEATURE_POJO_MAPPING, Boolean.TRUE);
Client c = Client.create(clientConfig);
*/
- target = c.target(KorapNode.BASE_URI);
+ target = c.target(Node.BASE_URI);
};
@After
@@ -91,14 +91,19 @@
Entity jsonE = Entity.json(json);
- kresp = target.path("/index/" + i).
- request("application/json").
- put(jsonE, KorapResponse.class);
+ try {
+ kresp = target.path("/index/" + i).
+ request("application/json").
+ put(jsonE, KorapResponse.class);
- assertEquals(kresp.getNode(), "milena");
- assertFalse(kresp.hasErrors());
- assertFalse(kresp.hasWarnings());
- assertFalse(kresp.hasMessages());
+ assertEquals(kresp.getNode(), "milena");
+ assertFalse(kresp.hasErrors());
+ assertFalse(kresp.hasWarnings());
+ assertFalse(kresp.hasMessages());
+ }
+ catch (Exception e) {
+ fail("Server response failed " + e.getMessage() + " (Known issue)");
+ }
};
kresp = target.path("/index").
@@ -117,17 +122,23 @@
getClass().getResource("/queries/bsp-uid-example.jsonld").getFile()
);
- KorapResponse kresp
- = target.path("/").
- queryParam("uid", "1").
- queryParam("uid", "4").
- request("application/json").
- post(Entity.json(json), KorapResponse.class);
+ try {
+ KorapResponse kresp
+ = target.path("/").
+ queryParam("uid", "1").
+ queryParam("uid", "4").
+ request("application/json").
+ post(Entity.json(json), KorapResponse.class);
- assertEquals(2, kresp.getTotalResults());
- assertFalse(kresp.hasErrors());
- assertFalse(kresp.hasWarnings());
- assertFalse(kresp.hasMessages());
+ assertEquals(2, kresp.getTotalResults());
+ assertFalse(kresp.hasErrors());
+ assertFalse(kresp.hasWarnings());
+ assertFalse(kresp.hasMessages());
+ }
+ catch (Exception e) {
+ fail("Server response failed: " + e.getMessage() + " (Known issue)");
+ };
+
};
public static String getString (String path) {