diff options
author | Geir Storli <geirst@oath.com> | 2018-02-08 14:43:48 +0100 |
---|---|---|
committer | Geir Storli <geirst@oath.com> | 2018-02-13 10:23:09 +0000 |
commit | 929f50928b8a3aedaaf04e25de823a660c16a6e6 (patch) | |
tree | 51ffa6ebaed790b79f1a627f8163bf6fcbd277b0 /document/src/tests | |
parent | 0152a705361a3597374ac0482c7e475d1a68787c (diff) |
Route document removes only to the recipient(s) handling the document type (as given in the document id).
For legacy document ids (without document type) we still use all the routes.
Diffstat (limited to 'document/src/tests')
-rw-r--r-- | document/src/tests/documentselectparsertest.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/document/src/tests/documentselectparsertest.cpp b/document/src/tests/documentselectparsertest.cpp index db7b48cdc3a..410ac539ff4 100644 --- a/document/src/tests/documentselectparsertest.cpp +++ b/document/src/tests/documentselectparsertest.cpp @@ -37,6 +37,7 @@ class DocumentSelectParserTest : public CppUnit::TestFixture { CPPUNIT_TEST(testThatComplexFieldValuesHaveCorrectFieldNames); CPPUNIT_TEST(testBodyFieldDetection); CPPUNIT_TEST(testDocumentUpdates); + CPPUNIT_TEST(testDocumentIdsInRemoves); CPPUNIT_TEST(test_syntax_error_reporting); CPPUNIT_TEST(test_operator_precedence); CPPUNIT_TEST(test_token_used_as_ident_preserves_casing); @@ -102,6 +103,7 @@ public: void testDocumentUpdates2(); void testDocumentUpdates3(); void testDocumentUpdates4(); + void testDocumentIdsInRemoves(); void test_syntax_error_reporting(); void test_operator_precedence(); void test_token_used_as_ident_preserves_casing(); @@ -1238,6 +1240,19 @@ void DocumentSelectParserTest::testDocumentUpdates4() PARSEI("-6 % 10 = -6", *_update[0], True); } +void DocumentSelectParserTest::testDocumentIdsInRemoves() +{ + PARSE("testdoctype1", DocumentId("id:ns:testdoctype1::1"), True); + PARSE("testdoctype1", DocumentId("id:ns:null::1"), False); + PARSE("testdoctype1", DocumentId("userdoc:testdoctype1:1234:1"), False); + PARSE("testdoctype1.headerval", DocumentId("id:ns:testdoctype1::1"), Invalid); + // FIXME: Should ideally be False. As long as there always is an AND node with doctype in a selection expression + // we won't end up sending removes using the wrong route. + PARSE("testdoctype1.headerval", DocumentId("id:ns:null::1"), Invalid); + PARSE("testdoctype1.headerval == 0", DocumentId("id:ns:testdoctype1::1"), Invalid); + PARSE("testdoctype1 and testdoctype1.headerval == 0", DocumentId("id:ns:testdoctype1::1"), Invalid); +} + void DocumentSelectParserTest::testUtf8() { createDocs(); |