Package com.google.enterprise.connector.notes.client.mock

Examples of com.google.enterprise.connector.notes.client.mock.NotesACLMock


        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 {
View Full Code Here


    // Modify one of the previously-created ACLs (we don't
    // actually have editing support, so just recreate it here).
    NotesDatabaseMock notesDatabase = (NotesDatabaseMock) session.getDatabase(
        "SenateServer", "SenateExpenseReports.nsf");
    NotesACLMock originalAcl = (NotesACLMock) notesDatabase.getACL();
    try {
      NotesACLMock acl = new NotesACLMock();
      // Remove Palpatine from this database's ACL
      acl.addAclEntry(new NotesACLEntryMock("senators",
              NotesACLEntry.TYPE_PERSON_GROUP, NotesACL.LEVEL_AUTHOR,
              "[creator]", "[duplicategroupname]"));
      notesDatabase.setACL(acl);
      setUpRoles();
      assertRoleDoesNotExist("serreplicaid0123/[removablerole]");
View Full Code Here

        configDatabase.addDocument(databaseDocument, NCCONST.VIEWDATABASES,
            NCCONST.VIEWSECURITY);
        NotesDatabaseMock notesDatabase = new NotesDatabaseMock(
            "JediServer", "JediTrainingManuals.nsf", "jtmreplicaid0123");
        ((NotesSessionMock) session).addDatabase(notesDatabase);
        NotesACLMock acl = new NotesACLMock();
        acl.addAclEntry(new NotesACLEntryMock(
            "cn=Anakin Skywalker/ou=Tests/o=Tests", NotesACLEntry.TYPE_PERSON,
            NotesACL.LEVEL_AUTHOR, "[tacticsexpert]"));
        acl.addAclEntry(new NotesACLEntryMock("masters",
            NotesACLEntry.TYPE_PERSON_GROUP, NotesACL.LEVEL_AUTHOR,
            "[holderofopinions]"));
        notesDatabase.setACL(acl);

        databaseDocument = new NotesDocumentMock();
        databaseDocument.addItem(new NotesItemMock("name", NCCONST.DITM_DBNAME,
            "type", NotesItem.TEXT, "values", "testDb.nsf"));
        databaseDocument.addItem(new NotesItemMock("name",
            NCCONST.DITM_REPLICAID, "type", NotesItem.TEXT,
            "values", "testdb_replicaid"));
        databaseDocument.addItem(new NotesItemMock("name", NCCONST.DITM_SERVER,
            "type", NotesItem.TEXT, "values", "server"));
        databaseDocument.addItem(new NotesItemMock("name",
            NCCONST.NCITM_DBPERMITGROUPS, "type", NotesItem.TEXT,
            "values", "jedi"));
        configDatabase.addDocument(databaseDocument, NCCONST.VIEWDATABASES,
                NCCONST.VIEWSECURITY);

        testDb = new NotesDatabaseMock(
            "server", "testDb.nsf", "testdb_replicaid");
        ((NotesSessionMock) session).addDatabase(testDb);
        NotesACLMock testAcl = new NotesACLMock();
        testAcl.addAclEntry(new NotesACLEntryMock("jedi",
            NotesACLEntry.TYPE_PERSON_GROUP,
            NotesACL.LEVEL_READER, "[reader]"));
        testDb.setACL(testAcl);

        NotesUserGroupManager userGroupManager =
View Full Code Here

            "type", NotesItem.TEXT, "values", "JediServer"));
        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=Anakin Skywalker/ou=Tests/o=Tests", NotesACLEntry.TYPE_PERSON,
            NotesACL.LEVEL_AUTHOR, "[tacticsexpert]"));
        acl.addAclEntry(new NotesACLEntryMock("masters",
            NotesACLEntry.TYPE_PERSON_GROUP, NotesACL.LEVEL_AUTHOR,
            "[holderofopinions]"));
        notesDatabase.setACL(acl);

        NotesUserGroupManager userGroupManager =
View Full Code Here

TOP

Related Classes of com.google.enterprise.connector.notes.client.mock.NotesACLMock

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.