aboutsummaryrefslogtreecommitdiffstats
path: root/document/src/tests
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2019-08-21 09:14:35 +0200
committerGitHub <noreply@github.com>2019-08-21 09:14:35 +0200
commit991249b70460b61f3b73b53387dbc20357aedaa1 (patch)
tree7862378237365b2d0abbf51965f0620f165db0c9 /document/src/tests
parentcb00b309ed537867e36e97dd2c9801c01d84489b (diff)
Revert "Revert "doc: -> id:""
Diffstat (limited to 'document/src/tests')
-rw-r--r--document/src/tests/base/documentid_test.cpp14
-rw-r--r--document/src/tests/buckettest.cpp34
-rw-r--r--document/src/tests/cpp-globalidbucketids.txt23
-rw-r--r--document/src/tests/data/document-cpp-currentversion-lz4-9.datbin332 -> 313 bytes
-rw-r--r--document/src/tests/data/document-cpp-currentversion-uncompressed.datbin332 -> 333 bytes
-rw-r--r--document/src/tests/data/document-cpp-v7-uncompressed.datbin354 -> 0 bytes
-rw-r--r--document/src/tests/data/document-cpp-v8-uncompressed.datbin346 -> 333 bytes
-rw-r--r--document/src/tests/data/serialize-fieldpathupdate-cpp.datbin160 -> 163 bytes
-rw-r--r--document/src/tests/data/serialize-fieldpathupdate-java.datbin160 -> 163 bytes
-rw-r--r--document/src/tests/data/serializejava-compressed.datbin384 -> 380 bytes
-rw-r--r--document/src/tests/data/serializejava.datbin405 -> 406 bytes
-rw-r--r--document/src/tests/data/serializejavawithannotations.datbin471 -> 475 bytes
-rw-r--r--document/src/tests/data/serializeupdatecpp.datbin201 -> 213 bytes
-rw-r--r--document/src/tests/data/serializeupdatejava.datbin112 -> 124 bytes
-rw-r--r--document/src/tests/data/serializev6.datbin391 -> 0 bytes
-rw-r--r--document/src/tests/documentcalculatortestcase.cpp20
-rw-r--r--document/src/tests/documentidtest.cpp40
-rw-r--r--document/src/tests/documentselectparsertest.cpp62
-rw-r--r--document/src/tests/documenttestcase.cpp104
-rw-r--r--document/src/tests/documenttypetestcase.cpp2
-rw-r--r--document/src/tests/documentupdatetestcase.cpp24
-rw-r--r--document/src/tests/fieldpathupdatetestcase.cpp150
-rw-r--r--document/src/tests/fieldsettest.cpp6
-rw-r--r--document/src/tests/fieldvalue/referencefieldvalue_test.cpp15
-rw-r--r--document/src/tests/globalidtest.cpp8
-rw-r--r--document/src/tests/serialization/vespadocumentserializer_test.cpp50
-rw-r--r--document/src/tests/struct_anno/document.datbin223 -> 231 bytes
-rw-r--r--document/src/tests/testxml.cpp12
-rw-r--r--[-rwxr-xr-x]document/src/tests/vespaxml/fieldpathupdates.xml2
-rw-r--r--document/src/tests/vespaxml/test1.expected.xml5
-rw-r--r--document/src/tests/vespaxml/test1.xml9
-rw-r--r--document/src/tests/vespaxml/test10.xml9
-rw-r--r--document/src/tests/vespaxml/test11.xml8
-rw-r--r--document/src/tests/vespaxml/test12.xml9
-rw-r--r--document/src/tests/vespaxml/test13.xml7
-rw-r--r--document/src/tests/vespaxml/test14.xml8
-rw-r--r--document/src/tests/vespaxml/test15.xml8
-rw-r--r--document/src/tests/vespaxml/test16.xml8
-rw-r--r--document/src/tests/vespaxml/test17.xml9
-rw-r--r--document/src/tests/vespaxml/test18.xml9
-rw-r--r--document/src/tests/vespaxml/test2.expected.xml5
-rw-r--r--document/src/tests/vespaxml/test2.xml7
-rw-r--r--document/src/tests/vespaxml/test20.xml8
-rw-r--r--document/src/tests/vespaxml/test21.xml9
-rw-r--r--document/src/tests/vespaxml/test22.xml9
-rw-r--r--document/src/tests/vespaxml/test23.xml9
-rw-r--r--document/src/tests/vespaxml/test24.xml9
-rw-r--r--document/src/tests/vespaxml/test25.xml9
-rw-r--r--document/src/tests/vespaxml/test26.xml9
-rw-r--r--document/src/tests/vespaxml/test27.xml9
-rw-r--r--document/src/tests/vespaxml/test28.xml10
-rw-r--r--document/src/tests/vespaxml/test29.xml18
-rw-r--r--document/src/tests/vespaxml/test3.xml9
-rw-r--r--document/src/tests/vespaxml/test30.xml15
-rw-r--r--document/src/tests/vespaxml/test32.xml7
-rw-r--r--document/src/tests/vespaxml/test33.xml9
-rw-r--r--document/src/tests/vespaxml/test34.xml7
-rw-r--r--document/src/tests/vespaxml/test35.xml9
-rw-r--r--document/src/tests/vespaxml/test36.xml43
-rw-r--r--document/src/tests/vespaxml/test37.xml23
-rw-r--r--document/src/tests/vespaxml/test4.xml23
-rw-r--r--document/src/tests/vespaxml/test40.xml6
-rw-r--r--document/src/tests/vespaxml/test41.xml22
-rw-r--r--document/src/tests/vespaxml/test42.xml22
-rw-r--r--document/src/tests/vespaxml/test43.xml32
-rw-r--r--document/src/tests/vespaxml/test45.xml6
-rw-r--r--document/src/tests/vespaxml/test46.xml10
-rw-r--r--document/src/tests/vespaxml/test47.xml10
-rw-r--r--document/src/tests/vespaxml/test48.xml6
-rw-r--r--document/src/tests/vespaxml/test49.xml8
-rw-r--r--document/src/tests/vespaxml/test5.expected.xml3
-rw-r--r--document/src/tests/vespaxml/test5.xml6
-rw-r--r--document/src/tests/vespaxml/test50.xml8
-rw-r--r--document/src/tests/vespaxml/test51.xml6
-rw-r--r--document/src/tests/vespaxml/test52.xml10
-rw-r--r--document/src/tests/vespaxml/test53.xml11
-rw-r--r--document/src/tests/vespaxml/test54.xml10
-rw-r--r--document/src/tests/vespaxml/test55.xml11
-rw-r--r--document/src/tests/vespaxml/test56.xml8
-rw-r--r--document/src/tests/vespaxml/test57.xml8
-rw-r--r--document/src/tests/vespaxml/test58.xml15
-rw-r--r--document/src/tests/vespaxml/test59.xml7
-rw-r--r--document/src/tests/vespaxml/test6.xml7
-rw-r--r--document/src/tests/vespaxml/test7.xml9
-rw-r--r--document/src/tests/vespaxml/test8.xml9
-rw-r--r--document/src/tests/vespaxml/test9.xml7
-rw-r--r--document/src/tests/vespaxml/test_arraystruct.xml19
-rw-r--r--document/src/tests/vespaxml/test_doc5.xml8
-rw-r--r--document/src/tests/vespaxml/test_doc6.xml6
-rw-r--r--document/src/tests/vespaxml/test_doc8.xml9
-rw-r--r--document/src/tests/vespaxml/test_externalentity.xml11
-rw-r--r--document/src/tests/vespaxml/test_idprefix.xml13
-rw-r--r--document/src/tests/vespaxml/test_struct.xml9
-rw-r--r--document/src/tests/vespaxml/test_update1.xml12
94 files changed, 234 insertions, 1021 deletions
diff --git a/document/src/tests/base/documentid_test.cpp b/document/src/tests/base/documentid_test.cpp
index 9994fa5b60b..741a490210f 100644
--- a/document/src/tests/base/documentid_test.cpp
+++ b/document/src/tests/base/documentid_test.cpp
@@ -42,11 +42,6 @@ void checkType(const string &id, const string &doc_type) {
EXPECT_EQUAL(doc_type, doc_id.getDocType());
}
-TEST("require that doc id can be parsed") {
- const string id = "doc:" + ns + ":" + ns_id;
- checkId(id, IdString::DOC, ns, ns_id);
-}
-
TEST("require that id id can be parsed") {
const string id = "id:" + ns + ":" + type + "::" + ns_id;
checkId(id, IdString::ID, ns, ns_id);
@@ -58,10 +53,6 @@ TEST("require that we allow ':' in namespace specific part") {
string id="id:" + ns + ":" + type + "::" + nss;
checkId(id, IdString::ID, ns, nss);
checkType(id, type);
-
- id="doc:" + ns + ":" + nss;
- checkId(id, IdString::DOC, ns, nss);
-
}
TEST("require that id id can specify location") {
@@ -157,11 +148,6 @@ TEST("require that id strings reports features (hasNumber, hasGroup)") {
EXPECT_FALSE(none.getScheme().hasGroup());
EXPECT_EQUAL("foo", none.getScheme().getNamespaceSpecific());
- none = DocumentId("doc:ns:foo");
- EXPECT_FALSE(none.getScheme().hasNumber());
- EXPECT_FALSE(none.getScheme().hasGroup());
- EXPECT_EQUAL("foo", none.getScheme().getNamespaceSpecific());
-
DocumentId user("id:ns:type:n=42:foo");
EXPECT_TRUE(user.getScheme().hasNumber());
EXPECT_FALSE(user.getScheme().hasGroup());
diff --git a/document/src/tests/buckettest.cpp b/document/src/tests/buckettest.cpp
index 72e0a38c749..763575ece4c 100644
--- a/document/src/tests/buckettest.cpp
+++ b/document/src/tests/buckettest.cpp
@@ -79,9 +79,10 @@ TEST(BucketTest, testGetBit)
TEST(BucketTest, testBucketGeneration)
{
BucketIdFactory factory;
- DocumentId doc1("doc:ns:spec");
- DocumentId doc2("doc:ns2:spec");
- DocumentId doc3("doc:ns:spec2");
+ DocumentId doc1("id:ns:type::1");
+ DocumentId doc2("id:ns2:type::1");
+ DocumentId doc3("id:ns:type2::1");
+ DocumentId doc4("id:ns:type::2");
DocumentId userDoc1("id:ns:mytype:n=18:spec");
DocumentId userDoc2("id:ns2:mytype:n=18:spec2");
DocumentId userDoc3("id:ns:mytype:n=19:spec");
@@ -89,9 +90,10 @@ TEST(BucketTest, testBucketGeneration)
DocumentId groupDoc2("id:ns2:mytype:g=yahoo.com:spec2");
DocumentId groupDoc3("id:ns:mytype:g=yahoo:spec");
- BucketId docBucket1(factory.getBucketId(doc1));
- BucketId docBucket2(factory.getBucketId(doc2));
- BucketId docBucket3(factory.getBucketId(doc3));
+ BucketId docBucket1 = factory.getBucketId(doc1);
+ BucketId docBucket2 = factory.getBucketId(doc2);
+ BucketId docBucket3 = factory.getBucketId(doc3);
+ BucketId docBucket4 = factory.getBucketId(doc4);
BucketId userDocBucket1(factory.getBucketId(userDoc1));
BucketId userDocBucket2(factory.getBucketId(userDoc2));
BucketId userDocBucket3(factory.getBucketId(userDoc3));
@@ -121,28 +123,30 @@ TEST(BucketTest, testBucketGeneration)
groupDocBucket3.setUsedBits(16);
EXPECT_EQ(Hex(0x4000000000001f24ull), Hex(groupDocBucket3.getId()));
- EXPECT_EQ(Hex(0xe980c9abd5fd8d11ull), Hex(docBucket1.getRawId()));
- EXPECT_EQ(Hex(0xeafe870c5f9c37b9ull), Hex(docBucket2.getRawId()));
- EXPECT_EQ(Hex(0xeaebe9473ecbcd69ull), Hex(docBucket3.getRawId()));
+ EXPECT_EQ(Hex(0xe9362c053842cac4ull), Hex(docBucket1.getRawId()));
+ EXPECT_EQ(Hex(0xe960b5773842cac4ull), Hex(docBucket2.getRawId()));
+ EXPECT_EQ(Hex(0xe8daaf763842cac4ull), Hex(docBucket3.getRawId()));
+ EXPECT_EQ(Hex(0xeb5016ab8d721ec8ull), Hex(docBucket4.getRawId()));
docBucket1.setUsedBits(16);
- EXPECT_EQ(Hex(0x4000000000008d11ull), Hex(docBucket1.getId()));
+ EXPECT_EQ(Hex(0x400000000000cac4ull), Hex(docBucket1.getId()));
docBucket2.setUsedBits(16);
- EXPECT_EQ(Hex(0x40000000000037b9ull), Hex(docBucket2.getId()));
+ EXPECT_EQ(Hex(0x400000000000cac4ull), Hex(docBucket2.getId()));
docBucket3.setUsedBits(16);
- EXPECT_EQ(Hex(0x400000000000cd69ull), Hex(docBucket3.getId()));
+ EXPECT_EQ(Hex(0x400000000000cac4ull), Hex(docBucket3.getId()));
+ docBucket4.setUsedBits(16);
+ EXPECT_EQ(Hex(0x4000000000001ec8ull), Hex(docBucket4.getId()));
}
TEST(BucketTest, testBucketSerialization)
{
BucketIdFactory factory;
- DocumentId doc(DocIdString("ns", "spec"));
+ DocumentId doc("id:ns:test::1");
BucketId bucket(factory.getBucketId(doc));
std::ostringstream ost;
ost << bucket.getRawId();
- EXPECT_EQ(std::string("16825669947722927377"),
- ost.str());
+ EXPECT_EQ(std::string("16910189189155441348"), ost.str());
BucketId::Type id;
std::istringstream ist(ost.str());
diff --git a/document/src/tests/cpp-globalidbucketids.txt b/document/src/tests/cpp-globalidbucketids.txt
index 40bb505ad16..0798f88faf8 100644
--- a/document/src/tests/cpp-globalidbucketids.txt
+++ b/document/src/tests/cpp-globalidbucketids.txt
@@ -1,26 +1,3 @@
-doc:ns:specific - gid(0x2c01a21163cb7d0ce85fddd6) - BucketId(0xeadd5fe811a2012c)
-doc:another:specific - gid(0xcd2ba528d1135e40605ce372) - BucketId(0xeae35c6028a52bcd)
-doc:ns:another - gid(0x1d5324270601e76a7a1f58b7) - BucketId(0xeb581f7a2724531d)
-doc:ns:0 - gid(0x87817cf2f6d05976505e74be) - BucketId(0xea745e50f27c8187)
-doc:ns:1 - gid(0x911a03b253cb5b1c283b2024) - BucketId(0xe8203b28b2031a91)
-doc:ns:2 - gid(0x1d82e56be428cda364ed6875) - BucketId(0xe968ed646be5821d)
-doc:ns:3 - gid(0xf8d223e4e68e0d571b95a6d8) - BucketId(0xe8a6951be423d2f8)
-doc:ns:4 - gid(0xdab024c2e41747dc92a1b8e3) - BucketId(0xebb8a192c224b0da)
-doc:ns:5 - gid(0xdb9023e3080c94901734f948) - BucketId(0xe8f93417e32390db)
-doc:ns:6 - gid(0xbd84ae30c63f7fdef9edbf69) - BucketId(0xe9bfedf930ae84bd)
-doc:ns:7 - gid(0x463977cf070d06e204b8166f) - BucketId(0xeb16b804cf773946)
-doc:ns:8 - gid(0x46cf1241cec694a0c07af5e2) - BucketId(0xeaf57ac04112cf46)
-doc:ns:9 - gid(0x909b77593ef7b309a06d22ef) - BucketId(0xeb226da059779b90)
-doc:ns:10 - gid(0x4888f0b3796031003a8840fb) - BucketId(0xeb40883ab3f08848)
-doc:ns:11 - gid(0x18fae4cbc359765470c10fcd) - BucketId(0xe90fc170cbe4fa18)
-doc:ns:12 - gid(0xc902059d4ac551616aea5431) - BucketId(0xe954ea6a9d0502c9)
-doc:ns:13 - gid(0x639b6aa505018e29ca4e342d) - BucketId(0xe9344ecaa56a9b63)
-doc:ns:14 - gid(0x5fa1f02be952a9d0811e8ddd) - BucketId(0xe98d1e812bf0a15f)
-doc:ns:15 - gid(0xfbc851f81830365c84229c49) - BucketId(0xe99c2284f851c8fb)
-doc:ns:16 - gid(0x06313edc8072f4495329fb5b) - BucketId(0xebfb2953dc3e3106)
-doc:ns:17 - gid(0x3d9df3e147de3a5fbd5664e4) - BucketId(0xe86456bde1f39d3d)
-doc:ns:18 - gid(0x75512f41a8dbde1c8f86a97d) - BucketId(0xe9a9868f412f5175)
-doc:ns:19 - gid(0x15ae3aa9919b2e1e46d84ada) - BucketId(0xea4ad846a93aae15)
id:ns:type::specific - gid(0x2067d966823ebdfb79537da1) - BucketId(0xe97d537966d96720)
id:another:type::specific - gid(0x2067d9664809eb39a3b72218) - BucketId(0xe822b7a366d96720)
id:ns:type::another - gid(0xb32d73e53e034c30c58a01ff) - BucketId(0xeb018ac5e5732db3)
diff --git a/document/src/tests/data/document-cpp-currentversion-lz4-9.dat b/document/src/tests/data/document-cpp-currentversion-lz4-9.dat
index 5f31ac0ab78..7b0650996db 100644
--- a/document/src/tests/data/document-cpp-currentversion-lz4-9.dat
+++ b/document/src/tests/data/document-cpp-currentversion-lz4-9.dat
Binary files differ
diff --git a/document/src/tests/data/document-cpp-currentversion-uncompressed.dat b/document/src/tests/data/document-cpp-currentversion-uncompressed.dat
index 6a5c5e90b84..2b39c42f8a4 100644
--- a/document/src/tests/data/document-cpp-currentversion-uncompressed.dat
+++ b/document/src/tests/data/document-cpp-currentversion-uncompressed.dat
Binary files differ
diff --git a/document/src/tests/data/document-cpp-v7-uncompressed.dat b/document/src/tests/data/document-cpp-v7-uncompressed.dat
deleted file mode 100644
index 5f073e33438..00000000000
--- a/document/src/tests/data/document-cpp-v7-uncompressed.dat
+++ /dev/null
Binary files differ
diff --git a/document/src/tests/data/document-cpp-v8-uncompressed.dat b/document/src/tests/data/document-cpp-v8-uncompressed.dat
index 429334fc102..2b39c42f8a4 100644
--- a/document/src/tests/data/document-cpp-v8-uncompressed.dat
+++ b/document/src/tests/data/document-cpp-v8-uncompressed.dat
Binary files differ
diff --git a/document/src/tests/data/serialize-fieldpathupdate-cpp.dat b/document/src/tests/data/serialize-fieldpathupdate-cpp.dat
index cf5f20f7a0c..025882da825 100644
--- a/document/src/tests/data/serialize-fieldpathupdate-cpp.dat
+++ b/document/src/tests/data/serialize-fieldpathupdate-cpp.dat
Binary files differ
diff --git a/document/src/tests/data/serialize-fieldpathupdate-java.dat b/document/src/tests/data/serialize-fieldpathupdate-java.dat
index cf5f20f7a0c..025882da825 100644
--- a/document/src/tests/data/serialize-fieldpathupdate-java.dat
+++ b/document/src/tests/data/serialize-fieldpathupdate-java.dat
Binary files differ
diff --git a/document/src/tests/data/serializejava-compressed.dat b/document/src/tests/data/serializejava-compressed.dat
index 0f6cb55ff85..0ac391422ff 100644
--- a/document/src/tests/data/serializejava-compressed.dat
+++ b/document/src/tests/data/serializejava-compressed.dat
Binary files differ
diff --git a/document/src/tests/data/serializejava.dat b/document/src/tests/data/serializejava.dat
index 53ef6a8fbc2..10873c9d905 100644
--- a/document/src/tests/data/serializejava.dat
+++ b/document/src/tests/data/serializejava.dat
Binary files differ
diff --git a/document/src/tests/data/serializejavawithannotations.dat b/document/src/tests/data/serializejavawithannotations.dat
index a648b72404f..fe683d1580e 100644
--- a/document/src/tests/data/serializejavawithannotations.dat
+++ b/document/src/tests/data/serializejavawithannotations.dat
Binary files differ
diff --git a/document/src/tests/data/serializeupdatecpp.dat b/document/src/tests/data/serializeupdatecpp.dat
index 73d83b2ab45..f972b505fb4 100644
--- a/document/src/tests/data/serializeupdatecpp.dat
+++ b/document/src/tests/data/serializeupdatecpp.dat
Binary files differ
diff --git a/document/src/tests/data/serializeupdatejava.dat b/document/src/tests/data/serializeupdatejava.dat
index 20c56228bde..cef1ad96812 100644
--- a/document/src/tests/data/serializeupdatejava.dat
+++ b/document/src/tests/data/serializeupdatejava.dat
Binary files differ
diff --git a/document/src/tests/data/serializev6.dat b/document/src/tests/data/serializev6.dat
deleted file mode 100644
index 555acb9ecc7..00000000000
--- a/document/src/tests/data/serializev6.dat
+++ /dev/null
Binary files differ
diff --git a/document/src/tests/documentcalculatortestcase.cpp b/document/src/tests/documentcalculatortestcase.cpp
index 744a7556f1b..b6ca27f6bc7 100644
--- a/document/src/tests/documentcalculatortestcase.cpp
+++ b/document/src/tests/documentcalculatortestcase.cpp
@@ -24,7 +24,7 @@ TEST_F(DocumentCalculatorTest, testConstant) {
auto variables = std::make_unique<select::VariableMap>();
DocumentCalculator calc(getRepo(), "4.0");
- Document doc(*_testRepo.getDocumentType("testdoctype1"), DocumentId("doc:test:foo"));
+ Document doc(*_testRepo.getDocumentType("testdoctype1"), DocumentId("id:ns:testdoctype1::foo"));
EXPECT_EQ(4.0, calc.evaluate(doc, std::move(variables)));
}
@@ -32,7 +32,7 @@ TEST_F(DocumentCalculatorTest, testSimple) {
auto variables = std::make_unique<select::VariableMap>();
DocumentCalculator calc(getRepo(), "(3 + 5) / 2");
- Document doc(*_testRepo.getDocumentType("testdoctype1"), DocumentId("doc:test:foo"));
+ Document doc(*_testRepo.getDocumentType("testdoctype1"), DocumentId("id:ns:testdoctype1::foo"));
EXPECT_EQ(4.0, calc.evaluate(doc, std::move(variables)));
}
@@ -42,7 +42,7 @@ TEST_F(DocumentCalculatorTest, testVariables) {
(*variables)["y"] = 5.0;
DocumentCalculator calc(getRepo(), "($x + $y) / 2");
- Document doc(*_testRepo.getDocumentType("testdoctype1"), DocumentId("doc:test:foo"));
+ Document doc(*_testRepo.getDocumentType("testdoctype1"), DocumentId("id:ns:testdoctype1::foo"));
EXPECT_EQ(4.0, calc.evaluate(doc, std::move(variables)));
}
@@ -53,7 +53,7 @@ TEST_F(DocumentCalculatorTest, testFields) {
DocumentCalculator calc(getRepo(), "(testdoctype1.headerval + testdoctype1"
".hfloatval) / testdoctype1.headerlongval");
- Document doc(*_testRepo.getDocumentType("testdoctype1"), DocumentId("doc:test:foo"));
+ Document doc(*_testRepo.getDocumentType("testdoctype1"), DocumentId("id:ns:testdoctype1::foo"));
doc.setValue(doc.getField("headerval"), IntFieldValue(5));
doc.setValue(doc.getField("hfloatval"), FloatFieldValue(3.0));
doc.setValue(doc.getField("headerlongval"), LongFieldValue(2));
@@ -67,7 +67,7 @@ TEST_F(DocumentCalculatorTest, testFieldsDivZero) {
DocumentCalculator calc(getRepo(), "(testdoctype1.headerval + testdoctype1"
".hfloatval) / testdoctype1.headerlongval");
- Document doc(*_testRepo.getDocumentType("testdoctype1"), DocumentId("doc:test:foo"));
+ Document doc(*_testRepo.getDocumentType("testdoctype1"), DocumentId("id:ns:testdoctype1::foo"));
doc.setValue(doc.getField("headerval"), IntFieldValue(5));
doc.setValue(doc.getField("hfloatval"), FloatFieldValue(3.0));
doc.setValue(doc.getField("headerlongval"), LongFieldValue(0));
@@ -79,7 +79,7 @@ TEST_F(DocumentCalculatorTest, testDivideByZero) {
auto variables = std::make_unique<select::VariableMap>();
DocumentCalculator calc(getRepo(), "(3 + 5) / 0");
- Document doc(*_testRepo.getDocumentType("testdoctype1"), DocumentId("doc:test:foo"));
+ Document doc(*_testRepo.getDocumentType("testdoctype1"), DocumentId("id:ns:testdoctype1::foo"));
EXPECT_THROW(calc.evaluate(doc, std::move(variables)),
vespalib::IllegalArgumentException);
}
@@ -88,7 +88,7 @@ TEST_F(DocumentCalculatorTest, testModByZero) {
auto variables = std::make_unique<select::VariableMap>();
DocumentCalculator calc(getRepo(), "(3 + 5) % 0");
- Document doc(*_testRepo.getDocumentType("testdoctype1"), DocumentId("doc:test:foo"));
+ Document doc(*_testRepo.getDocumentType("testdoctype1"), DocumentId("id:ns:testdoctype1::foo"));
EXPECT_THROW(calc.evaluate(doc, std::move(variables)),
vespalib::IllegalArgumentException);
}
@@ -98,7 +98,7 @@ TEST_F(DocumentCalculatorTest, testFieldNotSet) {
DocumentCalculator calc(getRepo(), "(testdoctype1.headerval + testdoctype1"
".hfloatval) / testdoctype1.headerlongval");
- Document doc(*_testRepo.getDocumentType("testdoctype1"), DocumentId("doc:test:foo"));
+ Document doc(*_testRepo.getDocumentType("testdoctype1"), DocumentId("id:ns:testdoctype1::foo"));
doc.setValue(doc.getField("hfloatval"), FloatFieldValue(3.0));
doc.setValue(doc.getField("headerlongval"), LongFieldValue(2));
EXPECT_THROW(calc.evaluate(doc, std::move(variables)),
@@ -111,7 +111,7 @@ TEST_F(DocumentCalculatorTest, testFieldNotFound) {
"(testdoctype1.mynotfoundfield + testdoctype1"
".hfloatval) / testdoctype1.headerlongval");
- Document doc(*_testRepo.getDocumentType("testdoctype1"), DocumentId("doc:test:foo"));
+ Document doc(*_testRepo.getDocumentType("testdoctype1"), DocumentId("id:ns:testdoctype1::foo"));
doc.setValue(doc.getField("hfloatval"), FloatFieldValue(3.0));
doc.setValue(doc.getField("headerlongval"), LongFieldValue(2));
EXPECT_THROW(calc.evaluate(doc, std::move(variables)),
@@ -122,7 +122,7 @@ TEST_F(DocumentCalculatorTest, testByteSubtractionZeroResult) {
auto variables = std::make_unique<select::VariableMap>();
DocumentCalculator calc(getRepo(), "testdoctype1.byteval - 3");
- Document doc(*_testRepo.getDocumentType("testdoctype1"), DocumentId("doc:test:foo"));
+ Document doc(*_testRepo.getDocumentType("testdoctype1"), DocumentId("id:ns:testdoctype1::foo"));
doc.setValue(doc.getField("byteval"), ByteFieldValue(3));
EXPECT_EQ(0.0, calc.evaluate(doc, std::move(variables)));
}
diff --git a/document/src/tests/documentidtest.cpp b/document/src/tests/documentidtest.cpp
index 9befac431f6..a6255cc148a 100644
--- a/document/src/tests/documentidtest.cpp
+++ b/document/src/tests/documentidtest.cpp
@@ -23,14 +23,6 @@ TEST(DocumentIdTest, generateJavaComplianceFile)
{ // Generate file with globalids and bucket ID of various document ids,
// which java will use to ensure equal implementations.
std::ostringstream ost;
- writeGlobalIdBucketId(ost, "doc:ns:specific");
- writeGlobalIdBucketId(ost, "doc:another:specific");
- writeGlobalIdBucketId(ost, "doc:ns:another");
- for (uint32_t i=0; i<20; ++i) {
- std::ostringstream ost2;
- ost2 << i;
- writeGlobalIdBucketId(ost, "doc:ns:"+ost2.str());
- }
writeGlobalIdBucketId(ost, "id:ns:type::specific");
writeGlobalIdBucketId(ost, "id:another:type::specific");
writeGlobalIdBucketId(ost, "id:ns:type::another");
@@ -51,17 +43,16 @@ TEST(DocumentIdTest, generateJavaComplianceFile)
TEST(DocumentIdTest, testOutput)
{
- DocumentId id(DocIdString("crawler", "http://www.yahoo.com"));
+ DocumentId id("id:ns:news::crawler:http://www.yahoo.com");
std::ostringstream ost;
ost << id;
- std::string expected("doc:crawler:http://www.yahoo.com");
+ std::string expected("id:ns:news::crawler:http://www.yahoo.com");
EXPECT_EQ(expected, ost.str());
EXPECT_EQ(vespalib::string(expected), id.toString());
- expected = "DocumentId(id = doc:crawler:http://www.yahoo.com, "
- "gid(0x928baffb39cf32004542fb60))";
+ expected = "DocumentId(id = id:ns:news::crawler:http://www.yahoo.com, gid(0xa516a5abd7c7fa26944b72f7))";
EXPECT_EQ(expected, static_cast<Printable&>(id).toString(true));
}
@@ -77,11 +68,11 @@ namespace {
TEST(DocumentIdTest, testEqualityOperator)
{
- std::string uri(DocIdString("crawler", "http://www.yahoo.com").toString());
+ std::string uri("id:ns:news::crawler:http://www.yahoo.com");
DocumentId id1(uri);
DocumentId id2(uri);
- DocumentId id3("doc:crawler:http://www.yahoo.no/");
+ DocumentId id3("id:ns:news::crawler:http://www.yahoo.no/");
EXPECT_EQ(id1, id2);
EXPECT_NE(id1, id3);
@@ -89,11 +80,11 @@ TEST(DocumentIdTest, testEqualityOperator)
TEST(DocumentIdTest, testCopying)
{
- std::string uri(DocIdString("crawler", "http://www.yahoo.com/").toString());
+ std::string uri("id:crawler:news::http://www.yahoo.com");
DocumentId id1(uri);
DocumentId id2(id1);
- DocumentId id3("doc:ns:foo");
+ DocumentId id3("id:ns:foo::");
id3 = id2;
EXPECT_EQ(id1, id2);
@@ -102,21 +93,8 @@ TEST(DocumentIdTest, testCopying)
TEST(DocumentIdTest, checkNtnuGlobalId)
{
- DocumentId id("doc:crawler:http://www.ntnu.no/");
- EXPECT_EQ(vespalib::string("gid(0xb8863740be14221c0ac77896)"), id.getGlobalId().toString());
-}
-
-TEST(DocumentIdTest, testDocGlobalId)
-{
- // Test that location of doc scheme documents are set correctly, such
- // that the location is the first bytes of the original GID.
- std::string id("doc:crawler:http://www.ntnu.no/");
- DocumentId did(id);
-
- unsigned char key[16];
- fastc_md5sum(reinterpret_cast<const unsigned char*>(id.c_str()), id.size(), key);
-
- EXPECT_EQ(GlobalId(key), did.getGlobalId());
+ DocumentId id("id:ns:news::crawler:http://www.ntnu.no/");
+ EXPECT_EQ(vespalib::string("gid(0x1e9d7fc69ac6c1da44dd87e0)"), id.getGlobalId().toString());
}
TEST(DocumentIdTest, freestandingLocationFromGroupNameFuncMatchesIdLocation)
diff --git a/document/src/tests/documentselectparsertest.cpp b/document/src/tests/documentselectparsertest.cpp
index 97921109c60..79b849c5ba9 100644
--- a/document/src/tests/documentselectparsertest.cpp
+++ b/document/src/tests/documentselectparsertest.cpp
@@ -132,10 +132,8 @@ void
DocumentSelectParserTest::createDocs()
{
_doc.clear();
- _doc.push_back(createDoc(
- "testdoctype1", "doc:myspace:anything", 24, 2.0, "foo", "bar", 0)); // DOC 0
- _doc.push_back(createDoc(
- "testdoctype1", "doc:anotherspace:foo", 13, 4.1, "bar", "foo", 0)); // DOC 1
+ _doc.push_back(createDoc("testdoctype1", "id:myspace:testdoctype1::anything", 24, 2.0, "foo", "bar", 0)); // DOC 0
+ _doc.push_back(createDoc("testdoctype1", "id:anotherspace:testdoctype1::foo", 13, 4.1, "bar", "foo", 0)); // DOC 1
// Add some arrays and structs to doc 1
{
StructFieldValue sval(_doc.back()->getField("mystruct").getDataType());
@@ -208,10 +206,8 @@ DocumentSelectParserTest::createDocs()
_doc.back()->getField("structarray").getDataType());
_doc.back()->setValue("structarray", aval);
}
- _doc.push_back(createDoc(
- "testdoctype1", "id:myspace:testdoctype1:g=yahoo:bar", 14, 2.4, "Yet", "\xE4\xB8\xBA\xE4\xBB\x80", 0)); // DOC 3
- _doc.push_back(createDoc(
- "testdoctype2", "doc:myspace:inheriteddoc", 10, 1.4, "inherited", "")); // DOC 4
+ _doc.push_back(createDoc("testdoctype1", "id:myspace:testdoctype1:g=yahoo:bar", 14, 2.4, "Yet", "\xE4\xB8\xBA\xE4\xBB\x80", 0)); // DOC 3
+ _doc.push_back(createDoc("testdoctype2", "id:myspace:testdoctype2::inheriteddoc", 10, 1.4, "inherited", "")); // DOC 4
_doc.push_back(createDoc(
"testdoctype1", "id:footype:testdoctype1:n=123456789:aardvark",
10, 1.4, "inherited", "", 0)); // DOC 5
@@ -222,7 +218,7 @@ DocumentSelectParserTest::createDocs()
"testdoctype1", "id:footype:testdoctype1:n=1234:highlong",
10, 1.4, "inherited", "", -2651257743)); // DOC 7
_doc.push_back(createDoc( // DOC 8. As DOC 0 but with version 2.
- "testdoctype1", "doc:myspace:anything", 24, 2.0, "foo", "bar", 0));
+ "testdoctype1", "id:myspace:testdoctype1::anything", 24, 2.0, "foo", "bar", 0));
_doc.push_back(createDoc(
"testdoctype1", "id:footype:testdoctype1:n=12345:foo",
10, 1.4, "inherited", "", 42)); // DOC 9
@@ -231,16 +227,11 @@ DocumentSelectParserTest::createDocs()
10, 1.4, "inherited", "", 42)); // DOC 10
_update.clear();
- _update.push_back(createUpdate(
- "testdoctype1", "doc:myspace:anything", 20, "hmm"));
- _update.push_back(createUpdate(
- "testdoctype1", "doc:anotherspace:foo", 10, "foo"));
- _update.push_back(createUpdate(
- "testdoctype1", "id:myspace:testdoctype1:n=1234:footype1", 0, "foo"));
- _update.push_back(createUpdate(
- "testdoctype1", "id:myspace:testdoctype1:g=yahoo:bar", 3, "\xE4\xBA\xB8\xE4\xBB\x80"));
- _update.push_back(createUpdate(
- "testdoctype2", "doc:myspace:inheriteddoc", 10, "bar"));
+ _update.push_back(createUpdate("testdoctype1", "id:myspace:testdoctype1::anything", 20, "hmm"));
+ _update.push_back(createUpdate("testdoctype1", "id:anotherspace:testdoctype1::foo", 10, "foo"));
+ _update.push_back(createUpdate("testdoctype1", "id:myspace:testdoctype1:n=1234:footype1", 0, "foo"));
+ _update.push_back(createUpdate("testdoctype1", "id:myspace:testdoctype1:g=yahoo:bar", 3, "\xE4\xBA\xB8\xE4\xBB\x80"));
+ _update.push_back(createUpdate("testdoctype2", "id:myspace:testdoctype2::inheriteddoc", 10, "bar"));
}
namespace {
@@ -622,14 +613,14 @@ void DocumentSelectParserTest::testOperators2()
createDocs();
// Id values
- PARSEI("id == \"doc:myspace:anything\"", *_doc[0], True);
- PARSEI(" iD== \"doc:myspace:anything\" ", *_doc[0], True);
- PARSEI("id == \"doc:myspa:nything\"", *_doc[0], False);
- PARSEI("Id.scHeme == \"doc\"", *_doc[0], True);
- PARSEI("id.scheme == \"id\"", *_doc[0], False);
+ PARSEI("id == \"id:myspace:testdoctype1::anything\"", *_doc[0], True);
+ PARSEI(" iD== \"id:myspace:testdoctype1::anything\" ", *_doc[0], True);
+ PARSEI("id == \"id:myspa:testdoctype1::nything\"", *_doc[0], False);
+ PARSEI("Id.scHeme == \"doc\"", *_doc[0], False);
+ PARSEI("id.scheme == \"id\"", *_doc[0], True);
PARSEI("id.type == \"testdoctype1\"", *_doc[9], True);
PARSEI("id.type == \"wrong_type\"", *_doc[9], False);
- PARSEI("id.type == \"unknown\"", *_doc[0], Invalid);
+ PARSEI("id.type == \"unknown\"", *_doc[0], False);
PARSEI("Id.namespaCe == \"myspace\"", *_doc[0], True);
PARSEI("id.NaMespace == \"pace\"", *_doc[0], False);
PARSEI("id.specific == \"anything\"", *_doc[0], True);
@@ -647,17 +638,17 @@ void DocumentSelectParserTest::testOperators3()
createDocs();
{
std::ostringstream ost;
- ost << "id.bucket == " << BucketId(16, 4006).getId() ;
+ ost << "id.bucket == " << BucketId(16, 0xe1f0).getId() ;
PARSEI(ost.str(), *_doc[0], True);
}
{
std::ostringstream ost;
- ost << "id.bucket == " << BucketId(17, 4006).getId() ;
+ ost << "id.bucket == " << BucketId(18, 0xe1f0).getId() ;
PARSEI(ost.str(), *_doc[0], False);
}
{
std::ostringstream ost;
- ost << "id.bucket == " << BucketId(17, 69542).getId() ;
+ ost << "id.bucket == " << BucketId(18, 0x2e1f0).getId() ;
PARSEI(ost.str(), *_doc[0], True);
}
{
@@ -1108,11 +1099,11 @@ void DocumentSelectParserTest::testDocumentUpdates2()
createDocs();
// Id values
- PARSEI("id == \"doc:myspace:anything\"", *_update[0], True);
- PARSEI(" iD== \"doc:myspace:anything\" ", *_update[0], True);
- PARSEI("id == \"doc:myspa:nything\"", *_update[0], False);
- PARSEI("Id.scHeme == \"doc\"", *_update[0], True);
- PARSEI("id.scheme == \"id\"", *_update[0], False);
+ PARSEI("id == \"id:myspace:testdoctype1::anything\"", *_update[0], True);
+ PARSEI(" iD== \"id:myspace:testdoctype1::anything\" ", *_update[0], True);
+ PARSEI("id == \"id:myspa:testdoctype1::nything\"", *_update[0], False);
+ PARSEI("Id.scHeme == \"doc\"", *_update[0], False);
+ PARSEI("id.scheme == \"id\"", *_update[0], True);
PARSEI("Id.namespaCe == \"myspace\"", *_update[0], True);
PARSEI("id.NaMespace == \"pace\"", *_update[0], False);
PARSEI("id.specific == \"anything\"", *_update[0], True);
@@ -1123,7 +1114,7 @@ void DocumentSelectParserTest::testDocumentUpdates2()
PARSEI("id.bucket == 1234", *_update[0], False);
{
std::ostringstream ost;
- ost << "id.bucket == " << BucketId(16, 4006).getId();
+ ost << "id.bucket == " << BucketId(16, 0xe1f0).getId();
PARSEI(ost.str(), *_update[0], True);
}
PARSEI("id.bucket == \"foo\"", *_update[0], Invalid);
@@ -1201,8 +1192,7 @@ TEST_F(DocumentSelectParserTest, testUtf8)
// boost::u32regex rx = boost::make_u32regex("H.kon");
// EXPECT_EQ(true, boost::u32regex_match(utf8name, rx));
- _doc.push_back(createDoc(
- "testdoctype1", "doc:myspace:utf8doc", 24, 2.0, utf8name, "bar"));
+ _doc.push_back(createDoc("testdoctype1", "id:myspace:testdoctype1::utf8doc", 24, 2.0, utf8name, "bar"));
// PARSE("testdoctype1.hstringval = \"H?kon\"", *_doc[_doc.size()-1], True);
// PARSE("testdoctype1.hstringval =~ \"H.kon\"", *_doc[_doc.size()-1], True);
}
diff --git a/document/src/tests/documenttestcase.cpp b/document/src/tests/documenttestcase.cpp
index 089ab5a2a2d..fa59358f6d3 100644
--- a/document/src/tests/documenttestcase.cpp
+++ b/document/src/tests/documenttestcase.cpp
@@ -112,7 +112,7 @@ TEST(DocumentTest, testTraversing)
type.addField(primitive1);
type.addField(structl1s1);
- Document doc(type, DocumentId("doc::testdoc"));
+ Document doc(type, DocumentId("id:ns:test::1"));
doc.setValue(primitive1, IntFieldValue(1));
StructFieldValue l1s1(struct3);
@@ -184,7 +184,7 @@ TEST(DocumentTest, testVariables)
iiiaV.add(iiaV);
}
- Document doc(type, DocumentId("doc::testdoc"));
+ Document doc(type, DocumentId("id:ns:test::1"));
doc.setValue(iiiarrF, iiiaV);
{
@@ -291,7 +291,7 @@ TEST(DocumentTest, testModifyDocument)
type.addField(primitive1);
type.addField(structl1s1);
- Document::UP doc(new Document(type, DocumentId("doc::testdoc")));
+ Document::UP doc(new Document(type, DocumentId("id:ns:test::1")));
doc->setValue(primitive1, IntFieldValue(1));
StructFieldValue l1s1(struct3);
@@ -364,7 +364,7 @@ TEST(DocumentTest, testSimpleUsage)
type->addField(strF);
DocumentTypeRepo repo(*type);
- Document value(*repo.getDocumentType("test"), DocumentId("doc::testdoc"));
+ Document value(*repo.getDocumentType("test"), DocumentId("id:ns:test::1"));
// Initially empty
EXPECT_EQ(size_t(0), value.getSetFieldCount());
@@ -393,7 +393,7 @@ TEST(DocumentTest, testSimpleUsage)
value2.deserialize(repo, *buffer);
EXPECT_TRUE(value2.hasValue(intF));
EXPECT_EQ(value, value2);
- EXPECT_EQ(DocumentId("doc::testdoc"), value2.getId());
+ EXPECT_EQ(DocumentId("id:ns:test::1"), value2.getId());
// Various ways of removing
{
@@ -446,11 +446,11 @@ TEST(DocumentTest, testSimpleUsage)
// Output
EXPECT_EQ(
- std::string("Document(doc::testdoc, DocumentType(test))"),
+ std::string("Document(id:ns:test::1, DocumentType(test))"),
value.toString(false));
EXPECT_EQ(
std::string(
-" Document(doc::testdoc\n"
+" Document(id:ns:test::1\n"
" DocumentType(test, id -877171244)\n"
" : DocumentType(document) {\n"
" StructDataType(test.header, id 306916075) {\n"
@@ -465,7 +465,7 @@ TEST(DocumentTest, testSimpleUsage)
" " + value.toString(true, " "));
EXPECT_EQ(
std::string(
- "<document documenttype=\"test\" documentid=\"doc::testdoc\">\n"
+ "<document documenttype=\"test\" documentid=\"id:ns:test::1\">\n"
" <int>1</int>\n"
" <long>2</long>\n"
"</document>"),
@@ -483,11 +483,10 @@ TEST(DocumentTest, testSimpleUsage)
// Refuse to accept non-document types
try{
StructDataType otherType("foo", 4);
- Document value6(otherType, DocumentId("doc::"));
+ Document value6(otherType, DocumentId("id:ns:foo::1"));
FAIL() << "Didn't complain about non-document type";
} catch (std::exception& e) {
- EXPECT_THAT(e.what(), HasSubstr("Cannot generate a document with "
- "non-document type"));
+ EXPECT_THAT(e.what(), HasSubstr("Cannot generate a document with non-document type"));
}
// Refuse to set wrong types
@@ -563,7 +562,7 @@ TEST(DocumentTest, testReadSerializedFile)
ByteBuffer buf(len);
lseek(fd,0,SEEK_SET);
if (read(fd, buf.getBuffer(), len) != (ssize_t)len) {
- throw vespalib::Exception("read failed");
+ throw vespalib::Exception("read failed");
}
close(fd);
@@ -597,7 +596,7 @@ TEST(DocumentTest, testReadSerializedFileCompressed)
ByteBuffer buf(len);
lseek(fd,0,SEEK_SET);
if (read(fd, buf.getBuffer(), len) != len) {
- throw vespalib::Exception("read failed");
+ throw vespalib::Exception("read failed");
}
close(fd);
@@ -645,6 +644,7 @@ namespace {
* When adding new fields to the documents, use the version tagged with each
* file to ignore these field for old types.
*/
+
TEST(DocumentTest,testReadSerializedAllVersions)
{
const int array_id = 1650586661;
@@ -679,8 +679,7 @@ TEST(DocumentTest,testReadSerializedAllVersions)
// Create a memory instance of document
{
- Document doc(*docType,
- DocumentId("doc:serializetest:http://test.doc.id/"));
+ Document doc(*docType, DocumentId("id:ns:serializetest::http://test.doc.id/"));
doc.set("intfield", 5);
doc.set("floatfield", -9.23);
doc.set("stringfield", "This is a string.");
@@ -688,8 +687,7 @@ TEST(DocumentTest,testReadSerializedAllVersions)
doc.set("doublefield", 98374532.398820);
doc.set("bytefield", -2);
doc.setValue("rawfield", RawFieldValue("RAW DATA", 8));
- Document docInDoc(*docInDocType,
- DocumentId("doc:serializetest:http://doc.in.doc/"));
+ Document docInDoc(*docInDocType, DocumentId("id:ns:docindoc::http://doc.in.doc/"));
docInDoc.set("stringindocfield", "Elvis is dead");
//docInDoc.setCompression(CompressionConfig(CompressionConfig::NONE, 0, 0));
doc.setValue("docfield", docInDoc);
@@ -735,7 +733,6 @@ TEST(DocumentTest,testReadSerializedAllVersions)
std::vector<TestDoc> tests;
tests.push_back(TestDoc(TEST_PATH("data/document-cpp-v8-uncompressed.dat"), 8));
- tests.push_back(TestDoc(TEST_PATH("data/document-cpp-v7-uncompressed.dat"), 7));
tests.push_back(TestDoc(jpath + "document-java-v8-uncompressed.dat", 8));
for (uint32_t i=0; i<tests.size(); ++i) {
int version = tests[i]._createdVersion;
@@ -749,7 +746,7 @@ TEST(DocumentTest,testReadSerializedAllVersions)
ByteBuffer buf(len);
lseek(fd,0,SEEK_SET);
if (read(fd, buf.getBuffer(), len) != len) {
- throw vespalib::Exception("read failed");
+ throw vespalib::Exception("read failed");
}
close(fd);
@@ -833,9 +830,7 @@ TEST(DocumentTest, testGenerateSerializedFile)
{
const std::string file_name = TEST_PATH("data/crossplatform-java-cpp-doctypes.cfg");
DocumentTypeRepo repo(readDocumenttypesConfig(file_name));
- Document doc(*repo.getDocumentType("serializetest"),
- DocumentId(DocIdString("serializetest",
- "http://test.doc.id/")));
+ Document doc(*repo.getDocumentType("serializetest"), DocumentId("id:ns:serializetest::http://test.doc.id/"));
doc.set("intfield", 5);
doc.set("floatfield", -9.23);
@@ -848,8 +843,7 @@ TEST(DocumentTest, testGenerateSerializedFile)
const DocumentType *docindoc_type = repo.getDocumentType("docindoc");
EXPECT_TRUE(docindoc_type);
- Document embedDoc(*docindoc_type,
- DocumentId(DocIdString("docindoc", "http://embedded")));
+ Document embedDoc(*docindoc_type, DocumentId("id:ns:docindoc::http://embedded"));
doc.setValue("docfield", embedDoc);
@@ -874,7 +868,7 @@ TEST(DocumentTest, testGenerateSerializedFile)
int fd = open((serializedDir + "/serializecpp.dat").c_str(),
O_WRONLY | O_TRUNC | O_CREAT, 0644);
if (write(fd, buf->getBuffer(), buf->getPos()) != (ssize_t)buf->getPos()) {
- throw vespalib::Exception("write failed");
+ throw vespalib::Exception("write failed");
}
close(fd);
@@ -883,16 +877,16 @@ TEST(DocumentTest, testGenerateSerializedFile)
fd = open((serializedDir + "/serializecppsplit_header.dat").c_str(),
O_WRONLY | O_TRUNC | O_CREAT, 0644);
if (write(fd, hBuf.getBuffer(), hBuf.getPos()) != (ssize_t)hBuf.getPos()) {
- throw vespalib::Exception("write failed");
+ throw vespalib::Exception("write failed");
}
close(fd);
ByteBuffer bBuf(getSerializedSizeBody(doc));
doc.serializeBody(bBuf);
- fd = open(TEST_PATH("/serializecppsplit_body.dat").c_str(),
+ fd = open((serializedDir+ "/serializecppsplit_body.dat").c_str(),
O_WRONLY | O_TRUNC | O_CREAT, 0644);
if (write(fd, bBuf.getBuffer(), bBuf.getPos()) != (ssize_t)bBuf.getPos()) {
- throw vespalib::Exception("write failed");
+ throw vespalib::Exception("write failed");
}
close(fd);
@@ -904,10 +898,10 @@ TEST(DocumentTest, testGenerateSerializedFile)
doc.serialize(lz4buf);
lz4buf.flip();
- fd = open(TEST_PATH("/serializecpp-lz4-level9.dat").c_str(),
+ fd = open((serializedDir + "/serializecpp-lz4-level9.dat").c_str(),
O_WRONLY | O_TRUNC | O_CREAT, 0644);
if (write(fd, lz4buf.getBufferAtPos(), lz4buf.getRemaining()) != (ssize_t)lz4buf.getRemaining()) {
- throw vespalib::Exception("write failed");
+ throw vespalib::Exception("write failed");
}
close(fd);
}
@@ -915,15 +909,14 @@ TEST(DocumentTest, testGenerateSerializedFile)
TEST(DocumentTest, testGetURIFromSerialized)
{
TestDocRepo test_repo;
- Document doc(*test_repo.getDocumentType("testdoctype1"),
- DocumentId("doc:ns:testdoc"));
+ Document doc(*test_repo.getDocumentType("testdoctype1"), DocumentId("id:ns:testdoctype1::1"));
{
std::unique_ptr<ByteBuffer> serialized = doc.serialize();
serialized->flip();
EXPECT_EQ(
- vespalib::string(DocIdString("ns", "testdoc").toString()),
+ vespalib::string("id:ns:testdoctype1::1"),
Document::getIdFromSerialized(*serialized).toString());
EXPECT_EQ(vespalib::string("testdoctype1"),
@@ -937,8 +930,7 @@ TEST(DocumentTest, testGetURIFromSerialized)
serialized->flip();
Document doc2(test_repo.getTypeRepo(), *serialized, false, NULL);
- EXPECT_EQ(
- vespalib::string(DocIdString("ns", "testdoc").toString()), doc2.getId().toString());
+ EXPECT_EQ(vespalib::string("id:ns:testdoctype1::1"), doc2.getId().toString());
EXPECT_EQ(vespalib::string("testdoctype1"), doc2.getType().getName());
}
}
@@ -947,8 +939,7 @@ TEST(DocumentTest, testBogusserialize)
{
TestDocRepo test_repo;
try {
- std::unique_ptr<ByteBuffer> buf(
- new ByteBuffer("aoifjweprjwoejr203r+2+4r823++!",100));
+ auto buf = std::make_unique<ByteBuffer>("aoifjweprjwoejr203r+2+4r823++!",100);
Document doc(test_repo.getTypeRepo(), *buf);
FAIL() << "Failed to throw exception deserializing bogus data";
} catch (DeserializeException& e) {
@@ -956,7 +947,7 @@ TEST(DocumentTest, testBogusserialize)
}
try {
- std::unique_ptr<ByteBuffer> buf(new ByteBuffer("",0));
+ auto buf = std::make_unique<ByteBuffer>("",0);
Document doc(test_repo.getTypeRepo(), *buf);
FAIL() << "Failed to throw exception deserializing empty buffer";
} catch (DeserializeException& e) {
@@ -967,19 +958,17 @@ TEST(DocumentTest, testBogusserialize)
TEST(DocumentTest, testCRC32)
{
TestDocRepo test_repo;
- Document doc(*test_repo.getDocumentType("testdoctype1"),
- DocumentId(DocIdString("crawler", "http://www.ntnu.no/")));
+ Document doc(*test_repo.getDocumentType("testdoctype1"), DocumentId("id:ns:testdoctype1::crawler:http://www.ntnu.no/"));
- doc.setValue(doc.getField("hstringval"),
- StringFieldValue("bla bla bla bla bla"));
+ doc.setValue(doc.getField("hstringval"), StringFieldValue("bla bla bla bla bla"));
uint32_t crc = doc.calculateChecksum();
- EXPECT_EQ(277496115u, crc);
+ EXPECT_EQ(3987392271u, crc);
std::unique_ptr<ByteBuffer> buf = doc.serialize();
buf->flip();
- int pos = 20;
+ int pos = 30;
// Corrupt serialization.
buf->getBuffer()[pos] ^= 72;
@@ -1002,12 +991,11 @@ TEST(DocumentTest, testHasChanged)
{
TestDocRepo test_repo;
Document doc(*test_repo.getDocumentType("testdoctype1"),
- DocumentId(DocIdString("crawler", "http://www.ntnu.no/")));
+ DocumentId("id:ns:testdoctype1::crawler:http://www.ntnu.no/"));
// Before deserialization we are changed.
EXPECT_TRUE(doc.hasChanged());
- doc.setValue(doc.getField("hstringval"),
- StringFieldValue("bla bla bla bla bla"));
+ doc.setValue(doc.getField("hstringval"), StringFieldValue("bla bla bla bla bla"));
// Still changed after setting a value of course.
EXPECT_TRUE(doc.hasChanged());
@@ -1078,8 +1066,7 @@ TEST(DocumentTest, testSliceSerialize)
// bytebuffer.
TestDocMan testDocMan;
Document::UP doc = testDocMan.createDocument();
- Document::UP doc2 = testDocMan.createDocument(
- "Some other content", "doc:test:anotherdoc");
+ Document::UP doc2 = testDocMan.createDocument("Some other content", "id:ns:testdoctype1::anotherdoc");
ArrayFieldValue val(doc2->getField("rawarray").getDataType());
val.add(RawFieldValue("hei", 3));
@@ -1091,15 +1078,13 @@ TEST(DocumentTest, testSliceSerialize)
doc->serialize(buf);
EXPECT_EQ(getSerializedSize(*doc), buf.getPos());
doc2->serialize(buf);
- EXPECT_EQ(getSerializedSize(*doc) + getSerializedSize(*doc2),
- buf.getPos());
+ EXPECT_EQ(getSerializedSize(*doc) + getSerializedSize(*doc2), buf.getPos());
buf.flip();
Document doc3(testDocMan.getTypeRepo(), buf);
EXPECT_EQ(getSerializedSize(*doc), buf.getPos());
Document doc4(testDocMan.getTypeRepo(), buf);
- EXPECT_EQ(getSerializedSize(*doc) + getSerializedSize(*doc2),
- buf.getPos());
+ EXPECT_EQ(getSerializedSize(*doc) + getSerializedSize(*doc2), buf.getPos());
EXPECT_EQ(*doc, doc3);
EXPECT_EQ(*doc2, doc4);
@@ -1142,9 +1127,8 @@ TEST(DocumentTest, testCompressionConfigured)
Struct("serializetest.body").setId(45)
.addField("stringfield", DataType::T_STRING));
DocumentTypeRepo repo(builder.config());
- Document doc_uncompressed(
- *repo.getDocumentType("serializetest"),
- DocumentId("doc:test:test"));
+ Document doc_uncompressed(*repo.getDocumentType("serializetest"),
+ DocumentId("id:ns:serializetest::1"));
std::string bigString("compress me");
for (int i = 0; i < 8; ++i) { bigString += bigString; }
@@ -1206,7 +1190,7 @@ TEST(DocumentTest, testUnknownEntries)
DocumentTypeRepo repo(type2);
- Document doc1(type1, DocumentId("doc::testdoc"));
+ Document doc1(type1, DocumentId("id:ns:test::1"));
doc1.setValue(field1, IntFieldValue(1));
doc1.setValue(field2, IntFieldValue(2));
doc1.setValue(field3, IntFieldValue(3));
@@ -1235,12 +1219,12 @@ TEST(DocumentTest, testUnknownEntries)
doc3.deserializeBody(repo, body);
EXPECT_EQ(std::string(
- "<document documenttype=\"test\" documentid=\"doc::testdoc\">\n"
+ "<document documenttype=\"test\" documentid=\"id:ns:test::1\">\n"
"<int3>3</int3>\n"
"<int4>4</int4>\n"
"</document>"), doc2.toXml());
EXPECT_EQ(std::string(
- "<document documenttype=\"test\" documentid=\"doc::testdoc\">\n"
+ "<document documenttype=\"test\" documentid=\"id:ns:test::1\">\n"
"<int3>3</int3>\n"
"<int4>4</int4>\n"
"</document>"), doc3.toXml());
@@ -1297,7 +1281,7 @@ TEST(DocumentTest, testAnnotationDeserialization)
ByteBuffer buf(len);
lseek(fd,0,SEEK_SET);
if (read(fd, buf.getBuffer(), len) != len) {
- throw vespalib::Exception("read failed");
+ throw vespalib::Exception("read failed");
}
close(fd);
diff --git a/document/src/tests/documenttypetestcase.cpp b/document/src/tests/documenttypetestcase.cpp
index 649367d76f3..caddfbc70fc 100644
--- a/document/src/tests/documenttypetestcase.cpp
+++ b/document/src/tests/documenttypetestcase.cpp
@@ -118,7 +118,7 @@ TEST(DocumentTypeTest, testMultipleInheritance)
EXPECT_TRUE(docType3->hasField("tmp"));
EXPECT_TRUE(docType3->hasField("tall"));
- Document doc(*docType3, DocumentId(DocIdString("test", "test")));
+ Document doc(*docType3, DocumentId("id:ns:test3::1"));
IntFieldValue intVal(3);
doc.setValue(doc.getField("nalle"), intVal);
diff --git a/document/src/tests/documentupdatetestcase.cpp b/document/src/tests/documentupdatetestcase.cpp
index b9568d546c5..b22edfd1ad6 100644
--- a/document/src/tests/documentupdatetestcase.cpp
+++ b/document/src/tests/documentupdatetestcase.cpp
@@ -140,14 +140,14 @@ TEST(DocumentUpdateTest, testSimpleUsage)
EXPECT_EQ(fieldUpdate, fieldUpdateCopy);
// Test that a document update can be serialized
- DocumentUpdate docUpdate(repo, *docType, DocumentId("doc::testdoc"));
+ DocumentUpdate docUpdate(repo, *docType, DocumentId("id:ns:test::1"));
docUpdate.addUpdate(fieldUpdateCopy);
ByteBuffer::UP docBuf = serializeHEAD(docUpdate);
docBuf->flip();
auto docUpdateCopy(DocumentUpdate::createHEAD(repo, nbostream(docBuf->getBufferAtPos(), docBuf->getRemaining())));
// Create a test document
- Document doc(*docType, DocumentId("doc::testdoc"));
+ Document doc(*docType, DocumentId("id:ns:test::1"));
doc.set("bytef", 0);
doc.set("intf", 5);
ArrayFieldValue array(*arrayType);
@@ -158,7 +158,7 @@ TEST(DocumentUpdateTest, testSimpleUsage)
// Verify that we can apply simple updates to it
{
Document updated(doc);
- DocumentUpdate upd(repo, *docType, DocumentId("doc::testdoc"));
+ DocumentUpdate upd(repo, *docType, DocumentId("id:ns:test::1"));
upd.addUpdate(FieldUpdate(docType->getField("intf")).addUpdate(ClearValueUpdate()));
upd.applyTo(updated);
EXPECT_NE(doc, updated);
@@ -166,7 +166,7 @@ TEST(DocumentUpdateTest, testSimpleUsage)
}
{
Document updated(doc);
- DocumentUpdate upd(repo, *docType, DocumentId("doc::testdoc"));
+ DocumentUpdate upd(repo, *docType, DocumentId("id:ns:test::1"));
upd.addUpdate(FieldUpdate(docType->getField("intf")).addUpdate(AssignValueUpdate(IntFieldValue(15))));
upd.applyTo(updated);
EXPECT_NE(doc, updated);
@@ -174,7 +174,7 @@ TEST(DocumentUpdateTest, testSimpleUsage)
}
{
Document updated(doc);
- DocumentUpdate upd(repo, *docType, DocumentId("doc::testdoc"));
+ DocumentUpdate upd(repo, *docType, DocumentId("id:ns:test::1"));
upd.addUpdate(FieldUpdate(docType->getField("intf")).addUpdate(ArithmeticValueUpdate(ArithmeticValueUpdate::Add, 15)));
upd.applyTo(updated);
EXPECT_NE(doc, updated);
@@ -182,7 +182,7 @@ TEST(DocumentUpdateTest, testSimpleUsage)
}
{
Document updated(doc);
- DocumentUpdate upd(repo, *docType, DocumentId("doc::testdoc"));
+ DocumentUpdate upd(repo, *docType, DocumentId("id:ns:test::1"));
upd.addUpdate(FieldUpdate(docType->getField("intarr")).addUpdate(AddValueUpdate(IntFieldValue(4))));
upd.applyTo(updated);
EXPECT_NE(doc, updated);
@@ -192,7 +192,7 @@ TEST(DocumentUpdateTest, testSimpleUsage)
}
{
Document updated(doc);
- DocumentUpdate upd(repo, *docType, DocumentId("doc::testdoc"));
+ DocumentUpdate upd(repo, *docType, DocumentId("id:ns:test::1"));
upd.addUpdate(FieldUpdate(docType->getField("intarr")).addUpdate(RemoveValueUpdate(IntFieldValue(3))));
upd.applyTo(updated);
EXPECT_NE(doc, updated);
@@ -202,7 +202,7 @@ TEST(DocumentUpdateTest, testSimpleUsage)
}
{
Document updated(doc);
- DocumentUpdate upd(repo, *docType, DocumentId("doc::testdoc"));
+ DocumentUpdate upd(repo, *docType, DocumentId("id:ns:test::1"));
upd.addUpdate(FieldUpdate(docType->getField("bytef"))
.addUpdate(ArithmeticValueUpdate(ArithmeticValueUpdate::Add, 15)));
upd.applyTo(updated);
@@ -409,9 +409,9 @@ WeightedSetAutoCreateFixture::~WeightedSetAutoCreateFixture() = default;
WeightedSetAutoCreateFixture::WeightedSetAutoCreateFixture()
: repo(makeConfig()),
docType(repo.getDocumentType("test")),
- doc(*docType, DocumentId("doc::testdoc")),
+ doc(*docType, DocumentId("id:ns:test::1")),
field(docType->getField("strwset")),
- update(repo, *docType, DocumentId("doc::testdoc"))
+ update(repo, *docType, DocumentId("id:ns:test::1"))
{
update.addUpdate(FieldUpdate(field)
.addUpdate(MapValueUpdate(StringFieldValue("foo"),
@@ -475,7 +475,7 @@ TEST(DocumentUpdateTest, testReadSerializedFile)
DocumentUpdate& upd(*updp);
const DocumentType *type = repo.getDocumentType("serializetest");
- EXPECT_EQ(DocumentId(DocIdString("update", "test")), upd.getId());
+ EXPECT_EQ(DocumentId("id:ns:serializetest::update"), upd.getId());
EXPECT_EQ(*type, upd.getType());
// Verify assign value update.
@@ -533,7 +533,7 @@ TEST(DocumentUpdateTest, testGenerateSerializedFile)
DocumentTypeRepo repo(readDocumenttypesConfig(file_name));
const DocumentType *type(repo.getDocumentType("serializetest"));
- DocumentUpdate upd(repo, *type, DocumentId(DocIdString("update", "test")));
+ DocumentUpdate upd(repo, *type, DocumentId("id:ns:serializetest::update"));
upd.addUpdate(FieldUpdate(type->getField("intfield"))
.addUpdate(AssignValueUpdate(IntFieldValue(4))));
upd.addUpdate(FieldUpdate(type->getField("floatfield"))
diff --git a/document/src/tests/fieldpathupdatetestcase.cpp b/document/src/tests/fieldpathupdatetestcase.cpp
index 74e2c20ad86..36a1c339ebb 100644
--- a/document/src/tests/fieldpathupdatetestcase.cpp
+++ b/document/src/tests/fieldpathupdatetestcase.cpp
@@ -83,7 +83,7 @@ createTestDocument(const DocumentTypeRepo &repo)
const DataType* structmap(repo.getDataType(*type, "Map<String,struct2>"));
const DataType* wset(repo.getDataType(*type, "WeightedSet<String>"));
const DataType* structwset(repo.getDataType(*type, "WeightedSet<struct2>"));
- Document::UP doc(new Document(*type, DocumentId("doc::testdoc")));
+ Document::UP doc(new Document(*type, DocumentId("id:ns:test::1")));
doc->setRepo(repo);
doc->setValue("primitive1", IntFieldValue(1));
StructFieldValue l1s1(*struct3);
@@ -296,12 +296,12 @@ TEST_F(FieldPathUpdateTestCase, testNoIterateMapValues)
TEST_F(FieldPathUpdateTestCase, testRemoveField)
{
- Document::UP doc(new Document(_foobar_type, DocumentId("doc:things:thangs")));
+ Document::UP doc(new Document(_foobar_type, DocumentId("id:ns:foobar::things:thangs")));
EXPECT_TRUE(doc->hasValue("strfoo") == false);
doc->setValue("strfoo", StringFieldValue("cocacola"));
EXPECT_EQ(vespalib::string("cocacola"), doc->getValue("strfoo")->getAsString());
//doc->print(std::cerr, true, "");
- DocumentUpdate docUp(*_repo, _foobar_type, DocumentId("doc:barbar:foofoo"));
+ DocumentUpdate docUp(*_repo, _foobar_type, DocumentId("id:ns:foobar::barbar:foofoo"));
docUp.addFieldPathUpdate(FieldPathUpdate::CP(new RemoveFieldPathUpdate("strfoo")));
docUp.applyTo(*doc);
EXPECT_TRUE(doc->hasValue("strfoo") == false);
@@ -309,7 +309,7 @@ TEST_F(FieldPathUpdateTestCase, testRemoveField)
TEST_F(FieldPathUpdateTestCase, testApplyRemoveMultiList)
{
- Document::UP doc(new Document(_foobar_type, DocumentId("doc:things:thangs")));
+ Document::UP doc(new Document(_foobar_type, DocumentId("id:ns:foobar::things:thangs")));
doc->setRepo(*_repo);
EXPECT_TRUE(doc->hasValue("strarray") == false);
{
@@ -321,7 +321,7 @@ TEST_F(FieldPathUpdateTestCase, testApplyRemoveMultiList)
}
EXPECT_TRUE(doc->hasValue("strarray"));
//doc->print(std::cerr, true, "");
- DocumentUpdate docUp(*_repo, _foobar_type, DocumentId("doc:barbar:foofoo"));
+ DocumentUpdate docUp(*_repo, _foobar_type, DocumentId("id:ns:foobar::barbar:foofoo"));
docUp.addFieldPathUpdate(FieldPathUpdate::CP(
new RemoveFieldPathUpdate("strarray[$x]", "foobar.strarray[$x] == \"remove val 1\"")));
docUp.applyTo(*doc);
@@ -335,7 +335,7 @@ TEST_F(FieldPathUpdateTestCase, testApplyRemoveMultiList)
TEST_F(FieldPathUpdateTestCase, testApplyRemoveMultiList2)
{
- Document::UP doc(new Document(_foobar_type, DocumentId("doc:things:thangs")));
+ Document::UP doc(new Document(_foobar_type, DocumentId("id:ns:foobar::things:thangs")));
doc->setRepo(*_repo);
EXPECT_TRUE(doc->hasValue("strarray") == false);
{
@@ -347,7 +347,7 @@ TEST_F(FieldPathUpdateTestCase, testApplyRemoveMultiList2)
}
EXPECT_TRUE(doc->hasValue("strarray"));
//doc->print(std::cerr, true, "");
- DocumentUpdate docUp(*_repo, _foobar_type, DocumentId("doc:barbar:foofoo"));
+ DocumentUpdate docUp(*_repo, _foobar_type, DocumentId("id:ns:foobar::barbar:foofoo"));
docUp.addFieldPathUpdate(FieldPathUpdate::CP(
new RemoveFieldPathUpdate("strarray[$x]", "foobar.strarray[$x] == \"remove val 1\"")));
docUp.applyTo(*doc);
@@ -360,7 +360,7 @@ TEST_F(FieldPathUpdateTestCase, testApplyRemoveMultiList2)
TEST_F(FieldPathUpdateTestCase, testApplyRemoveEntireListField)
{
- Document::UP doc(new Document(_foobar_type, DocumentId("doc:things:thangs")));
+ Document::UP doc(new Document(_foobar_type, DocumentId("id:ns:foobar::things:thangs")));
EXPECT_TRUE(doc->hasValue("strarray") == false);
{
ArrayFieldValue strArray(doc->getType().getField("strarray").getDataType());
@@ -370,7 +370,7 @@ TEST_F(FieldPathUpdateTestCase, testApplyRemoveEntireListField)
doc->setValue("strarray", strArray);
}
//doc->print(std::cerr, true, "");
- DocumentUpdate docUp(*_repo, _foobar_type, DocumentId("doc:barbar:foofoo"));
+ DocumentUpdate docUp(*_repo, _foobar_type, DocumentId("id:ns:foobar::barbar:foofoo"));
docUp.addFieldPathUpdate(FieldPathUpdate::CP(new RemoveFieldPathUpdate("strarray", "")));
docUp.applyTo(*doc);
EXPECT_TRUE(!doc->hasValue("strarray"));
@@ -378,7 +378,7 @@ TEST_F(FieldPathUpdateTestCase, testApplyRemoveEntireListField)
TEST_F(FieldPathUpdateTestCase, testApplyRemoveMultiWset)
{
- Document::UP doc(new Document(_foobar_type, DocumentId("doc:helan:halvan")));
+ Document::UP doc(new Document(_foobar_type, DocumentId("id:ns:foobar::helan:halvan")));
EXPECT_TRUE(doc->hasValue("strwset") == false);
{
WeightedSetFieldValue strWset(doc->getType().getField("strwset").getDataType());
@@ -388,7 +388,7 @@ TEST_F(FieldPathUpdateTestCase, testApplyRemoveMultiWset)
}
EXPECT_TRUE(doc->hasValue("strwset"));
//doc->print(std::cerr, true, "");
- DocumentUpdate docUp(*_repo, _foobar_type, DocumentId("doc:barbar:foofoo"));
+ DocumentUpdate docUp(*_repo, _foobar_type, DocumentId("id:ns:foobar::barbar:foofoo"));
docUp.addFieldPathUpdate(FieldPathUpdate::CP(new RemoveFieldPathUpdate("strwset{remove val 1}")));
docUp.applyTo(*doc);
{
@@ -400,17 +400,17 @@ TEST_F(FieldPathUpdateTestCase, testApplyRemoveMultiWset)
TEST_F(FieldPathUpdateTestCase, testApplyAssignSingle)
{
- Document::UP doc(new Document(_foobar_type, DocumentId("doc:drekka:karsk")));
+ Document::UP doc(new Document(_foobar_type, DocumentId("id:ns:foobar::drekka:karsk")));
EXPECT_TRUE(doc->hasValue("strfoo") == false);
// Test assignment of non-existing
- DocumentUpdate docUp(*_repo, _foobar_type, DocumentId("doc:barbar:foofoo"));
+ DocumentUpdate docUp(*_repo, _foobar_type, DocumentId("id:ns:foobar::barbar:foofoo"));
docUp.addFieldPathUpdate(FieldPathUpdate::CP(
new AssignFieldPathUpdate(*doc->getDataType(), "strfoo", std::string(), StringFieldValue("himert"))));
docUp.applyTo(*doc);
EXPECT_TRUE(doc->hasValue("strfoo"));
EXPECT_EQ(vespalib::string("himert"), doc->getValue("strfoo")->getAsString());
// Test overwriting existing
- DocumentUpdate docUp2(*_repo, _foobar_type, DocumentId("doc:barbar:foofoo"));
+ DocumentUpdate docUp2(*_repo, _foobar_type, DocumentId("id:ns:foobar::barbar:foofoo"));
docUp2.addFieldPathUpdate(FieldPathUpdate::CP(
new AssignFieldPathUpdate(*doc->getDataType(), "strfoo", std::string(), StringFieldValue("wunderbaum"))));
docUp2.applyTo(*doc);
@@ -419,10 +419,10 @@ TEST_F(FieldPathUpdateTestCase, testApplyAssignSingle)
TEST_F(FieldPathUpdateTestCase, testApplyAssignMath)
{
- Document::UP doc(new Document(_foobar_type, DocumentId("doc:bat:man")));
+ Document::UP doc(new Document(_foobar_type, DocumentId("id:ns:foobar::bat:man")));
doc->setValue("num", IntFieldValue(34));
- DocumentUpdate docUp(*_repo, _foobar_type, DocumentId("doc:barbar:foofoo"));
+ DocumentUpdate docUp(*_repo, _foobar_type, DocumentId("id:ns:foobar::barbar:foofoo"));
docUp.addFieldPathUpdate(FieldPathUpdate::CP(new AssignFieldPathUpdate("num", "", "($value * 2) / $value")));
docUp.applyTo(*doc);
EXPECT_EQ(static_cast<const FieldValue&>(IntFieldValue(2)), *doc->getValue("num"));
@@ -430,10 +430,10 @@ TEST_F(FieldPathUpdateTestCase, testApplyAssignMath)
TEST_F(FieldPathUpdateTestCase, testApplyAssignMathByteToZero)
{
- Document::UP doc(new Document(_foobar_type, DocumentId("doc:bat:man")));
+ Document::UP doc(new Document(_foobar_type, DocumentId("id:ns:foobar::bat:man")));
doc->setValue("byteval", ByteFieldValue(3));
- DocumentUpdate docUp(*_repo, _foobar_type, DocumentId("doc:barbar:foofoo"));
+ DocumentUpdate docUp(*_repo, _foobar_type, DocumentId("id:ns:foobar::barbar:foofoo"));
docUp.addFieldPathUpdate(FieldPathUpdate::CP(new AssignFieldPathUpdate("byteval", "", "$value - 3")));
docUp.applyTo(*doc);
EXPECT_EQ(static_cast<const FieldValue&>(ByteFieldValue(0)), *doc->getValue("byteval"));
@@ -442,10 +442,10 @@ TEST_F(FieldPathUpdateTestCase, testApplyAssignMathByteToZero)
TEST_F(FieldPathUpdateTestCase, testApplyAssignMathNotModifiedOnUnderflow)
{
int low_value = -126;
- Document::UP doc(new Document(_foobar_type, DocumentId("doc:bat:man")));
+ Document::UP doc(new Document(_foobar_type, DocumentId("id:ns:foobar::bat:man")));
doc->setValue("byteval", ByteFieldValue(low_value));
- DocumentUpdate docUp(*_repo, _foobar_type, DocumentId("doc:barbar:foofoo"));
+ DocumentUpdate docUp(*_repo, _foobar_type, DocumentId("id:ns:foobar::barbar:foofoo"));
docUp.addFieldPathUpdate(FieldPathUpdate::CP(new AssignFieldPathUpdate("byteval", "", "$value - 4")));
docUp.applyTo(*doc);
// Over/underflow will happen. You must have control of your data types.
@@ -454,10 +454,10 @@ TEST_F(FieldPathUpdateTestCase, testApplyAssignMathNotModifiedOnUnderflow)
TEST_F(FieldPathUpdateTestCase, testApplyAssignMathNotModifiedOnOverflow)
{
- Document::UP doc(new Document(_foobar_type, DocumentId("doc:bat:man")));
+ Document::UP doc(new Document(_foobar_type, DocumentId("id:ns:foobar::bat:man")));
doc->setValue("byteval", ByteFieldValue(127));
- DocumentUpdate docUp(*_repo, _foobar_type, DocumentId("doc:barbar:foofoo"));
+ DocumentUpdate docUp(*_repo, _foobar_type, DocumentId("id:ns:foobar::barbar:foofoo"));
docUp.addFieldPathUpdate(FieldPathUpdate::CP(new AssignFieldPathUpdate("byteval", "", "$value + 200")));
docUp.applyTo(*doc);
// Over/underflow will happen. You must have control of your data types.
@@ -466,11 +466,11 @@ TEST_F(FieldPathUpdateTestCase, testApplyAssignMathNotModifiedOnOverflow)
TEST_F(FieldPathUpdateTestCase, testApplyAssignMathDivZero)
{
- Document::UP doc(new Document(_foobar_type, DocumentId("doc:bat:man")));
+ Document::UP doc(new Document(_foobar_type, DocumentId("id:ns:foobar::bat:man")));
EXPECT_TRUE(doc->hasValue("num") == false);
doc->setValue("num", IntFieldValue(10));
- DocumentUpdate docUp(*_repo, _foobar_type, DocumentId("doc:barbar:foofoo"));
+ DocumentUpdate docUp(*_repo, _foobar_type, DocumentId("id:ns:foobar::barbar:foofoo"));
docUp.addFieldPathUpdate(FieldPathUpdate::CP(new AssignFieldPathUpdate("num", "", "$value / ($value - 10)")));
docUp.applyTo(*doc);
EXPECT_EQ(static_cast<const FieldValue&>(IntFieldValue(10)), *doc->getValue("num"));
@@ -478,12 +478,12 @@ TEST_F(FieldPathUpdateTestCase, testApplyAssignMathDivZero)
TEST_F(FieldPathUpdateTestCase, testApplyAssignFieldNotExistingInExpression)
{
- Document::UP doc(new Document(_foobar_type, DocumentId("doc:bat:man")));
+ Document::UP doc(new Document(_foobar_type, DocumentId("id:ns:foobar::bat:man")));
doc->setRepo(*_repo);
EXPECT_TRUE(doc->hasValue("num") == false);
doc->setValue("num", IntFieldValue(10));
- DocumentUpdate docUp(*_repo, _foobar_type, DocumentId("doc:barbar:foofoo"));
+ DocumentUpdate docUp(*_repo, _foobar_type, DocumentId("id:ns:foobar::barbar:foofoo"));
docUp.addFieldPathUpdate(FieldPathUpdate::CP(new AssignFieldPathUpdate("num", "", "foobar.num2 + $value")));
docUp.applyTo(*doc);
EXPECT_EQ(static_cast<const FieldValue&>(IntFieldValue(10)), *doc->getValue("num"));
@@ -491,10 +491,10 @@ TEST_F(FieldPathUpdateTestCase, testApplyAssignFieldNotExistingInExpression)
TEST_F(FieldPathUpdateTestCase, testApplyAssignFieldNotExistingInPath)
{
- Document::UP doc(new Document(_foobar_type, DocumentId("doc:bat:man")));
+ Document::UP doc(new Document(_foobar_type, DocumentId("id:ns:foobar::bat:man")));
doc->setRepo(*_repo);
- DocumentUpdate docUp(*_repo, _foobar_type, DocumentId("doc:barbar:foofoo"));
+ DocumentUpdate docUp(*_repo, _foobar_type, DocumentId("id:ns:foobar::barbar:foofoo"));
try {
docUp.addFieldPathUpdate(FieldPathUpdate::CP(new AssignFieldPathUpdate("nosuchnum", "", "foobar.num + $value")));
docUp.applyTo(*doc);
@@ -505,10 +505,10 @@ TEST_F(FieldPathUpdateTestCase, testApplyAssignFieldNotExistingInPath)
TEST_F(FieldPathUpdateTestCase, testApplyAssignTargetNotExisting)
{
- Document::UP doc(new Document(_foobar_type, DocumentId("doc:bat:man")));
+ Document::UP doc(new Document(_foobar_type, DocumentId("id:ns:foobar::bat:man")));
EXPECT_TRUE(doc->hasValue("num") == false);
- DocumentUpdate docUp(*_repo, _foobar_type, DocumentId("doc:barbar:foofoo"));
+ DocumentUpdate docUp(*_repo, _foobar_type, DocumentId("id:ns:foobar::barbar:foofoo"));
docUp.addFieldPathUpdate(FieldPathUpdate::CP(new AssignFieldPathUpdate("num", "", "$value + 5")));
docUp.applyTo(*doc);
EXPECT_EQ(static_cast<const FieldValue&>(IntFieldValue(5)), *doc->getValue("num"));
@@ -516,7 +516,7 @@ TEST_F(FieldPathUpdateTestCase, testApplyAssignTargetNotExisting)
TEST_F(FieldPathUpdateTestCase, testAssignSimpleMapValueWithVariable)
{
- Document::UP doc(new Document(_foobar_type, DocumentId("doc:bug:hunter")));
+ Document::UP doc(new Document(_foobar_type, DocumentId("id:ns:foobar::bug:hunter")));
doc->setRepo(*_repo);
MapFieldValue mfv(doc->getType().getField("strmap").getDataType());
@@ -524,7 +524,7 @@ TEST_F(FieldPathUpdateTestCase, testAssignSimpleMapValueWithVariable)
mfv.put(StringFieldValue("baz"), StringFieldValue("bananas"));
doc->setValue("strmap", mfv);
- DocumentUpdate docUp(*_repo, _foobar_type, DocumentId("doc:barbar:foofoo"));
+ DocumentUpdate docUp(*_repo, _foobar_type, DocumentId("id:ns:foobar::barbar:foofoo"));
// Select on value, not key
docUp.addFieldPathUpdate(FieldPathUpdate::CP(
new AssignFieldPathUpdate(*doc->getDataType(),
@@ -544,12 +544,12 @@ TEST_F(FieldPathUpdateTestCase, testAssignSimpleMapValueWithVariable)
TEST_F(FieldPathUpdateTestCase, testApplyAssignMathRemoveIfZero)
{
- Document::UP doc(new Document(_foobar_type, DocumentId("doc:bat:man")));
+ Document::UP doc(new Document(_foobar_type, DocumentId("id:ns:foobar::bat:man")));
EXPECT_TRUE(doc->hasValue("num") == false);
doc->setValue("num", IntFieldValue(34));
EXPECT_TRUE(doc->hasValue("num") == true);
- DocumentUpdate docUp(*_repo, _foobar_type, DocumentId("doc:barbar:foofoo"));
+ DocumentUpdate docUp(*_repo, _foobar_type, DocumentId("id:ns:foobar::barbar:foofoo"));
FieldPathUpdate::CP up1(new AssignFieldPathUpdate("num", "", "($value * 2) / $value - 2"));
static_cast<AssignFieldPathUpdate&>(*up1).setRemoveIfZero(true);
docUp.addFieldPathUpdate(up1);
@@ -560,7 +560,7 @@ TEST_F(FieldPathUpdateTestCase, testApplyAssignMathRemoveIfZero)
TEST_F(FieldPathUpdateTestCase, testApplyAssignMultiList)
{
- Document::UP doc(new Document(_foobar_type, DocumentId("doc:fest:skinnvest")));
+ Document::UP doc(new Document(_foobar_type, DocumentId("id:ns:foobar::fest:skinnvest")));
EXPECT_TRUE(doc->hasValue("strarray") == false);
{
@@ -575,7 +575,7 @@ TEST_F(FieldPathUpdateTestCase, testApplyAssignMultiList)
updateArray.add(StringFieldValue("assigned val 0"));
updateArray.add(StringFieldValue("assigned val 1"));
- DocumentUpdate docUp(*_repo, _foobar_type, DocumentId("doc:barbar:foofoo"));
+ DocumentUpdate docUp(*_repo, _foobar_type, DocumentId("id:ns:foobar::barbar:foofoo"));
docUp.addFieldPathUpdate(FieldPathUpdate::CP(
new AssignFieldPathUpdate(*doc->getDataType(), "strarray", std::string(), updateArray)));
docUp.applyTo(*doc);
@@ -591,7 +591,7 @@ TEST_F(FieldPathUpdateTestCase, testApplyAssignMultiList)
TEST_F(FieldPathUpdateTestCase, testApplyAssignMultiWset)
{
- Document::UP doc(new Document(_foobar_type, DocumentId("doc:fest:skinnvest")));
+ Document::UP doc(new Document(_foobar_type, DocumentId("id:ns:foobar::fest:skinnvest")));
EXPECT_TRUE(doc->hasValue("strarray") == false);
{
@@ -606,7 +606,7 @@ TEST_F(FieldPathUpdateTestCase, testApplyAssignMultiWset)
assignWset.add(StringFieldValue("assigned val 0"), 5);
assignWset.add(StringFieldValue("assigned val 1"), 10);
- DocumentUpdate docUp(*_repo, _foobar_type, DocumentId("doc:barbar:foofoo"));
+ DocumentUpdate docUp(*_repo, _foobar_type, DocumentId("id:ns:foobar::barbar:foofoo"));
docUp.addFieldPathUpdate(FieldPathUpdate::CP(
new AssignFieldPathUpdate(*doc->getDataType(), "strwset", std::string(), assignWset)));
//doc->print(std::cerr, true, "");
@@ -622,7 +622,7 @@ TEST_F(FieldPathUpdateTestCase, testApplyAssignMultiWset)
TEST_F(FieldPathUpdateTestCase, testAssignWsetRemoveIfZero)
{
- Document::UP doc(new Document(_foobar_type, DocumentId("doc:tronder:bataljon")));
+ Document::UP doc(new Document(_foobar_type, DocumentId("id:ns:foobar::tronder:bataljon")));
EXPECT_TRUE(doc->hasValue("strarray") == false);
{
@@ -634,7 +634,7 @@ TEST_F(FieldPathUpdateTestCase, testAssignWsetRemoveIfZero)
}
{
- DocumentUpdate docUp(*_repo, _foobar_type, DocumentId("doc:barbar:foofoo"));
+ DocumentUpdate docUp(*_repo, _foobar_type, DocumentId("id:ns:foobar::barbar:foofoo"));
IntFieldValue zeroWeight(0);
FieldPathUpdate::CP assignUpdate(
new AssignFieldPathUpdate(*doc->getDataType(), "strwset{you say goodbye}", std::string(), zeroWeight));
@@ -653,7 +653,7 @@ TEST_F(FieldPathUpdateTestCase, testAssignWsetRemoveIfZero)
TEST_F(FieldPathUpdateTestCase, testApplyAddMultiList)
{
- Document::UP doc(new Document(_foobar_type, DocumentId("doc:george:costanza")));
+ Document::UP doc(new Document(_foobar_type, DocumentId("id:ns:foobar::george:costanza")));
EXPECT_TRUE(doc->hasValue("strarray") == false);
ArrayFieldValue adds(doc->getType().getField("strarray").getDataType());
@@ -661,7 +661,7 @@ TEST_F(FieldPathUpdateTestCase, testApplyAddMultiList)
adds.add(StringFieldValue("a festivus for the rest of us"));
adds.add(StringFieldValue("george is getting upset!"));
- DocumentUpdate docUp(*_repo, _foobar_type, DocumentId("doc:barbar:foofoo"));
+ DocumentUpdate docUp(*_repo, _foobar_type, DocumentId("id:ns:foobar::barbar:foofoo"));
docUp.addFieldPathUpdate(FieldPathUpdate::CP(
new AddFieldPathUpdate(*doc->getDataType(), "strarray", std::string(), adds)));
//doc->print(std::cerr, true, "");
@@ -672,7 +672,7 @@ TEST_F(FieldPathUpdateTestCase, testApplyAddMultiList)
TEST_F(FieldPathUpdateTestCase, testAddAndAssignList)
{
- Document::UP doc(new Document(_foobar_type, DocumentId("doc:fancy:pants")));
+ Document::UP doc(new Document(_foobar_type, DocumentId("id:ns:foobar::fancy:pants")));
EXPECT_TRUE(doc->hasValue("strarray") == false);
{
@@ -683,7 +683,7 @@ TEST_F(FieldPathUpdateTestCase, testAddAndAssignList)
EXPECT_TRUE(doc->hasValue("strarray"));
}
- DocumentUpdate docUp(*_repo, _foobar_type, DocumentId("doc:barbar:foofoo"));
+ DocumentUpdate docUp(*_repo, _foobar_type, DocumentId("id:ns:foobar::barbar:foofoo"));
docUp.addFieldPathUpdate(FieldPathUpdate::CP(
new AssignFieldPathUpdate(*doc->getDataType(),
"strarray[1]", std::string(), StringFieldValue("assigned val 1"))));
@@ -730,9 +730,9 @@ struct Fixture {
Fixture(const DocumentType &doc_type, const Keys &k);
};
-Fixture::~Fixture() { }
+Fixture::~Fixture() = default;
Fixture::Fixture(const DocumentType &doc_type, const Keys &k)
- : doc(new Document(doc_type, DocumentId("doc:planet:express"))),
+ : doc(new Document(doc_type, DocumentId("id:ns:" + doc_type.getName() + "::planet:express"))),
mfv(getMapType(doc_type)),
fv1(getMapType(doc_type).getValueType()),
fv2(getMapType(doc_type).getValueType()),
@@ -764,7 +764,7 @@ TEST_F(FieldPathUpdateTestCase, testAssignMap)
Keys k;
Fixture f(_foobar_type, k);
- DocumentUpdate docUp(*_repo, _foobar_type, DocumentId("doc:barbar:foofoo"));
+ DocumentUpdate docUp(*_repo, _foobar_type, DocumentId("id:ns:foobar::barbar:foofoo"));
docUp.addFieldPathUpdate(FieldPathUpdate::CP(
new AssignFieldPathUpdate(*f.doc->getDataType(), "structmap{" + k.key2 + "}", std::string(), f.fv4)));
docUp.applyTo(*f.doc);
@@ -784,7 +784,7 @@ TEST_F(FieldPathUpdateTestCase, testAssignMapStruct)
Keys k;
Fixture f(_foobar_type, k);
- DocumentUpdate docUp(*_repo, _foobar_type, DocumentId("doc:barbar:foofoo"));
+ DocumentUpdate docUp(*_repo, _foobar_type, DocumentId("id:ns:foobar::barbar:foofoo"));
docUp.addFieldPathUpdate(FieldPathUpdate::CP(
new AssignFieldPathUpdate(*f.doc->getDataType(), "structmap{" + k.key2 + "}.rating",
std::string(), IntFieldValue(48))));
@@ -805,7 +805,7 @@ TEST_F(FieldPathUpdateTestCase, testAssignMapStructVariable)
Keys k;
Fixture f(_foobar_type, k);
- DocumentUpdate docUp(*_repo, _foobar_type, DocumentId("doc:barbar:foofoo"));
+ DocumentUpdate docUp(*_repo, _foobar_type, DocumentId("id:ns:foobar::barbar:foofoo"));
docUp.addFieldPathUpdate(FieldPathUpdate::CP(
new AssignFieldPathUpdate(*f.doc->getDataType(), "structmap{$x}.rating",
"foobar.structmap{$x}.title == \"farnsworth\"", IntFieldValue(48))));
@@ -824,14 +824,14 @@ TEST_F(FieldPathUpdateTestCase, testAssignMapStructVariable)
TEST_F(FieldPathUpdateTestCase, testAssignMapNoExist)
{
- Document::UP doc(new Document(_foobar_type, DocumentId("doc:planet:express")));
+ Document::UP doc(new Document(_foobar_type, DocumentId("id:ns:foobar::planet:express")));
MapFieldValue mfv(doc->getType().getField("structmap").getDataType());
StructFieldValue fv1(dynamic_cast<const MapDataType&>(*mfv.getDataType()).getValueType());
fv1.setValue("title", StringFieldValue("fry"));
fv1.setValue("rating", IntFieldValue(30));
- DocumentUpdate docUp(*_repo, _foobar_type, DocumentId("doc:barbar:foofoo"));
+ DocumentUpdate docUp(*_repo, _foobar_type, DocumentId("id:ns:foobar::barbar:foofoo"));
docUp.addFieldPathUpdate(FieldPathUpdate::CP(
new AssignFieldPathUpdate(*doc->getDataType(), "structmap{foo}", std::string(), fv1)));
//doc->print(std::cerr, true, "");
@@ -846,14 +846,14 @@ TEST_F(FieldPathUpdateTestCase, testAssignMapNoExist)
TEST_F(FieldPathUpdateTestCase, testAssignMapNoExistNoCreate)
{
- Document::UP doc(new Document(_foobar_type, DocumentId("doc:planet:express")));
+ Document::UP doc(new Document(_foobar_type, DocumentId("id:ns:foobar::planet:express")));
MapFieldValue mfv(doc->getType().getField("structmap").getDataType());
StructFieldValue fv1(dynamic_cast<const MapDataType&>(*mfv.getDataType()).getValueType());
fv1.setValue("title", StringFieldValue("fry"));
fv1.setValue("rating", IntFieldValue(30));
- DocumentUpdate docUp(*_repo, _foobar_type, DocumentId("doc:barbar:foofoo"));
+ DocumentUpdate docUp(*_repo, _foobar_type, DocumentId("id:ns:foobar::barbar:foofoo"));
FieldPathUpdate::CP assignUpdate(
new AssignFieldPathUpdate(*doc->getDataType(), "structmap{foo}", std::string(), fv1));
static_cast<AssignFieldPathUpdate&>(*assignUpdate).setCreateMissingPath(false);
@@ -874,7 +874,7 @@ TEST_F(FieldPathUpdateTestCase, testQuotedStringKey)
const char field_path[] = "structmap{\"here is a \\\"fancy\\\" 'map' :-} key :-{\"}";
Fixture f(_foobar_type, k);
- DocumentUpdate docUp(*_repo, _foobar_type, DocumentId("doc:barbar:foofoo"));
+ DocumentUpdate docUp(*_repo, _foobar_type, DocumentId("id:ns:foobar::barbar:foofoo"));
docUp.addFieldPathUpdate(FieldPathUpdate::CP(
new AssignFieldPathUpdate(*f.doc->getDataType(), field_path, std::string(), f.fv4)));
docUp.applyTo(*f.doc);
@@ -891,7 +891,7 @@ TEST_F(FieldPathUpdateTestCase, testQuotedStringKey)
TEST_F(FieldPathUpdateTestCase, testEqualityComparison)
{
- Document::UP doc(new Document(_foobar_type, DocumentId("doc:foo:zoo")));
+ Document::UP doc(new Document(_foobar_type, DocumentId("id:ns:foobar::foo:zoo")));
MapFieldValue mfv(doc->getType().getField("structmap").getDataType());
StructFieldValue fv4(dynamic_cast<const MapDataType&>(*mfv.getDataType()).getValueType());
@@ -899,8 +899,8 @@ TEST_F(FieldPathUpdateTestCase, testEqualityComparison)
fv4.setValue("rating", IntFieldValue(95));
{
- DocumentUpdate docUp1(*_repo, _foobar_type, DocumentId("doc:barbar:foofoo"));
- DocumentUpdate docUp2(*_repo, _foobar_type, DocumentId("doc:barbar:foofoo"));
+ DocumentUpdate docUp1(*_repo, _foobar_type, DocumentId("id:ns:foobar::barbar:foofoo"));
+ DocumentUpdate docUp2(*_repo, _foobar_type, DocumentId("id:ns:foobar::barbar:foofoo"));
EXPECT_TRUE(docUp1 == docUp2);
FieldPathUpdate::CP assignUp1(new AssignFieldPathUpdate(*doc->getDataType(),
@@ -911,8 +911,8 @@ TEST_F(FieldPathUpdateTestCase, testEqualityComparison)
EXPECT_TRUE(docUp1 == docUp2);
}
{
- DocumentUpdate docUp1(*_repo, _foobar_type, DocumentId("doc:barbar:foofoo"));
- DocumentUpdate docUp2(*_repo, _foobar_type, DocumentId("doc:barbar:foofoo"));
+ DocumentUpdate docUp1(*_repo, _foobar_type, DocumentId("id:ns:foobar::barbar:foofoo"));
+ DocumentUpdate docUp2(*_repo, _foobar_type, DocumentId("id:ns:foobar::barbar:foofoo"));
// where-clause diff
FieldPathUpdate::CP assignUp1(new AssignFieldPathUpdate(*doc->getDataType(),
"structmap{here be dragons}", std::string(), fv4));
@@ -923,8 +923,8 @@ TEST_F(FieldPathUpdateTestCase, testEqualityComparison)
EXPECT_TRUE(docUp1 != docUp2);
}
{
- DocumentUpdate docUp1(*_repo, _foobar_type, DocumentId("doc:barbar:foofoo"));
- DocumentUpdate docUp2(*_repo, _foobar_type, DocumentId("doc:barbar:foofoo"));
+ DocumentUpdate docUp1(*_repo, _foobar_type, DocumentId("id:ns:foobar::barbar:foofoo"));
+ DocumentUpdate docUp2(*_repo, _foobar_type, DocumentId("id:ns:foobar::barbar:foofoo"));
// fieldpath diff
FieldPathUpdate::CP assignUp1(new AssignFieldPathUpdate(*doc->getDataType(),
"structmap{here be dragons}", std::string(), fv4));
@@ -939,7 +939,7 @@ TEST_F(FieldPathUpdateTestCase, testEqualityComparison)
TEST_F(FieldPathUpdateTestCase, testAffectsDocumentBody)
{
- Document::UP doc(new Document(_foobar_type, DocumentId("doc:things:stuff")));
+ Document::UP doc(new Document(_foobar_type, DocumentId("id:ns:foobar::things:stuff")));
MapFieldValue mfv(doc->getType().getField("structmap").getDataType());
StructFieldValue fv4(dynamic_cast<const MapDataType&>(*mfv.getDataType()).getValueType());
@@ -948,7 +948,7 @@ TEST_F(FieldPathUpdateTestCase, testAffectsDocumentBody)
// structmap is body field
{
- DocumentUpdate docUp(*_repo, _foobar_type, DocumentId("doc:barbar:foofoo"));
+ DocumentUpdate docUp(*_repo, _foobar_type, DocumentId("id:ns:foobar::barbar:foofoo"));
FieldPathUpdate::CP update1(new AssignFieldPathUpdate(*doc->getDataType(),
"structmap{janitor}", std::string(), fv4));
@@ -958,7 +958,7 @@ TEST_F(FieldPathUpdateTestCase, testAffectsDocumentBody)
// strfoo is header field
{
- DocumentUpdate docUp(*_repo, _foobar_type, DocumentId("doc:barbar:foofoo"));
+ DocumentUpdate docUp(*_repo, _foobar_type, DocumentId("id:ns:foobar::barbar:foofoo"));
FieldPathUpdate::CP update1(new AssignFieldPathUpdate(*doc->getDataType(),
"strfoo", std::string(), StringFieldValue("helloworld")));
static_cast<AssignFieldPathUpdate&>(*update1).setCreateMissingPath(true);
@@ -969,10 +969,10 @@ TEST_F(FieldPathUpdateTestCase, testAffectsDocumentBody)
TEST_F(FieldPathUpdateTestCase, testIncompatibleDataTypeFails)
{
- Document::UP doc(new Document(_foobar_type, DocumentId("doc:things:stuff")));
+ Document::UP doc(new Document(_foobar_type, DocumentId("id:ns:foobar::things:stuff")));
MapFieldValue mfv(doc->getType().getField("structmap").getDataType());
- DocumentUpdate docUp(*_repo, _foobar_type, DocumentId("doc:barbar:foofoo"));
+ DocumentUpdate docUp(*_repo, _foobar_type, DocumentId("id:ns:foobar::barbar:foofoo"));
try {
FieldPathUpdate::CP update1(new AssignFieldPathUpdate(*doc->getDataType(), "structmap{foo}",
@@ -985,14 +985,14 @@ TEST_F(FieldPathUpdateTestCase, testIncompatibleDataTypeFails)
TEST_F(FieldPathUpdateTestCase, testSerializeAssign)
{
- Document::UP doc(new Document(_foobar_type, DocumentId("doc:weloveto:serializestuff")));
+ Document::UP doc(new Document(_foobar_type, DocumentId("id:ns:foobar::weloveto:serializestuff")));
MapFieldValue mfv(doc->getType().getField("structmap").getDataType());
StructFieldValue val(dynamic_cast<const MapDataType&>(*mfv.getDataType()).getValueType());
val.setValue("title", StringFieldValue("cool frog"));
val.setValue("rating", IntFieldValue(100));
- DocumentUpdate docUp(*_repo, _foobar_type, DocumentId("doc:barbar:foofoo"));
+ DocumentUpdate docUp(*_repo, _foobar_type, DocumentId("id:ns:foobar::barbar:foofoo"));
FieldPathUpdate::CP update1(new AssignFieldPathUpdate(*doc->getDataType(), "structmap{ribbit}", "true", val));
static_cast<AssignFieldPathUpdate&>(*update1).setCreateMissingPath(true);
@@ -1003,7 +1003,7 @@ TEST_F(FieldPathUpdateTestCase, testSerializeAssign)
TEST_F(FieldPathUpdateTestCase, testSerializeAdd)
{
- Document::UP doc(new Document(_foobar_type, DocumentId("doc:george:costanza")));
+ Document::UP doc(new Document(_foobar_type, DocumentId("id:ns:foobar::george:costanza")));
EXPECT_TRUE(doc->hasValue("strarray") == false);
ArrayFieldValue adds(doc->getType().getField("strarray").getDataType());
@@ -1011,7 +1011,7 @@ TEST_F(FieldPathUpdateTestCase, testSerializeAdd)
adds.add(StringFieldValue("a festivus for the rest of us"));
adds.add(StringFieldValue("george is getting upset!"));
- DocumentUpdate docUp(*_repo, _foobar_type, DocumentId("doc:barbar:foofoo"));
+ DocumentUpdate docUp(*_repo, _foobar_type, DocumentId("id:ns:foobar::barbar:foofoo"));
FieldPathUpdate::CP update1(new AddFieldPathUpdate(*doc->getDataType(), "strarray", std::string(), adds));
docUp.addFieldPathUpdate(update1);
@@ -1021,10 +1021,10 @@ TEST_F(FieldPathUpdateTestCase, testSerializeAdd)
TEST_F(FieldPathUpdateTestCase, testSerializeRemove)
{
- Document::UP doc(new Document(_foobar_type, DocumentId("doc:weloveto:serializestuff")));
+ Document::UP doc(new Document(_foobar_type, DocumentId("id:ns:foobar::weloveto:serializestuff")));
MapFieldValue mfv(doc->getType().getField("structmap").getDataType());
- DocumentUpdate docUp(*_repo, _foobar_type, DocumentId("doc:barbar:foofoo"));
+ DocumentUpdate docUp(*_repo, _foobar_type, DocumentId("id:ns:foobar::barbar:foofoo"));
FieldPathUpdate::CP update1(new RemoveFieldPathUpdate("structmap{ribbit}", std::string()));
docUp.addFieldPathUpdate(update1);
@@ -1034,11 +1034,11 @@ TEST_F(FieldPathUpdateTestCase, testSerializeRemove)
TEST_F(FieldPathUpdateTestCase, testSerializeAssignMath)
{
- Document::UP doc(new Document(_foobar_type, DocumentId("doc:bat:man")));
+ Document::UP doc(new Document(_foobar_type, DocumentId("id:ns:foobar::bat:man")));
EXPECT_TRUE(doc->hasValue("num") == false);
doc->setValue("num", IntFieldValue(34));
- DocumentUpdate docUp(*_repo, _foobar_type, DocumentId("doc:barbar:foofoo"));
+ DocumentUpdate docUp(*_repo, _foobar_type, DocumentId("id:ns:foobar::barbar:foofoo"));
docUp.addFieldPathUpdate(FieldPathUpdate::CP(new AssignFieldPathUpdate("num", "", "($value * 2) / $value")));
testSerialize(*_repo, docUp);
}
@@ -1047,7 +1047,7 @@ DocumentUpdate::UP
FieldPathUpdateTestCase::createDocumentUpdateForSerialization(const DocumentTypeRepo& repo)
{
const DocumentType *docType(repo.getDocumentType("serializetest"));
- DocumentUpdate::UP docUp(new DocumentUpdate(repo, *docType, DocumentId("doc:serialization:xlanguage")));
+ DocumentUpdate::UP docUp(new DocumentUpdate(repo, *docType, DocumentId("id:ns:serializetest::xlanguage")));
FieldPathUpdate::CP assign(new AssignFieldPathUpdate("intfield", "", "3"));
static_cast<AssignFieldPathUpdate&>(*assign).setRemoveIfZero(true);
diff --git a/document/src/tests/fieldsettest.cpp b/document/src/tests/fieldsettest.cpp
index 0297e7bdda4..b0cad61b72a 100644
--- a/document/src/tests/fieldsettest.cpp
+++ b/document/src/tests/fieldsettest.cpp
@@ -169,7 +169,7 @@ FieldSetTest::doCopyFields(const Document& src,
const std::string& fieldSetStr,
Document* dest) const
{
- Document destDoc(src.getType(), DocumentId("doc:test:fieldsdest"));
+ Document destDoc(src.getType(), DocumentId("id:ns:" + src.getType().getName() + "::fieldset"));
if (!dest) {
dest = &destDoc;
}
@@ -195,7 +195,7 @@ Document::UP
FieldSetTest::createTestDocument(const TestDocMan& testDocMan) const
{
Document::UP doc(testDocMan.createDocument("megafoo megabar",
- "doc:test:fieldssrc",
+ "id:ns:testdoctype1::1",
"testdoctype1"));
doc->setValue(doc->getField("headerval"), IntFieldValue(5678));
doc->setValue(doc->getField("hstringval"),
@@ -225,7 +225,7 @@ TEST_F(FieldSetTest, testCopyDocumentFields)
doCopyFields(*src, repo, "testdoctype1:hstringval,content"));
// Test that we overwrite already set fields in destination document
{
- Document dest(src->getType(), DocumentId("doc:foo:bar"));
+ Document dest(src->getType(), DocumentId("id:ns:" + src->getType().getName() + "::bar"));
dest.setValue(dest.getField("content"), StringFieldValue("overwriteme"));
EXPECT_EQ(std::string("content: megafoo megabar\n"),
doCopyFields(*src, repo, "[body]", &dest));
diff --git a/document/src/tests/fieldvalue/referencefieldvalue_test.cpp b/document/src/tests/fieldvalue/referencefieldvalue_test.cpp
index d34bbff8a54..17fb5ac74e6 100644
--- a/document/src/tests/fieldvalue/referencefieldvalue_test.cpp
+++ b/document/src/tests/fieldvalue/referencefieldvalue_test.cpp
@@ -23,8 +23,8 @@ struct Fixture {
~Fixture();
};
- Fixture::Fixture() { }
- Fixture::~Fixture() { }
+ Fixture::Fixture() = default;
+ Fixture::~Fixture() = default;
}
using vespalib::IllegalArgumentException;
@@ -60,17 +60,6 @@ TEST_F("Exception is thrown if constructor doc ID type does not match referenced
"to reference of document type 'foo'");
}
-TEST_F("Exception is thrown if doc ID does not have a type", Fixture) {
- // Could have had a special cased message for this, but type-less IDs are
- // not expected to be allowed through the feed pipeline at all. We just
- // want to ensure it fails in a controlled fashion if encountered.
- EXPECT_EXCEPTION(
- ReferenceFieldValue(f.refType, DocumentId("doc:foo:bario")),
- IllegalArgumentException,
- "Can't assign document ID 'doc:foo:bario' (of type '') "
- "to reference of document type 'foo'");
-}
-
TEST_F("assign()ing a non-reference field value throws exception", Fixture) {
ReferenceFieldValue fv(f.refType);
EXPECT_EXCEPTION(fv.assign(StringFieldValue("waluigi time!!")),
diff --git a/document/src/tests/globalidtest.cpp b/document/src/tests/globalidtest.cpp
index ab2af875e9f..f612b9e341c 100644
--- a/document/src/tests/globalidtest.cpp
+++ b/document/src/tests/globalidtest.cpp
@@ -88,9 +88,9 @@ TEST_F(GlobalIdTest, testBucketIdConversion)
verifyDocumentId("id:ns:test:n=1000:abc");
verifyDocumentId("id:hsgf:test:n=18446744073700000000:dfdfsdfg");
verifyDocumentId("id:ns:mytype:g=somegroup:hmm");
- verifyDocumentId("doc::test");
- verifyDocumentId("doc:myns:http://foo.bar");
- verifyDocumentId("doc:jsrthsdf:a234aleingzldkifvasdfgadf");
+ verifyDocumentId("id:ns:test::");
+ verifyDocumentId("id:myns:test::http://foo.bar");
+ verifyDocumentId("id:ns:test::jsrthsdf:a234aleingzldkifvasdfgadf");
}
void
@@ -155,7 +155,7 @@ TEST_F(GlobalIdTest, testGidRangeConversion)
}
uint32_t scheme = randomizer.nextUint32(0, 2);
switch (scheme) {
- case 0: ost << "doc:" << name_space.str() << ":";
+ case 0: ost << "id:" << name_space.str() << ":mytype::";
break;
case 1: ost << "id:" << name_space.str() << ":mytype:n=";
ost << randomizer.nextUint32() << ":";
diff --git a/document/src/tests/serialization/vespadocumentserializer_test.cpp b/document/src/tests/serialization/vespadocumentserializer_test.cpp
index b83c59fdaec..98a03b0ac89 100644
--- a/document/src/tests/serialization/vespadocumentserializer_test.cpp
+++ b/document/src/tests/serialization/vespadocumentserializer_test.cpp
@@ -33,11 +33,9 @@
#include <vespa/document/repo/configbuilder.h>
#include <vespa/document/repo/fixedtyperepo.h>
#include <vespa/document/repo/documenttyperepo.h>
-#include <vespa/document/serialization/util.h>
#include <vespa/document/serialization/vespadocumentdeserializer.h>
#include <vespa/document/serialization/vespadocumentserializer.h>
#include <vespa/document/serialization/annotationserializer.h>
-#include <vespa/eval/tensor/types.h>
#include <vespa/eval/tensor/tensor.h>
#include <vespa/eval/tensor/default_tensor_engine.h>
#include <vespa/vespalib/io/fileutil.h>
@@ -63,12 +61,12 @@ using namespace document::config_builder;
namespace {
const int doc_type_id = 1234;
-const string doc_name = "my document";
+const string doc_name = "my_doctype";
const int body_id = 94;
const int inner_type_id = 95;
const int outer_type_id = 96;
-const string type_name = "outer doc";
-const string inner_name = "inner doc";
+const string type_name = "outer_doc";
+const string inner_name = "inner_doc";
const int a_id = 12345;
const string a_name = "annotation";
const int predicate_doc_type_id = 321;
@@ -83,9 +81,9 @@ constexpr uint16_t serialization_version = Document::getNewestSerializationVersi
DocumenttypesConfig getDocTypesConfig() {
DocumenttypesConfigBuilderHelper builder;
builder.document(doc_type_id, doc_name,
- Struct("my document.header")
+ Struct(doc_name + ".header")
.addField("header field", DataType::T_INT),
- Struct("my document.body")
+ Struct(doc_name + ".body")
.addField("body field", DataType::T_STRING))
.annotationType(42, "foo_type", DataType::T_INT);
builder.document(inner_type_id, inner_name,
@@ -576,7 +574,7 @@ template <typename T, int N> int arraysize(const T (&)[N]) { return N; }
TEST("requireThatDocumentCanBeSerialized") {
const DocumentType &type = repo.getDocumentType();
- DocumentId doc_id("doc::testdoc");
+ DocumentId doc_id("id:ns:" + type.getName() + "::");
Document value(type, doc_id);
value.setValue(type.getField("header field"), IntFieldValue(42));
@@ -589,7 +587,7 @@ TEST("requireThatDocumentCanBeSerialized") {
uint32_t size;
stream >> read_version >> size;
EXPECT_EQUAL(serialization_version, read_version);
- EXPECT_EQUAL(65u, size);
+ EXPECT_EQUAL(70u, size);
EXPECT_EQUAL(doc_id.getScheme().toString(), stream.peek());
stream.adjustReadPos(doc_id.getScheme().toString().size() + 1);
uint8_t content_code;
@@ -604,7 +602,7 @@ TEST("requireThatDocumentCanBeSerialized") {
TEST("requireThatOldVersionDocumentCanBeDeserialized") {
uint16_t old_version = 6;
uint16_t data_size = 432;
- string doc_id = "doc::testdoc";
+ string doc_id = "id:ns:my_doctype::";
uint8_t content_code = 0x01;
uint32_t crc = 42;
@@ -628,19 +626,19 @@ TEST("requireThatUnmodifiedDocumentRetainsUnknownFieldOnSerialization") {
DocumenttypesConfigBuilderHelper builder1, builder2;
builder1.document(doc_type_id, doc_name,
- Struct("my document.header")
+ Struct("my_doctype.header")
.addField("field2", DataType::T_STRING),
- Struct("my document.body"));
+ Struct("my_doctype.body"));
builder2.document(doc_type_id, doc_name,
- Struct("my document.header")
+ Struct("my_doctype.header")
.addField("field1", DataType::T_INT)
.addField("field2", DataType::T_STRING),
- Struct("my document.body"));
+ Struct("my_doctype.body"));
DocumentTypeRepo repo1Field(builder1.config());
DocumentTypeRepo repo2Fields(builder2.config());
- DocumentId doc_id("doc::testdoc");
+ DocumentId doc_id("id:ns:my_doctype::");
Document value(*repo2Fields.getDocumentType(doc_type_id), doc_id);
value.setValue("field1", IntFieldValue(42));
@@ -684,21 +682,20 @@ TEST("requireThatDocumentWithDocumentCanBeSerialized") {
const DocumentTypeRepo &my_repo = repo.getDocumentTypeRepo();
const DocumentType *inner_type = my_repo.getDocumentType(inner_type_id);
ASSERT_TRUE(inner_type);
- const AnnotationType *a_type =
- my_repo.getAnnotationType(*inner_type, a_id);
+ const AnnotationType *a_type =my_repo.getAnnotationType(*inner_type, a_id);
StringFieldValue str("foo");
- SpanTree::UP tree(new SpanTree("name", Span::UP(new Span(0, 3))));
- tree->annotate(Annotation::UP(new Annotation(*a_type)));
+ auto tree = std::make_unique<SpanTree>("name", std::make_unique<Span>(0, 3));
+ tree->annotate(std::make_unique<Annotation>(*a_type));
setSpanTree(str, *tree);
const Field str_field("str", *DataType::STRING, false);
- Document inner(*inner_type, DocumentId("doc::in"));
+ Document inner(*inner_type, DocumentId("id:ns:" + inner_type->getName() + "::"));
inner.setValue(str_field, str);
const DocumentType *type = my_repo.getDocumentType(outer_type_id);
ASSERT_TRUE(type);
- DocumentId doc_id("doc::testdoc");
+ DocumentId doc_id("id:ns:" + type->getName() + "::");
Document value(*type, doc_id);
const Field doc_field(inner_name, *inner_type, false);
value.setValue(doc_field, inner);
@@ -1040,8 +1037,7 @@ TEST_F("Empty ReferenceFieldValue can be roundtrip serialized", RefFixture) {
}
TEST_F("ReferenceFieldValue with ID can be roundtrip serialized", RefFixture) {
- ReferenceFieldValue ref_with_id(
- f.ref_type(), DocumentId("id:ns:" + doc_name + "::foo"));
+ ReferenceFieldValue ref_with_id(f.ref_type(), DocumentId("id:ns:" + doc_name + "::foo"));
nbostream stream;
serializeAndDeserialize(ref_with_id, stream, f.fixed_repo);
}
@@ -1055,8 +1051,7 @@ TEST_F("Empty ReferenceFieldValue has changed-flag cleared after deserialization
}
TEST_F("ReferenceFieldValue with ID has changed-flag cleared after deserialization", RefFixture) {
- ReferenceFieldValue src(
- f.ref_type(), DocumentId("id:ns:" + doc_name + "::foo"));
+ ReferenceFieldValue src(f.ref_type(), DocumentId("id:ns:" + doc_name + "::foo"));
ReferenceFieldValue dest(f.ref_type());
f.roundtrip_serialize(src, dest);
@@ -1069,14 +1064,13 @@ TEST_F("Empty ReferenceFieldValue serialization matches Java", RefFixture) {
}
TEST_F("ReferenceFieldValue with ID serialization matches Java", RefFixture) {
- ReferenceFieldValue value(
- f.ref_type(), DocumentId("id:ns:" + doc_name + "::bar"));
+ ReferenceFieldValue value(f.ref_type(), DocumentId("id:ns:" + doc_name + "::bar"));
f.verify_cross_language_serialization("reference_with_id", value);
}
struct AssociatedDocumentRepoFixture {
const DocumentType& doc_type{repo.getDocumentType()};
- DocumentId doc_id{"doc::testdoc"};
+ DocumentId doc_id{"id:ns:" + doc_type.getName() + "::"};
Document source_doc{doc_type, doc_id};
std::unique_ptr<Document> roundtrip_serialize_source_document() {
diff --git a/document/src/tests/struct_anno/document.dat b/document/src/tests/struct_anno/document.dat
index 243b5f05a92..2a372d19f10 100644
--- a/document/src/tests/struct_anno/document.dat
+++ b/document/src/tests/struct_anno/document.dat
Binary files differ
diff --git a/document/src/tests/testxml.cpp b/document/src/tests/testxml.cpp
index cf1c783e582..e6c8716b251 100644
--- a/document/src/tests/testxml.cpp
+++ b/document/src/tests/testxml.cpp
@@ -24,7 +24,7 @@ Document::UP createTestDocument(const DocumentTypeRepo& repo)
const DocumentType* type(repo.getDocumentType("testdoc"));
Document::UP
doc(new Document(*type,
- DocumentId("doc:crawler/http://www.ntnu.no/")));
+ DocumentId("id:ns:testdoc::crawler/http://www.ntnu.no/")));
doc->setRepo(repo);
std::string s("humlepungens buffer");
ByteBuffer bb(s.c_str(), s.size());
@@ -48,7 +48,7 @@ Document::UP createTestDocument(const DocumentTypeRepo& repo)
doc->setValue(doc->getField("rawarrayattr"), val);
Document::UP doc2(new Document(*type, DocumentId(
- "doc:crawler/http://www.ntnu.no/2")));
+ "id:ns:testdoc::crawler/http://www.ntnu.no/2")));
doc2->setValue(doc2->getField("stringattr"), StringFieldValue("tjo hei paa du"));
doc->setValue(doc->getField("docfield"), *doc2);
@@ -59,7 +59,7 @@ DocumentUpdate::UP
createTestDocumentUpdate(const DocumentTypeRepo& repo)
{
const DocumentType* type(repo.getDocumentType("testdoc"));
- DocumentId id("doc:crawler/http://www.ntnu.no/");
+ DocumentId id("id:ns:testdoc::crawler/http://www.ntnu.no/");
DocumentUpdate::UP up(new DocumentUpdate(repo, *type, id));
up->addUpdate(FieldUpdate(type->getField("intattr"))
@@ -86,7 +86,7 @@ TEST(TestXml, testSimpleUsage)
doc1->setValue(doc1->getField("stringattr"), StringFieldValue("tjohei���"));
std::string expected =
- "<document documenttype=\"testdoc\" documentid=\"doc:crawler/http://www.ntnu.no/\">\n"
+ "<document documenttype=\"testdoc\" documentid=\"id:ns:testdoc::crawler/http://www.ntnu.no/\">\n"
" <doubleattr>17.7862</doubleattr>\n"
" <intattr>50</intattr>\n"
" <floatattr>3.56</floatattr>\n"
@@ -100,7 +100,7 @@ TEST(TestXml, testSimpleUsage)
" <rawattr binaryencoding=\"base64\">cmVhZGFibA==</rawattr>\n"
" <stringattr>tjohei���</stringattr>\n"
" <docfield>\n"
- " <document documenttype=\"testdoc\" documentid=\"doc:crawler/http://www.ntnu.no/2\">\n"
+ " <document documenttype=\"testdoc\" documentid=\"id:ns:testdoc::crawler/http://www.ntnu.no/2\">\n"
" <stringattr>tjo hei paa du</stringattr>\n"
" </document>\n"
" </docfield>\n"
@@ -114,7 +114,7 @@ TEST(TestXml, testDocumentUpdate)
DocumentUpdate::UP up1(createTestDocumentUpdate(repo));
std::string expected =
- "<document type=\"testdoc\" id=\"doc:crawler/http://www.ntnu.no/\">\n"
+ "<document type=\"testdoc\" id=\"id:ns:testdoc::crawler/http://www.ntnu.no/\">\n"
" <alter field=\"intattr\">\n"
" <assign>7</assign>\n"
" </alter>\n"
diff --git a/document/src/tests/vespaxml/fieldpathupdates.xml b/document/src/tests/vespaxml/fieldpathupdates.xml
index 3b81aaf4ba2..6c9719a86b9 100755..100644
--- a/document/src/tests/vespaxml/fieldpathupdates.xml
+++ b/document/src/tests/vespaxml/fieldpathupdates.xml
@@ -1,6 +1,6 @@
<!-- Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -->
<vespafeed>
- <update documenttype="news" documentid="doc:test:http://www.ntnu.no/">
+ <update documenttype="news" documentid="id:ns:news::http://www.ntnu.no/">
<assign fieldpath="url">assignUrl</assign>
<assign fieldpath="title">assignTitle</assign>
<assign fieldpath="last_downloaded">1</assign>
diff --git a/document/src/tests/vespaxml/test1.expected.xml b/document/src/tests/vespaxml/test1.expected.xml
deleted file mode 100644
index 198ed29690d..00000000000
--- a/document/src/tests/vespaxml/test1.expected.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-<!-- Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -->
-<document documenttype="news" documentid="doc:crawler:http://www.ntnu.no/">
- <title>TestTitle</title>
- <last_downloaded>100</last_downloaded>
-</document>
diff --git a/document/src/tests/vespaxml/test1.xml b/document/src/tests/vespaxml/test1.xml
deleted file mode 100644
index 1ec09a0b61f..00000000000
--- a/document/src/tests/vespaxml/test1.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<!-- Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -->
-<vespafeed>
- <vespaadd idprefix="doc:crawler:">
- <document documenttype="news" documentid="http://www.ntnu.no/">
- <title>TestTitle</title>
- <last_downloaded>100</last_downloaded>
- </document>
- </vespaadd>
-</vespafeed>
diff --git a/document/src/tests/vespaxml/test10.xml b/document/src/tests/vespaxml/test10.xml
deleted file mode 100644
index 832734faf48..00000000000
--- a/document/src/tests/vespaxml/test10.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<!-- Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -->
-<vespafeed>
- <vespaadd>
- <document type="news" id="doc:crawler/http://www.ntnu.no/">
- <title>Test<Title</title>
- <last_downloaded>hundred</last_downloaded>
- </document>
- </vespaadd>
-</vespafeed>
diff --git a/document/src/tests/vespaxml/test11.xml b/document/src/tests/vespaxml/test11.xml
deleted file mode 100644
index 10daff34be3..00000000000
--- a/document/src/tests/vespaxml/test11.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -->
-<vespafeed>
- <vesparemove>
- <document type="news" id="doc:crawler/http://www.ntnu���.no/">
- </document>
- </vesparemove>
-</vespafeed>
diff --git a/document/src/tests/vespaxml/test12.xml b/document/src/tests/vespaxml/test12.xml
deleted file mode 100644
index 3bfd2658404..00000000000
--- a/document/src/tests/vespaxml/test12.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<!-- Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -->
-<vespafeed>
- <vespaadd>
- <document type="news" id="doc:crawler/http://www.ntnu.no/">
- <title></title>
- <last_downloaded></last_downloaded>
- </document>
- </vespaadd>
-</vespafeed>
diff --git a/document/src/tests/vespaxml/test13.xml b/document/src/tests/vespaxml/test13.xml
deleted file mode 100644
index 4e55558abc6..00000000000
--- a/document/src/tests/vespaxml/test13.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-<!-- Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -->
-<vespafeed>
- <document type="news" id="doc:crawler:http://www.ntnu.no/">
- <title>TestTitle</title>
- <last_downloaded>100</last_downloaded>
- </document>
-</vespa>
diff --git a/document/src/tests/vespaxml/test14.xml b/document/src/tests/vespaxml/test14.xml
deleted file mode 100644
index 8b345f8c654..00000000000
--- a/document/src/tests/vespaxml/test14.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<!-- Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -->
-<vespafeed>
- <vespaadd>
- <document type="news" id="doc:crawler/http://www.ntnu.no/">
- <last_downloaded>123</last_downloaded>
- </doc>
- </vespaadd>
-</vespafeed>
diff --git a/document/src/tests/vespaxml/test15.xml b/document/src/tests/vespaxml/test15.xml
deleted file mode 100644
index 32707f1636b..00000000000
--- a/document/src/tests/vespaxml/test15.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<!-- Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -->
-<vespafeed>
- <vespaadd>
- <document type="news" id="doc:crawler/http://www.ntnu.no/">
- <title>TestTitle</tit>
- </document>
- </vespaadd>
-</vespafeed>
diff --git a/document/src/tests/vespaxml/test16.xml b/document/src/tests/vespaxml/test16.xml
deleted file mode 100644
index 3b3179446e9..00000000000
--- a/document/src/tests/vespaxml/test16.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -->
-<vespafeed>
- <vespaadd>
- <documentid type="news" id="doc:crawler:http://www.ntnu.no/">
- </documentid>
- </vespaadd>
-</vespafeed>
diff --git a/document/src/tests/vespaxml/test17.xml b/document/src/tests/vespaxml/test17.xml
deleted file mode 100644
index aefcc5708e7..00000000000
--- a/document/src/tests/vespaxml/test17.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<!-- Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -->
- <vespaadd>
- <document type="news" id="doc:crawler/http://www.ntnu.no/1">
- </document>
- </vespaadd>
- <vespaadd>
- <document type="news" id="doc:crawler/http://www.ntnu.no/2">
- </document>
- </vespaadd>
diff --git a/document/src/tests/vespaxml/test18.xml b/document/src/tests/vespaxml/test18.xml
deleted file mode 100644
index 852dd55c134..00000000000
--- a/document/src/tests/vespaxml/test18.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<!-- Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -->
-<vespafeed>
- <vespaadd>
- <document type="article" id="doc:crawler/http://www.ntnu.no/">
- <title>TestTitle</title>
- <last_downloaded>100</last_downloaded>
- </document>
- </vespaadd>
-</vespafeed>
diff --git a/document/src/tests/vespaxml/test2.expected.xml b/document/src/tests/vespaxml/test2.expected.xml
deleted file mode 100644
index 198ed29690d..00000000000
--- a/document/src/tests/vespaxml/test2.expected.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-<!-- Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -->
-<document documenttype="news" documentid="doc:crawler:http://www.ntnu.no/">
- <title>TestTitle</title>
- <last_downloaded>100</last_downloaded>
-</document>
diff --git a/document/src/tests/vespaxml/test2.xml b/document/src/tests/vespaxml/test2.xml
deleted file mode 100644
index 8194fb1de5e..00000000000
--- a/document/src/tests/vespaxml/test2.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-<!-- Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -->
-<vespafeed>
- <document documenttype="news" documentid="doc:crawler:http://www.ntnu.no/">
- <title>TestTitle</title>
- <last_downloaded>100</last_downloaded>
- </document>
-</vespafeed>
diff --git a/document/src/tests/vespaxml/test20.xml b/document/src/tests/vespaxml/test20.xml
deleted file mode 100644
index ca502100f67..00000000000
--- a/document/src/tests/vespaxml/test20.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<!-- Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -->
-<vespafeed>
- <endoffeed>
- <name>default</name>
- <generations>10</generations>
- <increment>11</increment>
- </endoffeed>
-</vespafeed>
diff --git a/document/src/tests/vespaxml/test21.xml b/document/src/tests/vespaxml/test21.xml
deleted file mode 100644
index 45ef52a3e67..00000000000
--- a/document/src/tests/vespaxml/test21.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<!-- Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -->
-<vespafeed>
- <vespaadd>
- <document type="news" id="doc:crawler/http://www.ntnu.no/">
- <title>TestTitle</title>
- <last_downloaded>21474836480</last_downloaded>
- </document>
- </vespaadd>
-</vespafeed>
diff --git a/document/src/tests/vespaxml/test22.xml b/document/src/tests/vespaxml/test22.xml
deleted file mode 100644
index c9f5a0af841..00000000000
--- a/document/src/tests/vespaxml/test22.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<!-- Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -->
-<vespafeed>
- <vespaadd>
- <document type="news" id="doc:crawler:http://www.ntnu.no/">
- <title>TestTitle</title>
- <value_long>9223372036854775807</value_long>
- </document>
- </vespaadd>
-</vespafeed>
diff --git a/document/src/tests/vespaxml/test23.xml b/document/src/tests/vespaxml/test23.xml
deleted file mode 100644
index e052c3f2c7f..00000000000
--- a/document/src/tests/vespaxml/test23.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<!-- Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -->
-<vespafeed>
- <vespaadd>
- <document type="news" id="doc:crawler:http://www.ntnu.no/">
- <title>TestTitle</title>
- <value_long>-9223372036854775807</value_long>
- </document>
- </vespaadd>
-</vespafeed>
diff --git a/document/src/tests/vespaxml/test24.xml b/document/src/tests/vespaxml/test24.xml
deleted file mode 100644
index 3d36eea7dc8..00000000000
--- a/document/src/tests/vespaxml/test24.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<!-- Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -->
-<vespafeed>
- <vespaadd>
- <document type="news" id="doc:crawler:http://www.ntnu.no/">
- <title>TestTitle</title>
- <value_long>18446744073709551615</value_long>
- </document>
- </vespaadd>
-</vespafeed>
diff --git a/document/src/tests/vespaxml/test25.xml b/document/src/tests/vespaxml/test25.xml
deleted file mode 100644
index 9a499195a6b..00000000000
--- a/document/src/tests/vespaxml/test25.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<!-- Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -->
-<vespafeed>
- <vespaadd>
- <document type="news" id="doc:crawler/http://www.ntnu.no/">
- <title>TestTitle</title>
- <value_long>18446744073709551616</value_long>
- </document>
- </vespaadd>
-</vespafeed>
diff --git a/document/src/tests/vespaxml/test26.xml b/document/src/tests/vespaxml/test26.xml
deleted file mode 100644
index 2d6ae226c68..00000000000
--- a/document/src/tests/vespaxml/test26.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<!-- Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -->
-<vespafeed>
- <vespaadd>
- <document type="news" id="doc:crawler:http://www.ntnu.no/">
- <title>TestTitle</title>
- <last_downloaded>0x123</last_downloaded>
- </document>
- </vespaadd>
-</vespafeed>
diff --git a/document/src/tests/vespaxml/test27.xml b/document/src/tests/vespaxml/test27.xml
deleted file mode 100644
index f8adb8b11f8..00000000000
--- a/document/src/tests/vespaxml/test27.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<!-- Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -->
-<vespafeed>
- <vespaadd>
- <document type="news" id="doc:crawler/http://www.ntnu.no/">
- <title>TestTitle</title>
- <last_downloaded>0x123</last_downloaded>
- </document>
- </vespaadd>
-</vespafeed>
diff --git a/document/src/tests/vespaxml/test28.xml b/document/src/tests/vespaxml/test28.xml
deleted file mode 100644
index 929ba7415d0..00000000000
--- a/document/src/tests/vespaxml/test28.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-<!-- Test content -->
-<!-- Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -->
-<vespafeed>
- <vespaadd>
- <document type="news" id="doc:crawler:http://www.ntnu.no/">
- <title>TestTitleContent</title>
- <value_content contenttype="text/html" encoding="utf-8" language="en"><![CDATA[<html><body><h1>This is the title</h1></body></html>]]></value_content>
- </document>
- </vespaadd>
-</vespafeed>
diff --git a/document/src/tests/vespaxml/test29.xml b/document/src/tests/vespaxml/test29.xml
deleted file mode 100644
index 1b863e5637e..00000000000
--- a/document/src/tests/vespaxml/test29.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<!-- Test field attribute -->
-<!-- Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -->
-<vespafeed>
- <vespaadd>
- <document type="news">
- <field name="uri">doc:crawler:http://www.ntnu.no/</field>
- <field name="title">TestTitleContent</field>
- <field name="value_content" contenttype="text/html" encoding="UTF-8" language="NO">This is content</field>
- <last_downloaded>345</last_downloaded>
- </document>
- <document type="news">
- <field name="uri">doc:crawler:http://www.ntnu.no/2</field>
- <field name="title">TestTitleContent2</field>
- <field name="value_content">This is content2</field>
- <last_downloaded>345</last_downloaded>
- </document>
- </vespaadd>
-</vespafeed>
diff --git a/document/src/tests/vespaxml/test3.xml b/document/src/tests/vespaxml/test3.xml
deleted file mode 100644
index f328115b5ca..00000000000
--- a/document/src/tests/vespaxml/test3.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<!-- Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -->
-<vespafeed>
- <vesparemove idprefix="doc:crawler:">
- <documentid type="news">
- <uri>http://www.ntnu.no/</uri>
- <last_downloaded></last_downloaded>
- </documentid>
- </vesparemove>
-</vespafeed>
diff --git a/document/src/tests/vespaxml/test30.xml b/document/src/tests/vespaxml/test30.xml
deleted file mode 100644
index fa24e99cd83..00000000000
--- a/document/src/tests/vespaxml/test30.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-<!-- Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -->
-<vespafeed xmlns:xsd="http://www.w3.org/2001/XMLSchema-datatypes"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <vespaadd>
- <document type="news" id="doc:crawler:http://www.ntnu.no/">
- <title xsi:type="xsd:hexBinary">E5AEB6E59BADE3808220044BE680AC</title>
- <last_downloaded>100</last_downloaded>
- </document>
- <document type="news" id="doc:crawler:http://www.ntnu.org/">
- <title xsi:type="xsd:base64Binary">5a625Zut44CCIARL5oCs</title>
- <last_downloaded>100</last_downloaded>
- </document>
- </vespaadd>
-</vespafeed>
-
diff --git a/document/src/tests/vespaxml/test32.xml b/document/src/tests/vespaxml/test32.xml
deleted file mode 100644
index 53993f57d19..00000000000
--- a/document/src/tests/vespaxml/test32.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -->
-<vespafeed>
- <vesparemove>
- <documentid id="doc:crawler:http://www.ntnu���.no/"/>
- </vesparemove>
-</vespafeed>
diff --git a/document/src/tests/vespaxml/test33.xml b/document/src/tests/vespaxml/test33.xml
deleted file mode 100644
index d63c059aa6e..00000000000
--- a/document/src/tests/vespaxml/test33.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -->
-<vespafeed>
- <vesparemove>
- <documentid>
- <uri>http://www.ntnu.no/</uri>
- </documentid>
- </vesparemove>
-</vespafeed>
diff --git a/document/src/tests/vespaxml/test34.xml b/document/src/tests/vespaxml/test34.xml
deleted file mode 100644
index 384c7ae8111..00000000000
--- a/document/src/tests/vespaxml/test34.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -->
-<vespafeed>
- <vesparemove>
- <documentid id="http://www.ntnu.no/"/>
- </vesparemove>
-</vespafeed>
diff --git a/document/src/tests/vespaxml/test35.xml b/document/src/tests/vespaxml/test35.xml
deleted file mode 100644
index e69f032ef49..00000000000
--- a/document/src/tests/vespaxml/test35.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<!-- Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -->
-<vespafeed>
- <vespaadd>
- <document type="news" id="doc:crawler:http://www.ntnu.no/">
- <title binaryencoding="base64">VmVzcGEgcnVsZXM=</title>
- <last_downloaded>100</last_downloaded>
- </document>
- </vespaadd>
-</vespafeed>
diff --git a/document/src/tests/vespaxml/test36.xml b/document/src/tests/vespaxml/test36.xml
deleted file mode 100644
index bfd4547b6c8..00000000000
--- a/document/src/tests/vespaxml/test36.xml
+++ /dev/null
@@ -1,43 +0,0 @@
-<!-- Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -->
-<vespafeed>
- <vespaadd idprefix="doc:crawler:">
- <document type="news" id="http://www.ntnu.no/1">
- <title>TestTitle1</title>
- <last_downloaded>100</last_downloaded>
- <stringarr>
- <item>one</item>
- <item>two</item>
- <item>three</item>
- <item>four</item>
- <item>five</item>
- </stringarr>
- <intarr>
- <item>1</item>
- <item>2</item>
- <item>3</item>
- <item>4</item>
- <item>5</item>
- </intarr>
- </document>
- <document type="news" id="http://www.ntnu.no/2">
- <title>TestTitle2</title>
- <intarr>
- <item>o1</item>
- </intarr>
- </document>
- <document type="news" id="http://www.ntnu.no/3">
- <title>TestTitle3</title>
- <intarr>
- <tem>1</tem>
- </intarr>
- </document>
- <document type="news" id="http://www.ntnu.no/4">
- <title>TestTitle4</title>
- <intarr></intarr>
- </document>
- <document type="news" id="http://www.ntnu.no/5">
- <title>TestTitle5</title>
- <intarr>1</intarr>
- </document>
- </vespaadd>
-</vespafeed>
diff --git a/document/src/tests/vespaxml/test37.xml b/document/src/tests/vespaxml/test37.xml
deleted file mode 100644
index 8993dd99640..00000000000
--- a/document/src/tests/vespaxml/test37.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<!-- Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -->
-<vespafeed>
- <vespaadd idprefix="doc:crawler:">
- <document type="news" id="http://www.ntnu.no/1">
- <title>TestTitle1</title>
- <last_downloaded>100</last_downloaded>
- <weightedsetstring>
- <item>one</item>
- <item>two</item>
- <item>three</item>
- <item>four</item>
- <item>five</item>
- </weightedsetstring>
- <weightedsetint>
- <item>1</item>
- <item>2</item>
- <item>3</item>
- <item>4</item>
- <item>5</item>
- </weightedsetint>
- </document>
- </vespaadd>
-</vespafeed>
diff --git a/document/src/tests/vespaxml/test4.xml b/document/src/tests/vespaxml/test4.xml
deleted file mode 100644
index 8a4777344d6..00000000000
--- a/document/src/tests/vespaxml/test4.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<!-- Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -->
-<vespafeed>
-
- <vespaadd idprefix="doc:crawler:">
- <document type="news" id="http://www.uio.no/">
- <title>TestTitle</title>
- <last_downloaded>100</last_downloaded>
- </document>
-
- <document type="news" id="http://www.dagbladet.no/">
- <title>Title2</title>
- <last_downloaded>100</last_downloaded>
- </document>
- </vespaadd>
-
- <vespaadd>
- <document type="news" id="doc:crawler2:http://www.vg.no/">
- <title>Title2</title>
- <last_downloaded>100</last_downloaded>
- </document>
- </vespaadd>
-
-</vespafeed>
diff --git a/document/src/tests/vespaxml/test40.xml b/document/src/tests/vespaxml/test40.xml
deleted file mode 100644
index 68210920df2..00000000000
--- a/document/src/tests/vespaxml/test40.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-<!-- Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -->
-<vespafeed>
- <update documenttype="news" documentid="doc:crawler:http://www.ntnu.no/">
- <assign field="title">TestTitle</assign>
- </update>
-</vespafeed>
diff --git a/document/src/tests/vespaxml/test41.xml b/document/src/tests/vespaxml/test41.xml
deleted file mode 100644
index b92c2e586a8..00000000000
--- a/document/src/tests/vespaxml/test41.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<!-- Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -->
-<vespafeed>
- <update documenttype="news" documentid="doc:crawler:http://www.ntnu.no/">
- <assign field="stringarr">
- <item>First</item>
- <item>Second</item>
- </assign>
- <add field="stringarr">
- <item>Third</item>
- <item>Fourth</item>
- </add>
- <remove field="stringarr">
- <item>Fifth</item>
- <item>Sixth</item>
- </remove>
- <assign field="intarr">
- <item>100</item>
- <item>200</item>
- </assign>
- <assign field="intarr"></assign>
- </update>
-</vespafeed>
diff --git a/document/src/tests/vespaxml/test42.xml b/document/src/tests/vespaxml/test42.xml
deleted file mode 100644
index 479509776fa..00000000000
--- a/document/src/tests/vespaxml/test42.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<!-- Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -->
-<vespafeed>
- <update documenttype="news" documentid="doc:crawler:http://www.ntnu.no/">
- <assign field="weightedsetstring">
- <item weight="1">First</item>
- <item weight="2">Second</item>
- </assign>
- <add field="weightedsetstring">
- <item weight="3">Third</item>
- <item weight="4">Fourth</item>
- </add>
- <remove field="weightedsetstring">
- <item>Fifth</item>
- <item>Sixth</item>
- </remove>
- <assign field="weightedsetint">
- <item weight="1">100</item>
- <item weight="2">200</item>
- </assign>
- <assign field="weightedsetint"></assign>
- </update>
-</vespafeed>
diff --git a/document/src/tests/vespaxml/test43.xml b/document/src/tests/vespaxml/test43.xml
deleted file mode 100644
index 874deada10c..00000000000
--- a/document/src/tests/vespaxml/test43.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<!-- Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -->
-<vespafeed>
- <document documenttype="news" documentid="doc:crawler:http://www.ntnu.no/">
- <value_long>1008</value_long>
- <weightedsetstring>
- <item weight="1">First</item>
- <item weight="2">Second</item>
- </weightedsetstring>
- </document>
- <update documenttype="news" documentid="doc:crawler:http://www.ntnu.no/">
- <increment field="value_long" by="1" />
- <decrement field="value_long" by="2" />
- <divide field="value_long" by="3" />
- <multiply field="value_long" by="4" />
- </update>
- <update documenttype="news" documentid="doc:crawler:http://www.ntnu.no/">
- <alter field="value_long">
- <increment by="5" />
- <decrement by="6" />
- </alter>
- <alter field="value_long">
- <divide by="7" />
- <multiply by="8" />
- </alter>
- </update>
- <update documenttype="news" documentid="doc:crawler:http://www.ntnu.no/">
- <increment field="weightedsetstring" by="9">
- <key>First</key>
- <key>Second</key>
- </increment>
- </update>
-</vespafeed>
diff --git a/document/src/tests/vespaxml/test45.xml b/document/src/tests/vespaxml/test45.xml
deleted file mode 100644
index ccc1a475a86..00000000000
--- a/document/src/tests/vespaxml/test45.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-<!-- Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -->
-<vespafeed>
- <update documenttype="news" documentid="doc:crawler:http://www.ntnu.no/">
- <remove field="floatarr" />
- </update>
-</vespafeed>
diff --git a/document/src/tests/vespaxml/test46.xml b/document/src/tests/vespaxml/test46.xml
deleted file mode 100644
index 118dfdd810d..00000000000
--- a/document/src/tests/vespaxml/test46.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-<!-- Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -->
-<vespafeed>
- <document documenttype="news" documentid="doc:crawler:http://www.blargh.example.com/" lastmodified="98798787">
- <value_long>1008</value_long>
- <weightedsetstring>
- <item weight="1">First</item>
- <item weight="2">Second</item>
- </weightedsetstring>
- </document>
-</vespafeed>
diff --git a/document/src/tests/vespaxml/test47.xml b/document/src/tests/vespaxml/test47.xml
deleted file mode 100644
index e9499c32810..00000000000
--- a/document/src/tests/vespaxml/test47.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -->
-<vespafeed>
- <!-- VERY BAD: -->
- <vespaadd>
- <documentid type="news">
- <uri>doc:this:is:very:bad</uri>
- </documentid>
- </vespaadd>
-</vespafeed>
diff --git a/document/src/tests/vespaxml/test48.xml b/document/src/tests/vespaxml/test48.xml
deleted file mode 100644
index 119d3ea82d4..00000000000
--- a/document/src/tests/vespaxml/test48.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -->
-<vespafeed>
- <!-- VERY BAD: -->
- <documentid type="news" id="doc:this:is:even:worse" />
-</vespafeed>
diff --git a/document/src/tests/vespaxml/test49.xml b/document/src/tests/vespaxml/test49.xml
deleted file mode 100644
index d3fa4dc9637..00000000000
--- a/document/src/tests/vespaxml/test49.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -->
-<vespafeed>
- <!-- VERY BAD: -->
- <documentid type="news">
- <uri>doc:this:is:very:very:ugly</uri>
- </documentid>
-</vespafeed>
diff --git a/document/src/tests/vespaxml/test5.expected.xml b/document/src/tests/vespaxml/test5.expected.xml
deleted file mode 100644
index 5b851a4601e..00000000000
--- a/document/src/tests/vespaxml/test5.expected.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-<!-- Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -->
-<remove documentid="doc:crawler:http://www.ntnu.no/"/>
-
diff --git a/document/src/tests/vespaxml/test5.xml b/document/src/tests/vespaxml/test5.xml
deleted file mode 100644
index bdfa496cb86..00000000000
--- a/document/src/tests/vespaxml/test5.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-<!-- Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -->
-<vespafeed>
- <vesparemove>
- <documentid documentid="doc:crawler:http://www.ntnu.no/"/>
- </vesparemove>
-</vespafeed>
diff --git a/document/src/tests/vespaxml/test50.xml b/document/src/tests/vespaxml/test50.xml
deleted file mode 100644
index 45c4c0a4d13..00000000000
--- a/document/src/tests/vespaxml/test50.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -->
-<vespafeed>
- <!-- OK: -->
- <vesparemove>
- <documentid type="news" id="doc:this:an:ok:removal"/>
- </vesparemove>
-</vespafeed>
diff --git a/document/src/tests/vespaxml/test51.xml b/document/src/tests/vespaxml/test51.xml
deleted file mode 100644
index 9e91d45d930..00000000000
--- a/document/src/tests/vespaxml/test51.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -->
-<vespafeed>
- <!-- OK: -->
- <remove documentid="doc:this:is:also:an:ok:removal"/>
-</vespafeed>
diff --git a/document/src/tests/vespaxml/test52.xml b/document/src/tests/vespaxml/test52.xml
deleted file mode 100644
index a8617df42da..00000000000
--- a/document/src/tests/vespaxml/test52.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -->
-<vespafeed>
- <!-- OK: -->
- <vespaadd>
- <document documentid="doc:blah:blah:blah" documenttype="news">
- <value_long>2345</value_long>
- </document>
- </vespaadd>
-</vespafeed>
diff --git a/document/src/tests/vespaxml/test53.xml b/document/src/tests/vespaxml/test53.xml
deleted file mode 100644
index 6449436ff54..00000000000
--- a/document/src/tests/vespaxml/test53.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -->
-<vespafeed>
- <!-- HALF BAD, BUT NOT ALLOWED: -->
- <vespaadd>
- <document documentid="doc:blah:blah:blah" documenttype="news">
- <value_long>2345</value_long>
- </document>
- <documentid type="news" id="doc:half:bad:add"/>
- </vespaadd>
-</vespafeed>
diff --git a/document/src/tests/vespaxml/test54.xml b/document/src/tests/vespaxml/test54.xml
deleted file mode 100644
index 7535f4b93ea..00000000000
--- a/document/src/tests/vespaxml/test54.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -->
-<vespafeed>
- <!-- VERY BAD: -->
- <vesparemove>
- <document documentid="doc:bluh:bluh:bluh" documenttype="news">
- <value_long>45</value_long>
- </document>
- </vesparemove>
-</vespafeed>
diff --git a/document/src/tests/vespaxml/test55.xml b/document/src/tests/vespaxml/test55.xml
deleted file mode 100644
index b2134a29a46..00000000000
--- a/document/src/tests/vespaxml/test55.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -->
-<vespafeed>
- <!-- HALF BAD, BUT NOT ALLOWED: -->
- <vesparemove>
- <documentid type="news" id="doc:this:remove:is:half:bad"/>
- <document documentid="doc:bluh:bluh:bluh" documenttype="news">
- <value_long>45</value_long>
- </document>
- </vesparemove>
-</vespafeed>
diff --git a/document/src/tests/vespaxml/test56.xml b/document/src/tests/vespaxml/test56.xml
deleted file mode 100644
index 1dd36a57b68..00000000000
--- a/document/src/tests/vespaxml/test56.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -->
-<vespafeed>
- <!-- VERY BAD: -->
- <vesparemove>
- <document documentid="doc:bluh:bluh:bluh" documenttype="news" />
- </vesparemove>
-</vespafeed>
diff --git a/document/src/tests/vespaxml/test57.xml b/document/src/tests/vespaxml/test57.xml
deleted file mode 100644
index d75e6d4d099..00000000000
--- a/document/src/tests/vespaxml/test57.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -->
-<vespafeed>
- <!-- OK: -->
- <document documentid="doc:blih:blih:blih" documenttype="news">
- <value_long>235</value_long>
- </document>
-</vespafeed>
diff --git a/document/src/tests/vespaxml/test58.xml b/document/src/tests/vespaxml/test58.xml
deleted file mode 100644
index 8711a2a49e4..00000000000
--- a/document/src/tests/vespaxml/test58.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -->
-<vespafeed>
-
- <document type="news" id="doc:music:http://music.yahoo.com">
- <url>http://music.yahoo.com</url>
- <stringarr>
- <item>yahoo<item>
- <item>hello</item>
- </stringarr>
- </document>
-
-
-
-</vespafeed>
diff --git a/document/src/tests/vespaxml/test59.xml b/document/src/tests/vespaxml/test59.xml
deleted file mode 100644
index e7708351c93..00000000000
--- a/document/src/tests/vespaxml/test59.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -->
-<vespafeed>
- <update documentid="doc:blih:blih:blih" documenttype="news">
- <increment field="title" by="3549" />
- </update>
-</vespafeed>
diff --git a/document/src/tests/vespaxml/test6.xml b/document/src/tests/vespaxml/test6.xml
deleted file mode 100644
index 3739690d2fe..00000000000
--- a/document/src/tests/vespaxml/test6.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -->
-<vespafeed>
- <vesparemove>
- <documentid type="news" id="doc:crawler:http://www.ntnu���.no/"/>
- </vesparemove>
-</vespafeed>
diff --git a/document/src/tests/vespaxml/test7.xml b/document/src/tests/vespaxml/test7.xml
deleted file mode 100644
index 129773678f1..00000000000
--- a/document/src/tests/vespaxml/test7.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<!-- Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -->
-<vespafeed idprefix="doc:crawler:">
- <vespaadd>
- <document type="news" id="http://www.ntnu.no/">
- <title>TestTitle</title>
- <last_downloaded>100.5</last_downloaded>
- </document>
- </vespaadd>
-</vespafeed>
diff --git a/document/src/tests/vespaxml/test8.xml b/document/src/tests/vespaxml/test8.xml
deleted file mode 100644
index 272791511c1..00000000000
--- a/document/src/tests/vespaxml/test8.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<!-- Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -->
-<vespafeed>
- <vespaadd>
- <document type="news" id="doc:crawler:http://www.ntnu.no/">
- <title>TestTitle</title>
- <last_downloaded>hundred</last_downloaded>
- </document>
- </vespaadd>
-</vespafeed>
diff --git a/document/src/tests/vespaxml/test9.xml b/document/src/tests/vespaxml/test9.xml
deleted file mode 100644
index b733c66a797..00000000000
--- a/document/src/tests/vespaxml/test9.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -->
-<vespafeed>
- <vesparemove>
- <documentid id="doc:crawler/http://www.ntnu���.no/"/>
- </vesparemove>
-</vespafeed>
diff --git a/document/src/tests/vespaxml/test_arraystruct.xml b/document/src/tests/vespaxml/test_arraystruct.xml
deleted file mode 100644
index ba5c3233e16..00000000000
--- a/document/src/tests/vespaxml/test_arraystruct.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<!-- Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -->
-<vespafeed>
- <document documenttype="news" documentid="doc:test:struct">
- <mystructarr>
- <item>
- <intval>36</intval>
- <stringval>test</stringval>
- </item>
- <item>
- <intval>39</intval>
- <stringval>test2</stringval>
- </item>
- <item>
- <intval>100</intval>
- <stringval>cooool</stringval>
- </item>
- </mystructarr>
- </document>
-</vespafeed>
diff --git a/document/src/tests/vespaxml/test_doc5.xml b/document/src/tests/vespaxml/test_doc5.xml
deleted file mode 100644
index 30ce5f7b8f8..00000000000
--- a/document/src/tests/vespaxml/test_doc5.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<!-- Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -->
-<vespafeed>
- <endoffeed>
- <name>default</name>
- <generation>10</generation>
- <increment>20</increment>
- </endoffeed>
-</vespafeed>
diff --git a/document/src/tests/vespaxml/test_doc6.xml b/document/src/tests/vespaxml/test_doc6.xml
deleted file mode 100644
index 52015073f96..00000000000
--- a/document/src/tests/vespaxml/test_doc6.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-<!-- Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -->
-<vespafeed>
- <endoffeed>
- <name>default</name>
- </endoffeed>
-</vespafeed>
diff --git a/document/src/tests/vespaxml/test_doc8.xml b/document/src/tests/vespaxml/test_doc8.xml
deleted file mode 100644
index f5c7a2090ae..00000000000
--- a/document/src/tests/vespaxml/test_doc8.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<!-- Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -->
-<vespafeed>
- <vespaadd>
- <document type="news" version="13" id="http://www.ntnu.no/">
- <title>TestTitle</title>
- <last_downloaded>100</last_downloaded>
- </document>
- </vespaadd>
-</vespafeed>
diff --git a/document/src/tests/vespaxml/test_externalentity.xml b/document/src/tests/vespaxml/test_externalentity.xml
deleted file mode 100644
index 014d67d32bc..00000000000
--- a/document/src/tests/vespaxml/test_externalentity.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -->
-<!DOCTYPE vespafeed [<!ENTITY xxe SYSTEM "xxe.txt">]>
-<vespafeed>
- <vespaadd idprefix="doc:crawler:">
- <document documenttype="news" documentid="http://www.ntnu.no/">
- <title>&xxe;</title>
- <last_downloaded>100</last_downloaded>
- </document>
- </vespaadd>
-</vespafeed>
diff --git a/document/src/tests/vespaxml/test_idprefix.xml b/document/src/tests/vespaxml/test_idprefix.xml
deleted file mode 100644
index 2b0487d0b94..00000000000
--- a/document/src/tests/vespaxml/test_idprefix.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -->
-<vespafeed>
-
- <document type="news" id="http://music.yahoo.com/bobdylan/BestOf">
- <title>Best of Bob Dylan</title>
- </document>
-
- <document type="news" id="http://music.yahoo.com/metallica/BestOf">
- <title>Best of Metallica</title>
- </document>
-
-</vespafeed>
diff --git a/document/src/tests/vespaxml/test_struct.xml b/document/src/tests/vespaxml/test_struct.xml
deleted file mode 100644
index 251b8b4896d..00000000000
--- a/document/src/tests/vespaxml/test_struct.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<!-- Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -->
-<vespafeed>
- <document documenttype="news" documentid="doc:test:struct">
- <mystruct>
- <intval>36</intval>
- <stringval>test</stringval>
- </mystruct>
- </document>
-</vespafeed>
diff --git a/document/src/tests/vespaxml/test_update1.xml b/document/src/tests/vespaxml/test_update1.xml
deleted file mode 100644
index 89dcb978e3b..00000000000
--- a/document/src/tests/vespaxml/test_update1.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<!-- Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -->
-<vespafeed>
- <vespaadd idprefix="doc:crawler:">
- <document type="news" id="http://www.ntnu.no/">
- <title>TestTitle</title>
- <last_downloaded>100</last_downloaded>
- </document>
- <update documenttype="news" documentid="http://www.ntnu.no/">
- <divide field="last_downloaded" by="0" />
- </update>
- </vespaadd>
-</vespafeed>