use of com.yahoo.document.idstring.IdIdString in project vespa by vespa-engine.
the class IdIdStringTest method requireThatIdIdStringCanBehaveLikeGroupDoc.
@Test
public void requireThatIdIdStringCanBehaveLikeGroupDoc() throws Exception {
DocumentId docId1 = new DocumentId(new IdIdString("namespace", "type", "g=foo", "foo"));
DocumentId docId2 = new DocumentId(new IdIdString("namespace", "type", "g=foo", "bar"));
DocumentId docId3 = new DocumentId(new IdIdString("namespace", "type", "g=bar", "baz"));
assertEquals(docId1.getScheme().getLocation(), docId2.getScheme().getLocation());
assert (docId1.getScheme().getLocation() != docId3.getScheme().getLocation());
}
use of com.yahoo.document.idstring.IdIdString in project vespa by vespa-engine.
the class IdIdStringTest method requireThatIdIdStringGeneratesProperString.
@Test
public void requireThatIdIdStringGeneratesProperString() throws Exception {
DocumentId docId = new DocumentId(new IdIdString("namespace", "type", "g=group", "foobar"));
assertEquals("id:namespace:type:g=group:foobar", docId.toString());
}
use of com.yahoo.document.idstring.IdIdString in project vespa by vespa-engine.
the class IdIdStringTest method requireThatEmptyKeyValuesAreOk.
@Test
public void requireThatEmptyKeyValuesAreOk() throws Exception {
DocumentId docId = new DocumentId(new IdIdString("namespace", "type", "", "foobar"));
assertEquals("id:namespace:type::foobar", docId.toString());
}
use of com.yahoo.document.idstring.IdIdString in project vespa by vespa-engine.
the class IdIdStringTest method requireThatIdIdStringCanBehaveLikeUserDoc.
@Test
public void requireThatIdIdStringCanBehaveLikeUserDoc() throws Exception {
DocumentId docId1 = new DocumentId(new IdIdString("namespace", "type", "n=10", "foo"));
DocumentId docId2 = new DocumentId(new IdIdString("namespace", "type", "n=10", "bar"));
DocumentId docId3 = new DocumentId(new IdIdString("namespace", "type", "n=20", "baz"));
assertEquals(docId1.getScheme().getLocation(), docId2.getScheme().getLocation());
assert (docId1.getScheme().getLocation() != docId3.getScheme().getLocation());
}
Aggregations