Package com.google.enterprise.connector.sharepoint.state

Examples of com.google.enterprise.connector.sharepoint.state.GlobalState


    assertEquals(TestConfiguration.userNameFormat2, author);
    assertEquals("Site", objectType);
  }
 
  public void testGetSiteDataPublishingSite() throws Exception {
    final GlobalState state = new GlobalState(clientFactory,
        TestConfiguration.googleConnectorWorkDir, FeedType.CONTENT_FEED);
    WebState ws = state.makeWebState(sharepointClientContext,
        TestConfiguration.publishingSiteUrl + SPConstants.DEFAULT_SITE_LANDING_PAGE);
    final SPDocument document = this.siteData.getSiteData(ws);
    assertNotNull(document);
    // document Type should be null. For Publishing sites it will be ACL.
    assertEquals(DocumentType.ACL,document.getDocumentType());
View Full Code Here


  public final void testAlerts() throws Throwable {
    final String internalName = this.sharepointClientContext.getSiteURL();
    final Calendar cLastMod = Calendar.getInstance();
    cLastMod.setTime(new Date());
    GlobalState gs = new GlobalState(clientFactory,
        TestConfiguration.googleConnectorWorkDir,
        TestConfiguration.feedType);
    WebState ws = gs.makeWebState(sharepointClientContext, TestConfiguration.Site1_URL);
    final ListState currentDummyAlertList = new ListState(internalName,
        SPConstants.ALERTS_TYPE, SPConstants.ALERTS_TYPE, cLastMod,
        SPConstants.ALERTS_TYPE, internalName, ws);

    List<SPDocument> lstAlerts = alerts.getAlerts(ws, currentDummyAlertList);
View Full Code Here

    // Assuming the initial crawl URL will never be marked for NoCrawl.
    assertFalse(webCrawlInfo.isNoCrawl());
  }

  public final void testUpdateListCrawlInfo() throws Exception {
    GlobalState globalState = TestConfiguration.initState(sharepointClientContext);
    WebState ws = globalState.lookupWeb(TestConfiguration.Site1_URL, sharepointClientContext);
    assertNotNull(ws);

    Set<ListState> allListStates = ws.getAllListStateSet();
    assertNotNull(allListStates);
    assertTrue(allListStates.size() > 0);
View Full Code Here

    assertEquals(wsResult.length, weburls.length);
    assertFalse(wsResult[0].isNoCrawl());
  }

  public final void testUpdateWebCrawlInfoInBatch() throws Exception {
    GlobalState globalState = TestConfiguration.initState(sharepointClientContext);
    siteDisc.updateWebCrawlInfoInBatch(globalState.getAllWebStateSet());
    for (WebState web : globalState.getAllWebStateSet()) {
      // Assuming the site URL being used for testing are not marked for
      // NoCrawl.
      assertFalse(web.isNoCrawl());
    }
  }
View Full Code Here

    sharepointClientContext.setIncluded_metadata(TestConfiguration.whiteList);
    sharepointClientContext.setExcluded_metadata(TestConfiguration.blackList);

    this.sharepointClient = new SharepointClient(clientFactory,
        sharepointClientContext);
    this.globalState = new GlobalState(clientFactory,
        sharepointClientContext.getGoogleConnectorWorkDir(),
        sharepointClientContext.getFeedType());
  }
View Full Code Here

   * @throws SharepointException
   */
  public void testTraverseToCheckValidLists() throws SharepointException {
    SharepointClientContext spContext = TestConfiguration.initContext();
    spContext.setBatchHint(Integer.MAX_VALUE);
    GlobalState gs = TestConfiguration.initState(spContext);
    WebState ws = gs.lookupWeb(TestConfiguration.Site1_URL, spContext);
    SharepointClient spclient = new SharepointClient(clientFactory, spContext);

    // Traverse the lists for the given web state
    spclient.traverse(gs, ws, 50, true);

View Full Code Here

  public void testFetchACLInBatches() throws SharepointException {
    SharepointClientContext spContext = TestConfiguration.initContext();
    spContext.setBatchHint(Integer.MAX_VALUE);
    spContext.setAclBatchSizeFactor(2);
    spContext.setFetchACLInBatches(true);
    GlobalState gs = TestConfiguration.initState(spContext);
    WebState ws = gs.lookupWeb(TestConfiguration.Site1_URL, spContext);
    SharepointClient spclient = new SharepointClient(clientFactory, spContext);

    SPDocument doc = new SPDocument("122", TestConfiguration.Site1_List1_URL,
        Calendar.getInstance(), ActionType.ADD);
View Full Code Here

    SharepointClientContext spContext = TestConfiguration.initContext();
    spContext.setPushAcls(false);

    SharepointClient spclient = new SharepointClient(clientFactory, spContext);

    GlobalState gs = TestConfiguration.initState(spContext);
    WebState ws = gs.lookupWeb(TestConfiguration.Site1_URL, spContext);

    // Test that when feeding ACLs is turned off, you still get true to
    // indicate docs need to be fed to GSA
    assertTrue(spclient.handleACLForDocuments(null, ws, gs, false));
View Full Code Here

  public void testHandleCrawlQueueForList() throws SharepointException {
    SharepointClientContext spContext = getSharePointClientContext();
    SharepointClient spClient =
        new SharepointClient(spContext.getClientFactory(), spContext);
    GlobalState globalState = new GlobalState(
        spContext.getClientFactory(),"temp",FeedType.CONTENT_FEED);
    WebState dummyWebState = globalState.makeWebState(
        spContext, "http://sharepoint.example.com/defaul.aspx");

    ListState list1 = new ListState("{GUID_LIST_1}", "List1", "GenericList",
        Calendar.getInstance(), "List",
        "http://sharepoint.example.com/List1/AllItems.aspx", dummyWebState);
View Full Code Here

  public void testTraverseNoACLs() throws SharepointException {
    SharepointClientContext spContext = getSharePointClientContext();
    SharepointClient spClient =
        new SharepointClient(spContext.getClientFactory(), spContext);
    GlobalState globalState = new GlobalState(
        spContext.getClientFactory(),"temp",FeedType.CONTENT_FEED);
    WebState dummyWebState = globalState.makeWebState(
        spContext, "http://sharepoint.example.com/defaul.aspx");

    ListState list1 = new ListState("{GUID_LIST_1}", "List1", "GenericList",
        Calendar.getInstance(), "List",
        "http://sharepoint.example.com/List1/AllItems.aspx", dummyWebState);
View Full Code Here

TOP

Related Classes of com.google.enterprise.connector.sharepoint.state.GlobalState

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.