aboutsummaryrefslogtreecommitdiffstats
path: root/document/src/test/java/com/yahoo/document/DocumentIdTestCase.java
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/test/java/com/yahoo/document/DocumentIdTestCase.java
parentcb00b309ed537867e36e97dd2c9801c01d84489b (diff)
Revert "Revert "doc: -> id:""
Diffstat (limited to 'document/src/test/java/com/yahoo/document/DocumentIdTestCase.java')
-rw-r--r--document/src/test/java/com/yahoo/document/DocumentIdTestCase.java21
1 files changed, 5 insertions, 16 deletions
diff --git a/document/src/test/java/com/yahoo/document/DocumentIdTestCase.java b/document/src/test/java/com/yahoo/document/DocumentIdTestCase.java
index b8f60b5d9bc..bb4fac805ee 100644
--- a/document/src/test/java/com/yahoo/document/DocumentIdTestCase.java
+++ b/document/src/test/java/com/yahoo/document/DocumentIdTestCase.java
@@ -44,9 +44,9 @@ public class DocumentIdTestCase {
@Test
public void testCompareTo() {
- DocumentId docId1 = new Document(manager.getDocumentType("testdoc"), new DocumentId("doc:testdoc:http://www.uio.no/")).getId();
- DocumentId docId2 = new Document(manager.getDocumentType("testdoc"), new DocumentId("doc:testdoc:http://www.uio.no/")).getId();
- DocumentId docId3 = new Document(manager.getDocumentType("testdoc"), new DocumentId("doc:testdoc:http://www.ntnu.no/")).getId();
+ DocumentId docId1 = new Document(manager.getDocumentType("testdoc"), new DocumentId("id:ns:testdoc::http://www.uio.no/")).getId();
+ DocumentId docId2 = new Document(manager.getDocumentType("testdoc"), new DocumentId("id:ns:testdoc::http://www.uio.no/")).getId();
+ DocumentId docId3 = new Document(manager.getDocumentType("testdoc"), new DocumentId("id:ns:testdoc::http://www.ntnu.no/")).getId();
assertTrue(docId1.equals(docId2));
assertTrue(!docId1.equals(docId3));
@@ -70,8 +70,6 @@ public class DocumentIdTestCase {
public void testValidInvalidUriSchemes() {
try {
//valid URIs
- new DocumentId("doc:blabla:something");
- new DocumentId("doc:doc:doc");
new DocumentId("id:namespace:type:n=42:whatever");
new DocumentId("id:namespace:type::whatever");
} catch (IllegalArgumentException iae) {
@@ -80,11 +78,6 @@ public class DocumentIdTestCase {
checkInvalidUri("foobar:");
checkInvalidUri("ballooo:blabla/something/");
- checkInvalidUri("doc:");
- checkInvalidUri("doc::");
- checkInvalidUri("doc:::");
- checkInvalidUri("doc::/");
- checkInvalidUri("doc");
checkInvalidUri("id:namespace:type");
checkInvalidUri("id:namespace:type:key-values");
checkInvalidUri("id:namespace:type:n=0,n=1:foo");
@@ -182,10 +175,6 @@ public class DocumentIdTestCase {
assertFalse(none.getScheme().hasGroup());
assertFalse(none.getScheme().hasNumber());
- none = new DocumentId("doc:ns:foo");
- assertFalse(none.getScheme().hasGroup());
- assertFalse(none.getScheme().hasNumber());
-
DocumentId user = new DocumentId("id:ns:type:n=42:foo");
assertFalse(user.getScheme().hasGroup());
assertTrue(user.getScheme().hasNumber());
@@ -204,9 +193,9 @@ public class DocumentIdTestCase {
@Test
public void testHashCodeOfGids() {
- DocumentId docId0 = new DocumentId("doc:blabla:0");
+ DocumentId docId0 = new DocumentId("id:blabla:type::0");
byte[] docId0Gid = docId0.getGlobalId();
- DocumentId docId0Copy = new DocumentId("doc:blabla:0");
+ DocumentId docId0Copy = new DocumentId("id:blabla:type::0");
byte[] docId0CopyGid = docId0Copy.getGlobalId();