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

Examples of com.google.enterprise.connector.notes.client.mock.NotesDocumentMock.addItem()


            "type", NotesItem.TEXT, "values", groupName));
    notesGroup.addItem(new NotesItemMock("name", NCCONST.GITM_LISTNAME,
            "type", NotesItem.TEXT, "values", groupName));
    notesGroup.addItem(new NotesItemMock("name", NCCONST.ITMFORM,
            "type", NotesItem.TEXT, "values", NCCONST.DIRFORM_GROUP));
    notesGroup.addItem(new NotesItemMock("name", NCCONST.GITM_GROUPTYPE,
            "type", NotesItem.TEXT, "values",
            NCCONST.DIR_ACCESSCONTROLGROUPTYPES));
    if (members != null && members.length > 0) {
      notesGroup.addItem(new NotesItemMock("name", NCCONST.GITM_MEMBERS,
              "type", NotesItem.TEXT, "values", members));
View Full Code Here


            "type", NotesItem.TEXT, "values", NCCONST.DIRFORM_GROUP));
    notesGroup.addItem(new NotesItemMock("name", NCCONST.GITM_GROUPTYPE,
            "type", NotesItem.TEXT, "values",
            NCCONST.DIR_ACCESSCONTROLGROUPTYPES));
    if (members != null && members.length > 0) {
      notesGroup.addItem(new NotesItemMock("name", NCCONST.GITM_MEMBERS,
              "type", NotesItem.TEXT, "values", members));
    }
    namesDatabase.addDocument(notesGroup,
        NCCONST.DIRVIEW_PEOPLEGROUPFLAT, NCCONST.DIRVIEW_SERVERACCESS,
        NCCONST.DIRVIEW_VIMGROUPS, "grouplookup");
View Full Code Here

  public void testSetMetaFieldsText() throws Exception {
    NotesConnectorDocument doc = new NotesConnectorDocument(null, null, null);
    doc.docProps = new HashMap<String, List<Value>>();

    NotesDocumentMock crawlDoc = new NotesDocumentMock();
    crawlDoc.addItem(new NotesItemMock("name", "x.foo", "type", NotesItem.TEXT,
            "values", "this is the text for field foo"));
    doc.crawlDoc = crawlDoc;
    doc.setMetaFields();
    Property p = doc.findProperty("foo");
    assertNotNull("property foo missing", p);
View Full Code Here

  public void testSetMetaFieldsNumber() throws Exception {
    NotesConnectorDocument doc = new NotesConnectorDocument(null, null, null);
    doc.docProps = new HashMap<String, List<Value>>();

    NotesDocumentMock crawlDoc = new NotesDocumentMock();
    crawlDoc.addItem(new NotesItemMock("name", "x.foo", "type",
            NotesItem.NUMBERS, "values", new Double(11)));
    doc.crawlDoc = crawlDoc;
    doc.setMetaFields();
    Property p = doc.findProperty("foo");
    assertNotNull("property foo missing", p);
View Full Code Here

    Date testDate = new Date();
    Calendar testCalendar = Calendar.getInstance();
    testCalendar.setTime(testDate);

    NotesDocumentMock crawlDoc = new NotesDocumentMock();
    crawlDoc.addItem(new NotesItemMock("name", "x.foo", "type",
            NotesItem.NUMBERS, "values", new NotesDateTimeMock(testDate)));
    doc.crawlDoc = crawlDoc;
    doc.setMetaFields();
    Property p = doc.findProperty("foo");
    assertNotNull("property foo missing", p);
View Full Code Here

  public void testSetMetaFieldsTextMultipleValues() throws Exception {
    NotesConnectorDocument doc = new NotesConnectorDocument(null, null, null);
    doc.docProps = new HashMap<String, List<Value>>();

    NotesDocumentMock crawlDoc = new NotesDocumentMock();
    crawlDoc.addItem(new NotesItemMock("name", "x.foo", "type", NotesItem.TEXT,
            "values", "foo text 1", "foo text 2", "foo text 3"));
    doc.crawlDoc = crawlDoc;
    doc.setMetaFields();
    Property p = doc.findProperty("foo");
    assertNotNull("property foo missing", p);
View Full Code Here

    assertNull(p.nextValue());
  }

  public void testDeleteDocument() throws Exception {
    NotesDocumentMock crawlDoc = new NotesDocumentMock();
    crawlDoc.addItem(new NotesItemMock("name", NCCONST.ITM_ACTION,
            "type", NotesItem.TEXT, "values", ActionType.DELETE));
    crawlDoc.addItem(new NotesItemMock("name", NCCONST.ITM_DOCID, "type",
            NotesItem.TEXT, "values", "docid"));

    NotesConnectorDocument document =
View Full Code Here

  public void testDeleteDocument() throws Exception {
    NotesDocumentMock crawlDoc = new NotesDocumentMock();
    crawlDoc.addItem(new NotesItemMock("name", NCCONST.ITM_ACTION,
            "type", NotesItem.TEXT, "values", ActionType.DELETE));
    crawlDoc.addItem(new NotesItemMock("name", NCCONST.ITM_DOCID, "type",
            NotesItem.TEXT, "values", "docid"));

    NotesConnectorDocument document =
        new NotesConnectorDocument(null, null, null);
    document.setCrawlDoc("unid", crawlDoc);
View Full Code Here

  }

  private NotesDocumentMock getCrawlDatabaseAcl() throws Exception {
    // Mimic NotesDatabasePoller.createDatabaseAclDocument
    NotesDocumentMock crawlDoc = new NotesDocumentMock();
    crawlDoc.addItem(new NotesItemMock("name", NCCONST.NCITM_DBACL, "type",
            NotesItem.TEXT, "values", "true"));
    crawlDoc.addItem(new NotesItemMock("name", NCCONST.NCITM_DBACLINHERITTYPE,
            "type", NotesItem.TEXT, "values",
            NCCONST.DB_ACL_INHERIT_TYPE_ANDBOTH));
    crawlDoc.addItem(new NotesItemMock("name", NCCONST.NCITM_STATE,
View Full Code Here

  private NotesDocumentMock getCrawlDatabaseAcl() throws Exception {
    // Mimic NotesDatabasePoller.createDatabaseAclDocument
    NotesDocumentMock crawlDoc = new NotesDocumentMock();
    crawlDoc.addItem(new NotesItemMock("name", NCCONST.NCITM_DBACL, "type",
            NotesItem.TEXT, "values", "true"));
    crawlDoc.addItem(new NotesItemMock("name", NCCONST.NCITM_DBACLINHERITTYPE,
            "type", NotesItem.TEXT, "values",
            NCCONST.DB_ACL_INHERIT_TYPE_ANDBOTH));
    crawlDoc.addItem(new NotesItemMock("name", NCCONST.NCITM_STATE,
            "type", NotesItem.TEXT, "values", NCCONST.STATEFETCHED));
    crawlDoc.addItem(new NotesItemMock("name", NCCONST.ITM_ACTION,
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.