Updated URLs in readme and added a request test with FCSQL.
Change-Id: If294ee17d1e75b09ddc32309a4f62e170fda6bc3
diff --git a/pom.xml b/pom.xml
index 83c7e1e..1027510 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1,80 +1,91 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
- <groupId>de.mannheim.ids</groupId>
- <artifactId>KorapSRU</artifactId>
- <version>1.0.2-SNAPSHOT</version>
- <packaging>war</packaging>
+ <groupId>de.mannheim.ids</groupId>
+ <artifactId>KorapSRU</artifactId>
+ <version>1.0.2-SNAPSHOT</version>
+ <packaging>war</packaging>
- <name>KorapSRU</name>
- <url>http://maven.apache.org</url>
+ <name>KorapSRU</name>
+ <url>http://maven.apache.org</url>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <version>3.5.1</version>
- <configuration>
- <source>1.7</source>
- <target>1.7</target>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
- <properties>
- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- </properties>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>3.5.1</version>
+ <configuration>
+ <source>1.7</source>
+ <target>1.7</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.19.1</version>
+ <configuration>
+ <excludes>
+ <exclude>de/ids_mannheim/korap/test/*.java</exclude>
+ </excludes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
- <dependencies>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.12</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>eu.clarin.sru.fcs</groupId>
- <artifactId>fcs-simple-endpoint</artifactId>
- <version>1.3.0</version>
- </dependency>
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- <version>2.5</version>
- <type>jar</type>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.httpcomponents</groupId>
- <artifactId>httpclient</artifactId>
- <version>4.3.3</version>
- </dependency>
- <dependency>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-databind</artifactId>
- <version>2.7.1</version>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-simple</artifactId>
- <version>1.7.6</version>
- </dependency>
- <dependency>
- <groupId>org.apache.directory.studio</groupId>
- <artifactId>org.apache.commons.lang</artifactId>
- <version>2.6</version>
- </dependency>
- </dependencies>
-
- <repositories>
- <repository>
- <id>CLARIN</id>
- <name>CLARIN Repository</name>
- <url>https://nexus.clarin.eu/content/repositories/Clarin</url>
- <layout>default</layout>
- </repository>
- </repositories>
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <jersey.version>1.19.4</jersey.version>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.12</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>eu.clarin.sru.fcs</groupId>
+ <artifactId>fcs-simple-endpoint</artifactId>
+ <version>1.3.0</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.5</version>
+ <type>jar</type>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.httpcomponents</groupId>
+ <artifactId>httpclient</artifactId>
+ <version>4.3.3</version>
+ </dependency>
+ <dependency>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-databind</artifactId>
+ <version>2.7.1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-simple</artifactId>
+ <version>1.7.6</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.directory.studio</groupId>
+ <artifactId>org.apache.commons.lang</artifactId>
+ <version>2.6</version>
+ </dependency>
+ </dependencies>
+
+ <repositories>
+ <repository>
+ <id>CLARIN</id>
+ <name>CLARIN Repository</name>
+ <url>https://nexus.clarin.eu/content/repositories/Clarin</url>
+ <layout>default</layout>
+ </repository>
+ </repositories>
</project>
diff --git a/readme.md b/readme.md
index e18f233..92d606c 100644
--- a/readme.md
+++ b/readme.md
@@ -16,7 +16,7 @@
### SRU explain request
gives general information about KorapSRU and some default search settings, for instance the number of records it retrieves per page. See:
-> [http://clarin.ids-mannheim.de/korapsru?operation=explain](http://clarin.ids-mannheim.de/korapsru?operation=explain)
+> [https://clarin.ids-mannheim.de/korapsru?operation=explain](http://clarin.ids-mannheim.de/korapsru?operation=explain)
To obtain more information such as supported annotation layers needed for requesting an extended search,
@@ -26,7 +26,7 @@
```
must be added as an extra request parameter. See:
-> [http://clarin.ids-mannheim.de/korapsru?operation=explain&x-fcs-endpoint-description=true](http://clarin.ids-mannheim.de/korapsru?operation=explain&x-fcs-endpoint-description=true)
+> [https://clarin.ids-mannheim.de/korapsru?operation=explain&x-fcs-endpoint-description=true](http://clarin.ids-mannheim.de/korapsru?operation=explain&x-fcs-endpoint-description=true)
### SRU search retrieve request
@@ -34,12 +34,16 @@
Examples:
* Basic search using CQL
-> [http://clarin.ids-mannheim.de/korapsru?operation=searchRetrieve&query=Buch&version=1.2](http://clarin.ids-mannheim.de/korapsru?operation=searchRetrieve&query=Buch&version=1.2)
-* Annotation search using FCSQL
-> http:<i></i>//clarin.ids-mannheim.de/korapsru?operation=searchRetrieve&query=[tt:lemma=".*bar"]&queryType=fcs
+Searching for all occurrences of term ```Buch``` (means book in German)
+> [https://clarin.ids-mannheim.de/korapsru?operation=searchRetrieve&query=Buch&version=1.2](http://clarin.ids-mannheim.de/korapsru?operation=searchRetrieve&query=Buch&version=1.2)
- Copy and paste the query to a browser. The query must not be URL-encoded.
+* Annotation search using FCSQL
+
+Searching for all lemmas from Tree tagger annotations containing ```heit```,
+in FCS query: ```[tt:lemma=".*heit"]```
+> https://clarin.ids-mannheim.de/korapsru?operation=startRetrieve&query=%5Btt%3Alemma%3D%22.*heit%22%5D&queryType=fcs
+
## Software Requirements
diff --git a/src/main/java/de/mannheim/ids/korap/sru/Annotation.java b/src/main/java/de/ids_mannheim/korap/sru/Annotation.java
similarity index 95%
rename from src/main/java/de/mannheim/ids/korap/sru/Annotation.java
rename to src/main/java/de/ids_mannheim/korap/sru/Annotation.java
index 7580ef6..7d714e5 100644
--- a/src/main/java/de/mannheim/ids/korap/sru/Annotation.java
+++ b/src/main/java/de/ids_mannheim/korap/sru/Annotation.java
@@ -1,4 +1,4 @@
-package de.mannheim.ids.korap.sru;
+package de.ids_mannheim.korap.sru;
/**
*
diff --git a/src/main/java/de/mannheim/ids/korap/sru/AnnotationHandler.java b/src/main/java/de/ids_mannheim/korap/sru/AnnotationHandler.java
similarity index 99%
rename from src/main/java/de/mannheim/ids/korap/sru/AnnotationHandler.java
rename to src/main/java/de/ids_mannheim/korap/sru/AnnotationHandler.java
index 3d23eb0..71196d1 100644
--- a/src/main/java/de/mannheim/ids/korap/sru/AnnotationHandler.java
+++ b/src/main/java/de/ids_mannheim/korap/sru/AnnotationHandler.java
@@ -1,4 +1,4 @@
-package de.mannheim.ids.korap.sru;
+package de.ids_mannheim.korap.sru;
import java.util.ArrayList;
import java.util.List;
diff --git a/src/main/java/de/mannheim/ids/korap/sru/AnnotationLayer.java b/src/main/java/de/ids_mannheim/korap/sru/AnnotationLayer.java
similarity index 97%
rename from src/main/java/de/mannheim/ids/korap/sru/AnnotationLayer.java
rename to src/main/java/de/ids_mannheim/korap/sru/AnnotationLayer.java
index 10cdf53..aedd0f9 100644
--- a/src/main/java/de/mannheim/ids/korap/sru/AnnotationLayer.java
+++ b/src/main/java/de/ids_mannheim/korap/sru/AnnotationLayer.java
@@ -1,4 +1,4 @@
-package de.mannheim.ids.korap.sru;
+package de.ids_mannheim.korap.sru;
import java.net.URI;
import java.util.HashMap;
diff --git a/src/main/java/de/mannheim/ids/korap/sru/FCSConstants.java b/src/main/java/de/ids_mannheim/korap/sru/FCSConstants.java
similarity index 96%
rename from src/main/java/de/mannheim/ids/korap/sru/FCSConstants.java
rename to src/main/java/de/ids_mannheim/korap/sru/FCSConstants.java
index d532e3f..5ba1cb0 100644
--- a/src/main/java/de/mannheim/ids/korap/sru/FCSConstants.java
+++ b/src/main/java/de/ids_mannheim/korap/sru/FCSConstants.java
@@ -1,4 +1,4 @@
-package de.mannheim.ids.korap.sru;
+package de.ids_mannheim.korap.sru;
public class FCSConstants {
diff --git a/src/main/java/de/mannheim/ids/korap/sru/KorapClient.java b/src/main/java/de/ids_mannheim/korap/sru/KorapClient.java
similarity index 98%
rename from src/main/java/de/mannheim/ids/korap/sru/KorapClient.java
rename to src/main/java/de/ids_mannheim/korap/sru/KorapClient.java
index 359c7d7..5bb1776 100644
--- a/src/main/java/de/mannheim/ids/korap/sru/KorapClient.java
+++ b/src/main/java/de/ids_mannheim/korap/sru/KorapClient.java
@@ -1,4 +1,4 @@
-package de.mannheim.ids.korap.sru;
+package de.ids_mannheim.korap.sru;
import java.io.BufferedInputStream;
import java.io.FileNotFoundException;
@@ -8,7 +8,6 @@
import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.List;
-import java.util.Properties;
import org.apache.http.HttpStatus;
import org.apache.http.NameValuePair;
@@ -38,9 +37,6 @@
public class KorapClient {
private String serviceUri;
- private static final String CONFIGURATION_FILE = "kustvakt.conf";
- private static final String SERVICE_URI_PROPERTY =
- "korapsru.client.service.uri";
private static final String DEFAULT_CONTEXT_TYPE = "sentence";
private static final String DEFAULT_FOUNDRY = "*";
diff --git a/src/main/java/de/mannheim/ids/korap/sru/KorapEndpointDescription.java b/src/main/java/de/ids_mannheim/korap/sru/KorapEndpointDescription.java
similarity index 99%
rename from src/main/java/de/mannheim/ids/korap/sru/KorapEndpointDescription.java
rename to src/main/java/de/ids_mannheim/korap/sru/KorapEndpointDescription.java
index ee6a04a..1631075 100644
--- a/src/main/java/de/mannheim/ids/korap/sru/KorapEndpointDescription.java
+++ b/src/main/java/de/ids_mannheim/korap/sru/KorapEndpointDescription.java
@@ -1,4 +1,4 @@
-package de.mannheim.ids.korap.sru;
+package de.ids_mannheim.korap.sru;
import java.io.IOException;
import java.io.InputStream;
diff --git a/src/main/java/de/mannheim/ids/korap/sru/KorapJsonQuery.java b/src/main/java/de/ids_mannheim/korap/sru/KorapJsonQuery.java
similarity index 98%
rename from src/main/java/de/mannheim/ids/korap/sru/KorapJsonQuery.java
rename to src/main/java/de/ids_mannheim/korap/sru/KorapJsonQuery.java
index 0483a12..6e87b7e 100644
--- a/src/main/java/de/mannheim/ids/korap/sru/KorapJsonQuery.java
+++ b/src/main/java/de/ids_mannheim/korap/sru/KorapJsonQuery.java
@@ -1,4 +1,4 @@
-package de.mannheim.ids.korap.sru;
+package de.ids_mannheim.korap.sru;
public class KorapJsonQuery {
diff --git a/src/main/java/de/mannheim/ids/korap/sru/KorapMatch.java b/src/main/java/de/ids_mannheim/korap/sru/KorapMatch.java
similarity index 98%
rename from src/main/java/de/mannheim/ids/korap/sru/KorapMatch.java
rename to src/main/java/de/ids_mannheim/korap/sru/KorapMatch.java
index fd0c1c1..7b3253a 100644
--- a/src/main/java/de/mannheim/ids/korap/sru/KorapMatch.java
+++ b/src/main/java/de/ids_mannheim/korap/sru/KorapMatch.java
@@ -1,4 +1,4 @@
-package de.mannheim.ids.korap.sru;
+package de.ids_mannheim.korap.sru;
import java.util.ArrayList;
import java.util.List;
diff --git a/src/main/java/de/mannheim/ids/korap/sru/KorapMatchHandler.java b/src/main/java/de/ids_mannheim/korap/sru/KorapMatchHandler.java
similarity index 97%
rename from src/main/java/de/mannheim/ids/korap/sru/KorapMatchHandler.java
rename to src/main/java/de/ids_mannheim/korap/sru/KorapMatchHandler.java
index 39df47d..6773c13 100644
--- a/src/main/java/de/mannheim/ids/korap/sru/KorapMatchHandler.java
+++ b/src/main/java/de/ids_mannheim/korap/sru/KorapMatchHandler.java
@@ -1,4 +1,4 @@
-package de.mannheim.ids.korap.sru;
+package de.ids_mannheim.korap.sru;
import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
diff --git a/src/main/java/de/mannheim/ids/korap/sru/KorapMeta.java b/src/main/java/de/ids_mannheim/korap/sru/KorapMeta.java
similarity index 90%
rename from src/main/java/de/mannheim/ids/korap/sru/KorapMeta.java
rename to src/main/java/de/ids_mannheim/korap/sru/KorapMeta.java
index 2c29d99..f762c07 100644
--- a/src/main/java/de/mannheim/ids/korap/sru/KorapMeta.java
+++ b/src/main/java/de/ids_mannheim/korap/sru/KorapMeta.java
@@ -1,4 +1,4 @@
-package de.mannheim.ids.korap.sru;
+package de.ids_mannheim.korap.sru;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
diff --git a/src/main/java/de/mannheim/ids/korap/sru/KorapResult.java b/src/main/java/de/ids_mannheim/korap/sru/KorapResult.java
similarity index 96%
rename from src/main/java/de/mannheim/ids/korap/sru/KorapResult.java
rename to src/main/java/de/ids_mannheim/korap/sru/KorapResult.java
index 95cf7f6..0991c6e 100644
--- a/src/main/java/de/mannheim/ids/korap/sru/KorapResult.java
+++ b/src/main/java/de/ids_mannheim/korap/sru/KorapResult.java
@@ -1,4 +1,4 @@
-package de.mannheim.ids.korap.sru;
+package de.ids_mannheim.korap.sru;
import java.util.ArrayList;
import java.util.List;
diff --git a/src/main/java/de/mannheim/ids/korap/sru/KorapSRU.java b/src/main/java/de/ids_mannheim/korap/sru/KorapSRU.java
similarity index 99%
rename from src/main/java/de/mannheim/ids/korap/sru/KorapSRU.java
rename to src/main/java/de/ids_mannheim/korap/sru/KorapSRU.java
index 616ddeb..42efb3a 100644
--- a/src/main/java/de/mannheim/ids/korap/sru/KorapSRU.java
+++ b/src/main/java/de/ids_mannheim/korap/sru/KorapSRU.java
@@ -1,4 +1,4 @@
-package de.mannheim.ids.korap.sru;
+package de.ids_mannheim.korap.sru;
import java.io.IOException;
import java.util.List;
diff --git a/src/main/java/de/mannheim/ids/korap/sru/KorapSRUSearchResultSet.java b/src/main/java/de/ids_mannheim/korap/sru/KorapSRUSearchResultSet.java
similarity index 99%
rename from src/main/java/de/mannheim/ids/korap/sru/KorapSRUSearchResultSet.java
rename to src/main/java/de/ids_mannheim/korap/sru/KorapSRUSearchResultSet.java
index db78ca2..c76bf6a 100644
--- a/src/main/java/de/mannheim/ids/korap/sru/KorapSRUSearchResultSet.java
+++ b/src/main/java/de/ids_mannheim/korap/sru/KorapSRUSearchResultSet.java
@@ -1,4 +1,4 @@
-package de.mannheim.ids.korap.sru;
+package de.ids_mannheim.korap.sru;
import java.io.ByteArrayInputStream;
import java.io.IOException;
diff --git a/src/main/java/de/mannheim/ids/korap/sru/QueryLanguage.java b/src/main/java/de/ids_mannheim/korap/sru/QueryLanguage.java
similarity index 77%
rename from src/main/java/de/mannheim/ids/korap/sru/QueryLanguage.java
rename to src/main/java/de/ids_mannheim/korap/sru/QueryLanguage.java
index 7bccd81..f987505 100644
--- a/src/main/java/de/mannheim/ids/korap/sru/QueryLanguage.java
+++ b/src/main/java/de/ids_mannheim/korap/sru/QueryLanguage.java
@@ -1,4 +1,4 @@
-package de.mannheim.ids.korap.sru;
+package de.ids_mannheim.korap.sru;
public enum QueryLanguage {
CQL, FCSQL;
diff --git a/src/main/resources/log4j.properties b/src/main/resources/log4j.properties
index 310893a..a8b155d 100644
--- a/src/main/resources/log4j.properties
+++ b/src/main/resources/log4j.properties
@@ -1,5 +1,5 @@
-#log4j.rootLogger = ERROR, stdout
-log4j.rootLogger = DEBUG, stdout
+log4j.rootLogger = ERROR, stdout
+#log4j.rootLogger = DEBUG, stdout
log4j.appender.stdout = org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout = org.apache.log4j.PatternLayout
diff --git a/src/test/java/de/ids_mannheim/korap/test/FCSQLRequestTest.java b/src/test/java/de/ids_mannheim/korap/test/FCSQLRequestTest.java
new file mode 100644
index 0000000..4006019
--- /dev/null
+++ b/src/test/java/de/ids_mannheim/korap/test/FCSQLRequestTest.java
@@ -0,0 +1,85 @@
+package de.ids_mannheim.korap.test;
+
+import static org.junit.Assert.assertEquals;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.apache.http.NameValuePair;
+import org.apache.http.client.methods.CloseableHttpResponse;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.client.utils.URIBuilder;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClients;
+import org.apache.http.message.BasicNameValuePair;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.w3c.dom.Document;
+import org.w3c.dom.NodeList;
+import org.xml.sax.SAXException;
+
+/**
+ * The tests in this class requires running KustvaktServer and KorAPSRU.
+ * The results are based on the sample corpus from the Goethe corpus.
+ *
+ * Specify the Kustvakt service URI at
+ * /KorapSRU/src/main/webapp/WEB-INF/web.xml
+ *
+ * @author margaretha
+ *
+ */
+public class FCSQLRequestTest {
+
+ private String korapSruUri = "http://localhost:8080/KorapSRU";
+ private static DocumentBuilder documentBuilder;
+
+ @BeforeClass
+ public static void setDocumentBuilder ()
+ throws ParserConfigurationException {
+ DocumentBuilderFactory documentBuilderFactory =
+ DocumentBuilderFactory.newInstance();
+ documentBuilderFactory.setNamespaceAware(true);
+ documentBuilder = documentBuilderFactory.newDocumentBuilder();
+ }
+
+ @Test
+ public void testFCSQuery () throws URISyntaxException, IOException,
+ SAXException, ParserConfigurationException {
+ List<NameValuePair> params = new ArrayList<NameValuePair>();
+ params.add(new BasicNameValuePair("operation", "startRetrieve"));
+ params.add(new BasicNameValuePair("query", "[tt:lemma=\".*bar\"]"));
+ params.add(new BasicNameValuePair("queryType", "fcs"));
+
+ URIBuilder builder = new URIBuilder(korapSruUri);
+ builder.addParameters(params);
+
+ URI uri = builder.build();
+ assertEquals(
+ "http://localhost:8080/KorapSRU?operation=startRetrieve&query=%5Btt%3Alemma%3D%22.*bar%22%5D&queryType=fcs",
+ uri.toString());
+
+ HttpGet request = new HttpGet(uri);
+ CloseableHttpClient client = HttpClients.createDefault();
+ CloseableHttpResponse response = null;
+ response = client.execute(request);
+
+ assertEquals(200, response.getStatusLine().getStatusCode());
+
+ InputStream is = response.getEntity().getContent();
+ Document document = documentBuilder.parse(is);
+ NodeList nodeList =
+ document.getElementsByTagName("sruResponse:numberOfRecords");
+
+ assertEquals("134", nodeList.item(0).getTextContent());
+ response.close();
+ }
+
+}
diff --git a/src/test/java/de/mannheim/ids/korap/test/KorapClientTest.java b/src/test/java/de/ids_mannheim/korap/test/KorapClientTest.java
similarity index 85%
rename from src/test/java/de/mannheim/ids/korap/test/KorapClientTest.java
rename to src/test/java/de/ids_mannheim/korap/test/KorapClientTest.java
index 93aea30..26e3311 100644
--- a/src/test/java/de/mannheim/ids/korap/test/KorapClientTest.java
+++ b/src/test/java/de/ids_mannheim/korap/test/KorapClientTest.java
@@ -1,4 +1,4 @@
-package de.mannheim.ids.korap.test;
+package de.ids_mannheim.korap.test;
import static org.junit.Assert.assertEquals;
@@ -11,20 +11,20 @@
import com.fasterxml.jackson.databind.JsonNode;
-import de.mannheim.ids.korap.sru.KorapClient;
-import de.mannheim.ids.korap.sru.KorapMatch;
-import de.mannheim.ids.korap.sru.KorapResult;
-import de.mannheim.ids.korap.sru.QueryLanguage;
+import de.ids_mannheim.korap.sru.KorapClient;
+import de.ids_mannheim.korap.sru.KorapMatch;
+import de.ids_mannheim.korap.sru.KorapResult;
+import de.ids_mannheim.korap.sru.QueryLanguage;
/**
* The tests are based on the sample corpus from the Goethe corpus.
- * Skip the tests if Kustvakt does not have this corpus in the Krill
- * index.
*
* The tests require a running KustvaktServer.
- * Specify the Kustvakt service URI in the configuration file at
- * src/main/resources/kustvakt.conf.
+ * Specify the Kustvakt service URI at
+ * /KorapSRU/src/main/webapp/WEB-INF/web.xml
+ *
+ * and in the initialization of KorapClient in the code below.
*
* @author margaretha
*
@@ -33,6 +33,10 @@
private KorapClient c;
private KorapResult result;
private KorapMatch match;
+
+ public KorapClientTest () {
+ c = new KorapClient("http://localhost:8089/api/", 25, 50);
+ }
@Test
public void testCQLQuery () throws HttpResponseException, IOException {
diff --git a/src/test/java/de/mannheim/ids/korap/test/KorapSRUTest.java b/src/test/java/de/ids_mannheim/korap/test/KorapSRUTest.java
similarity index 96%
rename from src/test/java/de/mannheim/ids/korap/test/KorapSRUTest.java
rename to src/test/java/de/ids_mannheim/korap/test/KorapSRUTest.java
index 459aabb..b5b6c1c 100644
--- a/src/test/java/de/mannheim/ids/korap/test/KorapSRUTest.java
+++ b/src/test/java/de/ids_mannheim/korap/test/KorapSRUTest.java
@@ -1,4 +1,4 @@
-package de.mannheim.ids.korap.test;
+package de.ids_mannheim.korap.test;
import static org.junit.Assert.assertEquals;
@@ -25,12 +25,10 @@
/**
* The tests are based on the sample corpus from the Goethe corpus.
- * Skip the tests if Kustvakt does not have this corpus in the Krill
- * index.
*
* The tests require a running KustvaktServer.
- * Specify the Kustvakt service URI in the configuration file at
- * src/main/resources/kustvakt.conf.
+ * Specify the Kustvakt service URI at
+ * /KorapSRU/src/main/webapp/WEB-INF/web.xml
*
* @author margaretha
*
@@ -112,7 +110,7 @@
node = node.getFirstChild();
attr = node.getAttributes().getNamedItem("id").getNodeValue();
- assertEquals("http://clarin.ids-mannheim.de/korapsru/layers/pos2", attr);
+ assertEquals("http://clarin.ids-mannheim.de/korapsru/layers/text", attr);
// assertEquals(50, node.getChildNodes().getLength());
}