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

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


      assertNotNull("user has no groups", userGroups.get(id));

      // Change the result of the user selection formula. Call
      // checkUserDeletions and verify that the user was removed
      // from the user cache.
      doc.replaceItemValue(
          "evaluate_" + connectorSession.getUserSelectionFormula(),
          new NotesItemMock("name",
              "evaluate_" + connectorSession.getUserSelectionFormula(),
              "type", NotesItem.TEXT, "values", 0.0));
View Full Code Here


      getGroupData();
      getUserData();
      assertUserDoesNotExist("anakin");
      assertNull("user still has groups", userGroups.get(id));
    } finally {
      doc.replaceItemValue(
          "evaluate_" + connectorSession.getUserSelectionFormula(),
          new NotesItemMock("name",
              "evaluate_" + connectorSession.getUserSelectionFormula(),
              "type", NotesItem.TEXT, "values", 1.0));
    }
View Full Code Here

    try {
      assertUserExists("kenobi");
      assertUserDoesNotExist("ben");

      // Change the user name.
      doc.replaceItemValue(
          "evaluate_" + connectorSession.getUserNameFormula(),
          new NotesItemMock("name",
            "evaluate_" + connectorSession.getUserNameFormula(),
            "type", NotesItem.TEXT, "values", "ben"));
View Full Code Here

    return crawlDoc;
  }

  private NotesDocumentMock getAttachmentDoc() throws Exception {
    NotesDocumentMock crawlDoc = getCrawlDoc(false);
    crawlDoc.replaceItemValue(NCCONST.ITM_DOCID,
        String.format(NCCONST.SITM_ATTACHMENTDOCID,
        "http://host:42/replicaid/0/unid", "attachmentUnid"));
    crawlDoc.replaceItemValue(NCCONST.ITM_DISPLAYURL,
        String.format(NCCONST.SITM_ATTACHMENTDISPLAYURL,
        "http://host:42/replicaid/0/unid", "filename.doc"));
View Full Code Here

  private NotesDocumentMock getAttachmentDoc() throws Exception {
    NotesDocumentMock crawlDoc = getCrawlDoc(false);
    crawlDoc.replaceItemValue(NCCONST.ITM_DOCID,
        String.format(NCCONST.SITM_ATTACHMENTDOCID,
        "http://host:42/replicaid/0/unid", "attachmentUnid"));
    crawlDoc.replaceItemValue(NCCONST.ITM_DISPLAYURL,
        String.format(NCCONST.SITM_ATTACHMENTDISPLAYURL,
        "http://host:42/replicaid/0/unid", "filename.doc"));
    return crawlDoc;
  }
View Full Code Here

        crawlDoc.getItemValueString(NCCONST.NCITM_DOCAUTHORREADERS));

    item = new NotesItemMock("name", "readers",
        "type", NotesItem.TEXT, "values", "reader 1", "reader 2");
    item.setReaders(true);
    srcDoc.replaceItemValue("readers", item);
    crawlerThread.getDocumentReaderNames(crawlDoc, srcDoc);
    assertEquals("reader 1;reader 2",
        crawlDoc.getFirstItem(NCCONST.NCITM_DOCAUTHORREADERS).getText(100));

    item = new NotesItemMock("name", "authors", "type", NotesItem.TEXT,
View Full Code Here

    assertEquals(Boolean.TRUE.toString(),
        crawlDoc.getItemValueString(NCCONST.ITM_ISPUBLIC));

    item = new NotesItemMock("name", NCCONST.NCITM_AUTHTYPE,
        "type", NotesItem.TEXT, "values", NCCONST.AUTH_ACL);
    crawlDoc.replaceItemValue(NCCONST.NCITM_AUTHTYPE, item);
    crawlerThread.setDocumentSecurity(crawlDoc, null);
    assertEquals(Boolean.FALSE.toString(),
        crawlDoc.getItemValueString(NCCONST.ITM_ISPUBLIC));

    item = new NotesItemMock("name", NCCONST.NCITM_AUTHTYPE,
View Full Code Here

    assertEquals(Boolean.FALSE.toString(),
        crawlDoc.getItemValueString(NCCONST.ITM_ISPUBLIC));

    item = new NotesItemMock("name", NCCONST.NCITM_AUTHTYPE,
        "type", NotesItem.TEXT, "values", NCCONST.AUTH_CONNECTOR);
    crawlDoc.replaceItemValue(NCCONST.NCITM_AUTHTYPE, item);
    crawlerThread.setDocumentSecurity(crawlDoc, null);
    assertEquals(Boolean.FALSE.toString(),
        crawlDoc.getItemValueString(NCCONST.ITM_ISPUBLIC));
  }
View Full Code Here

  public void testSendDeleteRequests() throws Exception {
    NotesDocId notesId = new NotesDocId("http://testserver/replicaid/0/unid");
   
    NotesDocumentMock crawlDoc = new NotesDocumentMock();
    crawlDoc.replaceItemValue(NCCONST.NCITM_SERVER, notesId.getServer());
    crawlDoc.replaceItemValue(NCCONST.NCITM_REPLICAID, notesId.getReplicaId());
    crawlDoc.replaceItemValue(NCCONST.NCITM_UNID, notesId.getDocId());
    crawlDoc.replaceItemValue(NCCONST.ITM_DOCID, notesId.toString());
   
    Vector<String> attachmentNames = new Vector<String>();
View Full Code Here

  public void testSendDeleteRequests() throws Exception {
    NotesDocId notesId = new NotesDocId("http://testserver/replicaid/0/unid");
   
    NotesDocumentMock crawlDoc = new NotesDocumentMock();
    crawlDoc.replaceItemValue(NCCONST.NCITM_SERVER, notesId.getServer());
    crawlDoc.replaceItemValue(NCCONST.NCITM_REPLICAID, notesId.getReplicaId());
    crawlDoc.replaceItemValue(NCCONST.NCITM_UNID, notesId.getDocId());
    crawlDoc.replaceItemValue(NCCONST.ITM_DOCID, notesId.toString());
   
    Vector<String> attachmentNames = new Vector<String>();
    attachmentNames.add("attachment1.doc");
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.