Fix some tests.
Change-Id: I8ac6be23c67ee1540a1eada1a1ad3194ee131f98
diff --git a/pom.xml b/pom.xml
index 355609e..0d98b8f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -36,6 +36,7 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <jackson.version>2.9.1</jackson.version>
</properties>
<repositories>
@@ -77,17 +78,17 @@
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
- <version>2.3.3</version>
+ <version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
- <version>2.3.3</version>
+ <version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
- <version>2.3.3</version>
+ <version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
diff --git a/src/main/java/de/ids_mannheim/korap/query/serialize/Cosmas2QueryProcessor.java b/src/main/java/de/ids_mannheim/korap/query/serialize/Cosmas2QueryProcessor.java
index 622fb3b..91dad6e 100644
--- a/src/main/java/de/ids_mannheim/korap/query/serialize/Cosmas2QueryProcessor.java
+++ b/src/main/java/de/ids_mannheim/korap/query/serialize/Cosmas2QueryProcessor.java
@@ -1338,7 +1338,7 @@
posOptions.put("frames", Converter.enumListToStringList(positions));
posOptions.put("classRefCheck", classRefCheck);
if (!classRefCheck.isEmpty()) {
-// wrapOperandInClass(node, 1, 128 + classCounter++);
+ wrapOperandInClass(node, 1, 128 + classCounter++);
wrapOperandInClass(node, 2, 128 + classCounter++);
}
// if (exclnode != null) {
diff --git a/src/test/java/de/ids_mannheim/korap/query/test/annis/RelationTests.java b/src/test/java/de/ids_mannheim/korap/query/test/annis/RelationTests.java
index 669d654..11368d6 100644
--- a/src/test/java/de/ids_mannheim/korap/query/test/annis/RelationTests.java
+++ b/src/test/java/de/ids_mannheim/korap/query/test/annis/RelationTests.java
@@ -166,15 +166,15 @@
query = "corenlp/c=\"VP\" & corenlp/c=\"NP\" & #1 ->malt/d[func=\"PP\"] #2";
qs.setQuery(query, "annis");
res = mapper.readTree(qs.toJSON());
-
+
assertEquals("koral:group", res.at("/query/@type").asText());
assertEquals("operation:relation", res.at("/query/operation").asText());
assertEquals("koral:span", res.at("/query/operands/0/@type").asText());
- assertEquals("VP", res.at("/query/operands/0/key").asText());
- assertEquals("c", res.at("/query/operands/0/layer").asText());
+ assertEquals("VP", res.at("/query/operands/0/wrap/key").asText());
+ assertEquals("c", res.at("/query/operands/0/wrap/layer").asText());
assertEquals("koral:span", res.at("/query/operands/1/@type").asText());
- assertEquals("NP", res.at("/query/operands/1/key").asText());
- assertEquals("c", res.at("/query/operands/1/layer").asText());
+ assertEquals("NP", res.at("/query/operands/1/wrap/key").asText());
+ assertEquals("c", res.at("/query/operands/1/wrap/layer").asText());
assertEquals("koral:relation", res.at("/query/relType/@type").asText());
assertEquals("koral:term",
diff --git a/src/test/java/de/ids_mannheim/korap/test/cosmas2/Cosmas2QueryProcessorTest.java b/src/test/java/de/ids_mannheim/korap/test/cosmas2/Cosmas2QueryProcessorTest.java
index 2b8d809..a328033 100644
--- a/src/test/java/de/ids_mannheim/korap/test/cosmas2/Cosmas2QueryProcessorTest.java
+++ b/src/test/java/de/ids_mannheim/korap/test/cosmas2/Cosmas2QueryProcessorTest.java
@@ -708,14 +708,15 @@
query = "wegen #OV <s>";
qs.setQuery(query, "cosmas2");
res = mapper.readTree(qs.toJSON());
+ System.out.println(res);
assertEquals("koral:group", res.at("/query/@type").asText());
assertEquals("operation:class", res.at("/query/operation")
.asText());
assertEquals("classRefCheck:intersects",
res.at("/query/classRefCheck/0").asText());
// assertEquals("classRefOp:merge", res.at("/query/operands/0/classRefOp").asText());
- assertEquals(131, res.at("/query/classOut").asInt());
- assertEquals(129, res.at("/query/classIn/0").asInt());
+ assertEquals(132, res.at("/query/classOut").asInt());
+ assertEquals(131, res.at("/query/classIn/0").asInt());
assertEquals(130, res.at("/query/classIn/1").asInt());
assertEquals("koral:group", res
.at("/query/operands/0/@type").asText());
@@ -728,7 +729,7 @@
assertEquals("operation:class",
res.at("/query/operands/0/operands/0/operation")
.asText());
- assertEquals(129,
+ assertEquals(130,
res.at("/query/operands/0/operands/0/classOut")
.asInt());
assertEquals(
@@ -745,7 +746,7 @@
assertEquals("operation:class",
res.at("/query/operands/0/operands/1/operation")
.asText());
- assertEquals(130,
+ assertEquals(131,
res.at("/query/operands/0/operands/1/classOut")
.asInt());
assertEquals(
@@ -763,11 +764,11 @@
assertEquals("classRefCheck:intersects",
res.at("/query/classRefCheck/0").asText());
assertEquals("frames:alignsLeft",
- res.at("/query/operands/0/frames/1").asText());
- assertEquals("frames:overlapsLeft",
- res.at("/query/operands/0/frames/2").asText());
- assertEquals("frames:matches",
res.at("/query/operands/0/frames/0").asText());
+ assertEquals("frames:overlapsLeft",
+ res.at("/query/operands/0/frames/1").asText());
+// assertEquals("frames:matches",
+// res.at("/query/operands/0/frames/0").asText());
query = "wegen #OV(F) <s>";
qs.setQuery(query, "cosmas2");
diff --git a/src/test/java/de/ids_mannheim/korap/test/cosmas2/OPINTest.java b/src/test/java/de/ids_mannheim/korap/test/cosmas2/OPINTest.java
index b1cb4ad..9e3712c 100644
--- a/src/test/java/de/ids_mannheim/korap/test/cosmas2/OPINTest.java
+++ b/src/test/java/de/ids_mannheim/korap/test/cosmas2/OPINTest.java
@@ -29,7 +29,7 @@
query = "wegen #IN <s>";
qs.setQuery(query, "cosmas2");
res = mapper.readTree(qs.toJSON());
-// System.out.println(res);
+ System.out.println(res);
assertEquals("koral:group", res.at("/query/@type").asText());
assertEquals("operation:position", res.at("/query/operation").asText());
assertEquals(4, res.at("/query/frames").size());
diff --git a/src/test/java/de/ids_mannheim/korap/test/cosmas2/OPINWithExclusionTest.java b/src/test/java/de/ids_mannheim/korap/test/cosmas2/OPINWithExclusionTest.java
index 3c848e4..6cb5ffb 100644
--- a/src/test/java/de/ids_mannheim/korap/test/cosmas2/OPINWithExclusionTest.java
+++ b/src/test/java/de/ids_mannheim/korap/test/cosmas2/OPINWithExclusionTest.java
@@ -27,7 +27,7 @@
query = "wegen #IN(%) <s>";
qs.setQuery(query, "cosmas2");
res = mapper.readTree(qs.toJSON());
- System.out.println(res);
+// System.out.println(res);
assertEquals("koral:group", res.at("/query/@type").asText());
assertEquals("operation:exclusion",
res.at("/query/operation").asText());
@@ -72,7 +72,7 @@
query = "wegen #IN(%, L) <s>";
qs.setQuery(query, "cosmas2");
res = mapper.readTree(qs.toJSON());
-
+// System.out.println(res);
assertEquals("koral:group", res.at("/query/@type").asText());
assertEquals("operation:exclusion",
res.at("/query/operation").asText());
@@ -123,7 +123,7 @@
query = "wegen #IN(%, FE) <s>";
qs.setQuery(query, "cosmas2");
res = mapper.readTree(qs.toJSON());
- System.err.println(res.toString());
+// System.err.println(res.toString());
assertEquals("operation:class", res.at("/query/operation").asText());
assertEquals("classRefCheck:unequals",
diff --git a/src/test/java/de/ids_mannheim/korap/test/cosmas2/OPOVWithExclusionTest.java b/src/test/java/de/ids_mannheim/korap/test/cosmas2/OPOVWithExclusionTest.java
index 5a563f7..3b2bcd7 100644
--- a/src/test/java/de/ids_mannheim/korap/test/cosmas2/OPOVWithExclusionTest.java
+++ b/src/test/java/de/ids_mannheim/korap/test/cosmas2/OPOVWithExclusionTest.java
@@ -62,7 +62,7 @@
query = "wegen #OV(%, L) <s>";
qs.setQuery(query, "cosmas2");
res = mapper.readTree(qs.toJSON());
-// System.out.println(res);
+ System.out.println(res);
assertEquals("koral:group", res.at("/query/@type").asText());
assertEquals("operation:class", res.at("/query/operation").asText());
@@ -99,7 +99,7 @@
query = "wegen #OV(%, R) <s>";
qs.setQuery(query, "cosmas2");
res = mapper.readTree(qs.toJSON());
-// System.out.println(res);
+ System.out.println(res);
assertEquals("koral:group", res.at("/query/@type").asText());
assertEquals("operation:class", res.at("/query/operation").asText());