// First, create the connector database records, then
// create the database. For the purposes of
// NotesUserGroupManager, we only need a database, no
// documents.
NotesDatabaseMock configDatabase = (NotesDatabaseMock) session
.getDatabase(connectorSession.getServer(),
connectorSession.getDatabase());
NotesDocumentMock databaseDocument = new NotesDocumentMock();
databaseDocument.addItem(new NotesItemMock("name", NCCONST.DITM_DBNAME,
"type", NotesItem.TEXT, "values", "JediTrainingManuals.nsf"));
databaseDocument.addItem(new NotesItemMock("name",
NCCONST.DITM_REPLICAID, "type", NotesItem.TEXT,
"values", "jtmreplicaid0123"));
databaseDocument.addItem(new NotesItemMock("name", NCCONST.DITM_SERVER,
"type", NotesItem.TEXT, "values", "JediServer"));
configDatabase.addDocument(databaseDocument, NCCONST.VIEWDATABASES);
databaseDocument = new NotesDocumentMock();
databaseDocument.addItem(new NotesItemMock("name", NCCONST.DITM_DBNAME,
"type", NotesItem.TEXT, "values", "SenateExpenseReports.nsf"));
databaseDocument.addItem(new NotesItemMock("name",
NCCONST.DITM_REPLICAID, "type", NotesItem.TEXT,
"values", "serreplicaid0123"));
databaseDocument.addItem(new NotesItemMock("name", NCCONST.DITM_SERVER,
"type", NotesItem.TEXT, "values", "SenateServer"));
configDatabase.addDocument(databaseDocument, NCCONST.VIEWDATABASES);
databaseDocument = new NotesDocumentMock();
databaseDocument.addItem(new NotesItemMock("name", NCCONST.DITM_DBNAME,
"type", NotesItem.TEXT, "values", "EvilSeparatistPlots.nsf"));
databaseDocument.addItem(new NotesItemMock("name",
NCCONST.DITM_REPLICAID, "type", NotesItem.TEXT,
"values", "espreplicaid0123"));
databaseDocument.addItem(new NotesItemMock("name", NCCONST.DITM_SERVER,
"type", NotesItem.TEXT, "values", "SenateServer"));
configDatabase.addDocument(databaseDocument, NCCONST.VIEWDATABASES);
NotesDatabaseMock notesDatabase = new NotesDatabaseMock(
"JediServer", "JediTrainingManuals.nsf", "jtmreplicaid0123");
((NotesSessionMock) session).addDatabase(notesDatabase);
NotesACLMock acl = new NotesACLMock();
acl.addAclEntry(new NotesACLEntryMock(
"cn=Ahsoka Tano/ou=Tests/o=Tests", NotesACLEntry.TYPE_PERSON,
NotesACL.LEVEL_READER, "[student]"));
acl.addAclEntry(new NotesACLEntryMock(
"cn=Anakin Skywalker/ou=Tests/o=Tests", NotesACLEntry.TYPE_PERSON,
NotesACL.LEVEL_AUTHOR, "[tacticsexpert]"));
acl.addAclEntry(new NotesACLEntryMock(
"cn=Yoda/ou=Tests/o=Tests", NotesACLEntry.TYPE_PERSON,
NotesACL.LEVEL_AUTHOR, "[philosopher]"));
acl.addAclEntry(new NotesACLEntryMock("masters",
NotesACLEntry.TYPE_PERSON_GROUP, NotesACL.LEVEL_AUTHOR,
"[holderofopinions]", "[duplicategroupname]"));
acl.addAclEntry(new NotesACLEntryMock("bad guys",
NotesACLEntry.TYPE_PERSON_GROUP, NotesACL.LEVEL_NOACCESS));
notesDatabase.setACL(acl);
notesDatabase = new NotesDatabaseMock(
"SenateServer", "SenateExpenseReports.nsf", "serreplicaid0123");
((NotesSessionMock) session).addDatabase(notesDatabase);
acl = new NotesACLMock();
acl.addAclEntry(new NotesACLEntryMock(
"cn=Chancellor Palpatine/ou=Tests/o=Tests",
NotesACLEntry.TYPE_PERSON, NotesACL.LEVEL_READER,
"[removablerole]"));
acl.addAclEntry(new NotesACLEntryMock("senators",
NotesACLEntry.TYPE_PERSON_GROUP, NotesACL.LEVEL_AUTHOR,
"[creator]", "[duplicategroupname]"));
notesDatabase.setACL(acl);
notesDatabase = new NotesDatabaseMock(
"SenateServer", "EvilSeparatistPlots.nsf", "espreplicaid0123");
((NotesSessionMock) session).addDatabase(notesDatabase);
acl = new NotesACLMock();
acl.addAclEntry(new NotesACLEntryMock(
"cn=Chancellor Palpatine/ou=Tests/o=Tests",
NotesACLEntry.TYPE_PERSON, NotesACL.LEVEL_MANAGER,
"[evilmastermind]"));
acl.addAclEntry(new NotesACLEntryMock(
"Count Dooku", // Test a short name in the ACL
NotesACLEntry.TYPE_PERSON, NotesACL.LEVEL_AUTHOR,
"[henchman]"));
acl.addAclEntry(new NotesACLEntryMock(
"bad guys", NotesACLEntry.TYPE_PERSON_GROUP,
NotesACL.LEVEL_READER));
acl.addAclEntry(new NotesACLEntryMock("jedi",
NotesACLEntry.TYPE_PERSON_GROUP,
NotesACL.LEVEL_READER, "[reader]"));
notesDatabase.setACL(acl);
try {
userGroupManager.setUpResources(true);
userGroupManager.clearTables(userGroupManager.getConnection());
} finally {