return crawlDoc;
}
private NotesDocumentMock getCrawlDoc(boolean hasReaders)
throws Exception {
NotesDocumentMock crawlDoc = new NotesDocumentMock();
crawlDoc.addItem(new NotesItemMock("name", NCCONST.ITM_ACTION,
"type", NotesItem.TEXT, "values", ActionType.ADD));
crawlDoc.addItem(new NotesItemMock("name", NCCONST.ITM_DOCID, "type",
NotesItem.TEXT, "values", "http://host:42/replicaid/0/docid"));
crawlDoc.addItem(new NotesItemMock("name", NCCONST.ITM_DISPLAYURL, "type",
NotesItem.TEXT, "values", "http://host:42/replicaid/0/docid"));
crawlDoc.addItem(new NotesItemMock("name", NCCONST.NCITM_REPLICAID,
"type", NotesItem.TEXT, "values", "replicaid"));
crawlDoc.addItem(new NotesItemMock("name", NCCONST.ITM_TITLE, "type",
NotesItem.TEXT, "values", "This is the title"));
crawlDoc.addItem(new NotesItemMock("name", NCCONST.ITM_MIMETYPE, "type",
NotesItem.TEXT, "values", "text/plain"));
crawlDoc.addItem(new NotesItemMock("name", NCCONST.ITM_ISPUBLIC, "type",
NotesItem.TEXT, "values", "true"));
crawlDoc.addItem(new NotesItemMock("name",
NCCONST.ITM_GMETADESCRIPTION, "type",
NotesItem.TEXT, "values", "This is the description"));
crawlDoc.addItem(new NotesItemMock("name", NCCONST.ITM_GMETADATABASE,
"type", NotesItem.TEXT, "values", "crawled database"));
crawlDoc.addItem(new NotesItemMock("name", NCCONST.ITM_GMETACATEGORIES,
"type", NotesItem.TEXT, "values", "CATEGORY 1", "CATEGORY 2"));
crawlDoc.addItem(new NotesItemMock("name", NCCONST.ITM_GMETAREPLICASERVERS,
"type", NotesItem.TEXT, "values", "replica server"));
crawlDoc.addItem(new NotesItemMock("name", NCCONST.ITM_GMETANOTESLINK,
"type", NotesItem.TEXT, "values", "/notes/link"));
crawlDoc.addItem(new NotesItemMock("name", NCCONST.ITM_GMETAWRITERNAME,
"type", NotesItem.TEXT, "values", "An Author"));
crawlDoc.addItem(new NotesItemMock("name", NCCONST.ITM_GMETAFORM, "type",
NotesItem.TEXT, "values", "docform"));
crawlDoc.addItem(new NotesItemMock("name", NCCONST.ITM_CONTENT, "type",
NotesItem.TEXT, "values", "This is the content"));
crawlDoc.addItem(new NotesItemMock("name", NCCONST.NCITM_AUTHTYPE, "type",
NotesItem.TEXT, "values", NCCONST.AUTH_ACL));
if (hasReaders) {
Vector<String> readers = new Vector<String>();
readers.add("cn=John Smith/ou=Tests/o=Tests");
readers.add("*");
crawlDoc.addItem(new NotesItemMock("name", NCCONST.NCITM_DOCAUTHORREADERS,
"type", NotesItem.TEXT, "values", readers,
"readergroup", "[readerrole]"));
}
crawlDoc.addItem(new NotesItemMock("name", NCCONST.ITM_GMETALASTUPDATE,
"type", NotesItem.DATETIMES, "values", testDate));
crawlDoc.addItem(new NotesItemMock("name", NCCONST.ITM_GMETACREATEDATE,
"type", NotesItem.DATETIMES, "values", testDate));
return crawlDoc;
}