summaryrefslogtreecommitdiffstats
path: root/document/src/test
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@gmail.com>2021-12-14 18:27:52 +0100
committerJon Bratseth <bratseth@gmail.com>2021-12-14 18:27:52 +0100
commit8a085f018f881670bb6f0907c431e37f12d77492 (patch)
tree9c155e88e4c14c1b2a187e5796449315828ba337 /document/src/test
parent3a2f9ddf6b337673aeffca83b6801f9e4fa96aee (diff)
Match document types in document selections exactly only
Routing all child types to a cluster a parent is added to may be convenient for some users, but if it's not what you want it is then harder to prevent it from happening.
Diffstat (limited to 'document/src/test')
-rw-r--r--document/src/test/java/com/yahoo/document/select/DocumentSelectorTestCase.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/document/src/test/java/com/yahoo/document/select/DocumentSelectorTestCase.java b/document/src/test/java/com/yahoo/document/select/DocumentSelectorTestCase.java
index 74b603cead5..690b216e5e2 100644
--- a/document/src/test/java/com/yahoo/document/select/DocumentSelectorTestCase.java
+++ b/document/src/test/java/com/yahoo/document/select/DocumentSelectorTestCase.java
@@ -746,8 +746,14 @@ public class DocumentSelectorTestCase {
@Test
public void testInheritance() throws ParseException {
+ var s=new DocumentSelector("parent.parentField = \"parentValue\"");
List<DocumentPut> documents = createDocs();
+ assertEquals(Result.TRUE, evaluate("test", documents.get(0)));
+ assertEquals("Matching on type is exact",
+ Result.FALSE, evaluate("parent", documents.get(0)));
assertEquals(Result.TRUE, evaluate("test.parentField = \"parentValue\"", documents.get(0)));
+ assertEquals("Fields may be accessed by parent type",
+ Result.TRUE, evaluate("parent.parentField = \"parentValue\"", documents.get(0)));
}
@Test