Package com.google.enterprise.connector.sharepoint.wsclient.mock

Examples of com.google.enterprise.connector.sharepoint.wsclient.mock.MockClientFactory


    assertNotNull(chk);
    System.out.println("[ checkpoint() ] Test Completed.");
  }

  public void testDefensiveCopyForDocumentList() {
    MockClientFactory mockClientFactory = new MockClientFactory();
    GlobalState globalState =
        new GlobalState(mockClientFactory,"temp",FeedType.CONTENT_FEED);
    List<SPDocument> mutableDocumentList = new ArrayList<SPDocument>();
    SPDocument document1 = new SPDocument(
        "LIST_ITEM_1", "http://sharepoint.example.com/List1/DispForm.aspx?ID=1",
View Full Code Here


  protected void setUp() throws Exception {
    configMap = Maps.newHashMap(TestConfiguration.getConfigMap());
    String isSelected = configMap.get(SPConstants.PUSH_ACLS);
    editMode = !isSelected.equalsIgnoreCase(SPConstants.TRUE);
    connectorType = new SharepointConnectorType();
    connectorType.setClientFactory(new MockClientFactory());
  }
View Full Code Here

    sharepointClientContext.clearExcludedURLLogs();
  }
 
  public void testGetAclBatchSizeNoBatchingInheritedAcls() throws Exception {
    SharepointClientContext spc
        = new SharepointClientContext(new MockClientFactory());
    spc.setTraversalContext(setSupportsInheritedAcls(true));
    spc.setPushAcls(true);
    spc.setAclBatchSizeFactor(10);
    spc.setFetchACLInBatches(false);
   
View Full Code Here

    assertEquals(-1, spc.getAclBatchSize());   
  }
 
  public void testGetAclBatchSizeFlattenedAcls() throws Exception {
    SharepointClientContext spc
        = new SharepointClientContext(new MockClientFactory());
    spc.setTraversalContext(setSupportsInheritedAcls(false));  
    spc.setPushAcls(true);
    spc.setAclBatchSizeFactor(10);
    spc.setFetchACLInBatches(false);
   
View Full Code Here

    assertEquals(50, spc.getAclBatchSize());   
  }
 
  public void testGetAclBatchSizeFlattenedAclsNoBatching() throws Exception {
    SharepointClientContext spc
        = new SharepointClientContext(new MockClientFactory());
    spc.setTraversalContext(setSupportsInheritedAcls(false));   
    spc.setPushAcls(true);
    spc.setAclBatchSizeFactor(0);
    spc.setFetchACLInBatches(false);
   
View Full Code Here

    assertEquals(-1, spc.getAclBatchSize());   
  }
 
  public void testGetAclBatchSizeBatching() throws Exception {
    SharepointClientContext spc
        = new SharepointClientContext(new MockClientFactory());
    spc.setTraversalContext(setSupportsInheritedAcls(true));  
    spc.setPushAcls(true);
    spc.setAclBatchSizeFactor(10);
    spc.setFetchACLInBatches(true);
   
View Full Code Here

  }
 
  // ACL Batch size factor > 500 will result in batch size 1.
  public void testGetAclBatchSizeLargeBatchSizeFatcor() throws Exception {
    SharepointClientContext spc
        = new SharepointClientContext(new MockClientFactory());
    spc.setTraversalContext(setSupportsInheritedAcls(true));  
    spc.setPushAcls(true);
    spc.setAclBatchSizeFactor(1000);
    spc.setFetchACLInBatches(true);
   
View Full Code Here

    assertEquals(1, spc.getAclBatchSize());
  }
  
  public void testGetAclBatchSizeNoAcls() throws Exception {
    SharepointClientContext spc
        = new SharepointClientContext(new MockClientFactory());   
    spc.setTraversalContext(setSupportsInheritedAcls(true));  
    spc.setPushAcls(false);
    spc.setAclBatchSizeFactor(10);
    spc.setFetchACLInBatches(true);
   
View Full Code Here

    WebState webState = createMock(WebState.class);
    webState.addSPGroupToResolve(String.valueOf(principalId));
    replay(dao, webState);

    SharepointClientContext clientContext =
        TestConfiguration.initContext(new MockClientFactory());
    clientContext.setUserDataStoreDAO(dao);
    GssPrincipal principal = new GssPrincipal(principalId, principalName,
        PrincipalType.SPGROUP, new GssPrincipal[0], null);
    Set<Principal> users = ImmutableSet.of(); // unwritable
    Set<Principal> groups = Sets.newHashSet();
View Full Code Here

    assertEquals(ImmutableList.of(document2), list2.getCrawlQueue());
  }

  /** Returns SharepointClientContext with MockClientFactory for tests. */
  private SharepointClientContext getSharePointClientContext() {
    MockClientFactory mockClientFactory = new MockClientFactory() {
      @Override public int checkConnectivity(HttpMethodBase method,
          Credentials credentials) throws IOException {
        return 200;
      }
    };
View Full Code Here

TOP

Related Classes of com.google.enterprise.connector.sharepoint.wsclient.mock.MockClientFactory

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.