NotesDatabaseMock configDatabase = factory.getDatabase("testconfig.nsf");
NotesDocumentMock crawlRequestDoc = new NotesDocumentMock();
configDatabase.addDocument(crawlRequestDoc, NCCONST.VIEWCRAWLQ);
// Mimic the creation of a crawl request doc in NotesDatabasePoller.
crawlRequestDoc.addItem(new NotesItemMock("name", NCCONST.NCITM_STATE,
"type", NotesItem.TEXT, "values", NCCONST.STATENEW));
crawlRequestDoc.addItem(new NotesItemMock("name", NCCONST.ITM_MIMETYPE,
"type", NotesItem.TEXT, "values", NCCONST.DEFAULT_DOCMIMETYPE));
crawlRequestDoc.addItem(new NotesItemMock("name", NCCONST.ITMFORM,
"type", NotesItem.TEXT, "values", NCCONST.FORMCRAWLREQUEST));
crawlRequestDoc.addItem(new NotesItemMock("name", NCCONST.NCITM_UNID,
"type", NotesItem.TEXT, "values", "sourcedocunid"));
crawlRequestDoc.addItem(new NotesItemMock("name", NCCONST.NCITM_REPLICAID,
"type", NotesItem.TEXT, "values", "sourcedbreplicaid"));
crawlRequestDoc.addItem(new NotesItemMock("name", NCCONST.NCITM_SERVER,
"type", NotesItem.TEXT, "values", "testserver"));
crawlRequestDoc.addItem(new NotesItemMock("name", NCCONST.NCITM_TEMPLATE,
"type", NotesItem.TEXT, "values", "testtemplate"));
crawlRequestDoc.addItem(new NotesItemMock("name", NCCONST.NCITM_DOMAIN,
"type", NotesItem.TEXT, "values", "testdomain"));
crawlRequestDoc.addItem(new NotesItemMock("name", NCCONST.NCITM_AUTHTYPE,
"type", NotesItem.TEXT, "values", NCCONST.AUTH_CONNECTOR));
crawlRequestDoc.addItem(
new NotesItemMock("name", NCCONST.ITM_GMETANOTESLINK,
"type", NotesItem.TEXT, "values", "notes url"));
NotesConnectorSession connectorSession =
(NotesConnectorSession) connector.login();
NotesSession session = connectorSession.createNotesSession();