• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java RecordingDocIdPusher类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.google.enterprise.adaptor.testing.RecordingDocIdPusher的典型用法代码示例。如果您正苦于以下问题:Java RecordingDocIdPusher类的具体用法?Java RecordingDocIdPusher怎么用?Java RecordingDocIdPusher使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



RecordingDocIdPusher类属于com.google.enterprise.adaptor.testing包,在下文中一共展示了RecordingDocIdPusher类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: testFakeAdaptorUserAndPasswordSpecified

import com.google.enterprise.adaptor.testing.RecordingDocIdPusher; //导入依赖的package包/类
@Test
public void testFakeAdaptorUserAndPasswordSpecified() throws Exception {
  AdAdaptor adAdaptor = new FakeAdaptor();
  RecordingDocIdPusher pusher = new RecordingDocIdPusher();
  Map<String, String> configEntries = new HashMap<String, String>();
  configEntries.put("gsa.hostname", "localhost");
  configEntries.put("ad.servers", "server1");
  configEntries.put("ad.servers.server1.host", "localhost");
  configEntries.put("ad.servers.server1.port", "1234");
  configEntries.put("ad.servers.server1.user", "username");
  configEntries.put("ad.servers.server1.password", "password");
  configEntries.put("ad.servers.server1.method", "ssl");
  configEntries.put("ad.userSearchBaseDN", "ou=DoesNotMatter");
  configEntries.put("server.port", "5680");
  configEntries.put("server.dashboardPort", "5681");
  pushGroupDefinitions(adAdaptor, configEntries, pusher, /*fullPush=*/ true,
      /*init=*/ true);
  Map<GroupPrincipal, Collection<Principal>> results =
      pusher.getGroupDefinitions();
  // the above (eventually) calls AdAdaptor.init() with the specified config.
}
 
开发者ID:googlegsa,项目名称:activedirectory,代码行数:22,代码来源:AdAdaptorTest.java


示例2: testFakeAdaptorDefaultUserAndPasswordSpecified

import com.google.enterprise.adaptor.testing.RecordingDocIdPusher; //导入依赖的package包/类
@Test
public void testFakeAdaptorDefaultUserAndPasswordSpecified()
    throws Exception {
  AdAdaptor adAdaptor = new FakeAdaptor();
  RecordingDocIdPusher pusher = new RecordingDocIdPusher();
  Map<String, String> configEntries = new HashMap<String, String>();
  configEntries.put("gsa.hostname", "localhost");
  configEntries.put("ad.servers", "server1");
  configEntries.put("ad.servers.server1.host", "localhost");
  configEntries.put("ad.servers.server1.port", "1234");
  configEntries.put("ad.servers.server1.method", "ssl");
  configEntries.put("ad.defaultUser", "defaultUser");
  configEntries.put("ad.defaultPassword", "defaultPassword");
  configEntries.put("ad.groupSearchBaseDN", "ou=DoesNotMatter");
  configEntries.put("server.port", "5680");
  configEntries.put("server.dashboardPort", "5681");
  pushGroupDefinitions(adAdaptor, configEntries, pusher, /*fullPush=*/ true,
      /*init=*/ true);
  Map<GroupPrincipal, Collection<Principal>> results =
      pusher.getGroupDefinitions();
  // the above (eventually) calls AdAdaptor.init() with the specified config.
}
 
开发者ID:googlegsa,项目名称:activedirectory,代码行数:23,代码来源:AdAdaptorTest.java


示例3: testGetDocIdsMarkPublicTrue

import com.google.enterprise.adaptor.testing.RecordingDocIdPusher; //导入依赖的package包/类
@Test
public void testGetDocIdsMarkPublicTrue() throws InterruptedException {
  SoapFactoryMock soapFactory = new SoapFactoryMock();
  OpentextAdaptor adaptor = new OpentextAdaptor(soapFactory);
  AdaptorContext context = ProxyAdaptorContext.getInstance();
  Config config = initConfig(adaptor, context);
  config.overrideKey("adaptor.markAllDocsAsPublic", "true");
  adaptor.init(context);

  soapFactory.memberServiceMock.addMember(
      getMember(1000, "user1", "User"));
  soapFactory.memberServiceMock.addMember(
      getMember(2000, "group1", "Group"));
  soapFactory.memberServiceMock.addMemberToGroup(
      2000, soapFactory.memberServiceMock.getMemberById(1000));

  RecordingDocIdPusher pusher = new RecordingDocIdPusher();
  adaptor.getDocIds(pusher);
  assertTrue(pusher.getGroupDefinitions().isEmpty());
}
 
开发者ID:googlegsa,项目名称:opentext,代码行数:21,代码来源:OpentextAdaptorTest.java


示例4: testGetDocIdsMarkPublicFalse

import com.google.enterprise.adaptor.testing.RecordingDocIdPusher; //导入依赖的package包/类
@Test
public void testGetDocIdsMarkPublicFalse() throws InterruptedException {
  SoapFactoryMock soapFactory = new SoapFactoryMock();
  OpentextAdaptor adaptor = new OpentextAdaptor(soapFactory);
  AdaptorContext context = ProxyAdaptorContext.getInstance();
  Config config = initConfig(adaptor, context);
  config.overrideKey("adaptor.markAllDocsAsPublic", "false");
  adaptor.init(context);

  soapFactory.memberServiceMock.addMember(
      getMember(1000, "user1", "User"));
  soapFactory.memberServiceMock.addMember(
      getMember(2000, "group1", "Group"));
  soapFactory.memberServiceMock.addMemberToGroup(
      2000, soapFactory.memberServiceMock.getMemberById(1000));

  RecordingDocIdPusher pusher = new RecordingDocIdPusher();
  adaptor.getDocIds(pusher);
  Map<GroupPrincipal, List<Principal>> expected =
      new HashMap<GroupPrincipal, List<Principal>>();
  expected.put(newGroupPrincipal("group1"),
      Lists.<Principal>newArrayList(newUserPrincipal("user1")));
  assertEquals(expected, pusher.getGroupDefinitions());
}
 
开发者ID:googlegsa,项目名称:opentext,代码行数:25,代码来源:OpentextAdaptorTest.java


示例5: testGetModifiedDocIdsNoResults

import com.google.enterprise.adaptor.testing.RecordingDocIdPusher; //导入依赖的package包/类
@Test
public void testGetModifiedDocIdsNoResults()
    throws IOException, InterruptedException {
  HttpServer server = startServer(RESPONSE_NO_RESULTS);
  try {
    SoapFactoryMock soapFactory = new SoapFactoryMock();
    OpentextAdaptor adaptor = new OpentextAdaptor(soapFactory);
    AdaptorContext context = ProxyAdaptorContext.getInstance();
    Config config = initConfig(adaptor, context);
    config.overrideKey("opentext.displayUrl.contentServerUrl",
        "http://127.0.0.1:" + server.getAddress().getPort() + "/");
    config.overrideKey("opentext.src", "1234, 56780, 12341");
    adaptor.init(context);

    RecordingDocIdPusher pusher = new RecordingDocIdPusher();
    adaptor.getModifiedDocIds(pusher);
    assertEquals(Lists.newArrayList(), pusher.getDocIds());
  } finally {
    server.stop(0);
  }
}
 
开发者ID:googlegsa,项目名称:opentext,代码行数:22,代码来源:OpentextAdaptorTest.java


示例6: testOverflowToDocIdPusher

import com.google.enterprise.adaptor.testing.RecordingDocIdPusher; //导入依赖的package包/类
@Test
public void testOverflowToDocIdPusher() throws Exception {
  final String golden = "<!DOCTYPE html>\n"
      + "<html><head><title>s</title></head>"
      + "<body><h1><!--googleoff: index-->Site<!--googleon: index--> s</h1>"
      + "<p><!--googleoff: index-->Lists<!--googleon: index--></p>"
      + "<ul><li><a href=\"s/l\">My List</a></li></ul>"
      + "</body></html>";
  final List<DocIdPusher.Record> goldenRecords = Arrays.asList(
      new DocIdPusher.Record.Builder(new DocId("s/l")).build());
  RecordingDocIdPusher docIdPusher = new RecordingDocIdPusher();
  writer = new HtmlResponseWriter(baos, charset,
      context.getDocIdEncoder(), Locale.ENGLISH, 1, docIdPusher,
      executor);
  writer.start(new DocId("s"), ObjectType.SITE, null);
  writer.startSection(ObjectType.LIST);
  writer.addLink(new DocId("s/l"), "My List");
  writer.finish();
  assertEquals(golden, new String(baos.toByteArray(), charset));
  assertEquals(goldenRecords, docIdPusher.getRecords());
}
 
开发者ID:googlegsa,项目名称:sharepoint,代码行数:22,代码来源:HtmlResponseWriterTest.java


示例7: testAdaptorInitWithCustomSaml

import com.google.enterprise.adaptor.testing.RecordingDocIdPusher; //导入依赖的package包/类
@Test
public void testAdaptorInitWithCustomSaml() throws Exception {
  RecordingDocIdPusher pusher = new RecordingDocIdPusher();
  adaptor = new SharePointUserProfileAdaptor(
      new MockUserProfileServiceFactoryImpl(null),
      new AuthenticationClientFactoryImpl());
  String factoryMethod = MockCustomSamlHandshakeManager.class
      .getName() + ".getInstance";
  config.overrideKey("sharepoint.customSamlManager", factoryMethod);
  config.overrideKey("gsa.version", "7.4.0-0");
  config.overrideKey("test.token", "test token");
  config.overrideKey("test.cookie", "test cookie");
  adaptor.init(new MockAdaptorContext(config, pusher));
  adaptor.destroy();
  adaptor = null;
}
 
开发者ID:googlegsa,项目名称:sharepoint,代码行数:17,代码来源:SharePointUserProfileAdaptorTest.java


示例8: testBlankCredentialsOnWindows

import com.google.enterprise.adaptor.testing.RecordingDocIdPusher; //导入依赖的package包/类
@Test
public void testBlankCredentialsOnWindows() throws Exception {
  Assume.assumeTrue(System.getProperty("os.name").contains("Windows"));
  Config adaptorConfig = new Config();
  new SharePointUserProfileAdaptor().initConfig(adaptorConfig);
  adaptorConfig.overrideKey(
      "sharepoint.server", "http://sharepoint.example.com");
  assertEquals(adaptorConfig.getValue("sharepoint.username"), "");
  assertEquals(adaptorConfig.getValue("sharepoint.password"), "");
  MockUserProfileServiceFactoryImpl serviceFactory =
      new MockUserProfileServiceFactoryImpl(null);
  adaptor = new SharePointUserProfileAdaptor(serviceFactory,
      authenticationFactory);
  RecordingDocIdPusher pusher = new RecordingDocIdPusher();
  adaptor.init(new MockAdaptorContext(adaptorConfig, pusher));
}
 
开发者ID:googlegsa,项目名称:sharepoint,代码行数:17,代码来源:SharePointUserProfileAdaptorTest.java


示例9: testGetDocContentNotFound

import com.google.enterprise.adaptor.testing.RecordingDocIdPusher; //导入依赖的package包/类
@Test
public void testGetDocContentNotFound() throws Exception {
  MockUserProfileServiceFactoryImpl serviceFactory =
      new MockUserProfileServiceFactoryImpl(null);
  adaptor = new SharePointUserProfileAdaptor(serviceFactory,
      authenticationFactory);

  RecordingDocIdPusher pusher = new RecordingDocIdPusher();
  adaptor.init(new MockAdaptorContext(config, pusher));
  
  DocRequest request = new DocRequest(
      new DocId(SharePointUserProfileAdaptor.SOCIAL_ID_PREFIX + "user1"));
  RecordingResponse response = new RecordingResponse();
  adaptor.getDocContent(request, response);
  assertEquals(State.NOT_FOUND, response.getState());
}
 
开发者ID:googlegsa,项目名称:sharepoint,代码行数:17,代码来源:SharePointUserProfileAdaptorTest.java


示例10: testGetDocContentInvalidDocId

import com.google.enterprise.adaptor.testing.RecordingDocIdPusher; //导入依赖的package包/类
@Test
public void testGetDocContentInvalidDocId() throws Exception {
  MockUserProfileServiceFactoryImpl serviceFactory =
      new MockUserProfileServiceFactoryImpl(null);
  ArrayOfPropertyData profile = new ArrayOfPropertyData();
  populateProfileProperties(profile,
      SharePointUserProfileAdaptor.PROFILE_ACCOUNTNAME_PROPERTY,
      new String[] {"user1"});
  serviceFactory.addUserProfileToCollection(1, 2, "user1", profile, null);
  adaptor = new SharePointUserProfileAdaptor(serviceFactory,
      authenticationFactory);

  RecordingDocIdPusher pusher = new RecordingDocIdPusher();
  adaptor.init(new MockAdaptorContext(config, pusher));

  DocRequest request = new DocRequest(
      new DocId("user1"));
  RecordingResponse response = new RecordingResponse();
  adaptor.getDocContent(request, response);
  assertEquals(State.NOT_FOUND, response.getState());
}
 
开发者ID:googlegsa,项目名称:sharepoint,代码行数:22,代码来源:SharePointUserProfileAdaptorTest.java


示例11: testGetModifiedDocIdsWithEmptyChangeToken

import com.google.enterprise.adaptor.testing.RecordingDocIdPusher; //导入依赖的package包/类
@Test
public void testGetModifiedDocIdsWithEmptyChangeToken() throws Exception {
  MockUserProfileServiceFactoryImpl serviceFactory =
      new MockUserProfileServiceFactoryImpl(
          "change token on mock repository");
  adaptor = new SharePointUserProfileAdaptor(serviceFactory,
      authenticationFactory);
  RecordingDocIdPusher pusher = new RecordingDocIdPusher();
  adaptor.init(new MockAdaptorContext(config, pusher));
  adaptor.setUserProfileChangeToken(null);
  assertEquals(0, pusher.getRecords().size());
  adaptor.getModifiedDocIds(pusher);
  assertEquals(0, pusher.getRecords().size());
  assertEquals("change token on mock repository",
      adaptor.getUserProfileChangeToken());
}
 
开发者ID:googlegsa,项目名称:sharepoint,代码行数:17,代码来源:SharePointUserProfileAdaptorTest.java


示例12: testGetModifiedDocIdsWithNoChange

import com.google.enterprise.adaptor.testing.RecordingDocIdPusher; //导入依赖的package包/类
@Test
public void testGetModifiedDocIdsWithNoChange() throws Exception {
  MockUserProfileServiceFactoryImpl serviceFactory =
      new MockUserProfileServiceFactoryImpl(
          "same current token");
  adaptor = new SharePointUserProfileAdaptor(serviceFactory,
      authenticationFactory);
  RecordingDocIdPusher pusher = new RecordingDocIdPusher();
  adaptor.init(new MockAdaptorContext(config, pusher));
  adaptor.setUserProfileChangeToken("same current token");
  assertEquals(0, pusher.getRecords().size());
  adaptor.getModifiedDocIds(pusher);
  assertEquals(0, pusher.getRecords().size());
  assertEquals("same current token",
      adaptor.getUserProfileChangeToken());
}
 
开发者ID:googlegsa,项目名称:sharepoint,代码行数:17,代码来源:SharePointUserProfileAdaptorTest.java


示例13: testGetModifiedDocIdsDiffrentTokenNoChange

import com.google.enterprise.adaptor.testing.RecordingDocIdPusher; //导入依赖的package包/类
@Test
public void testGetModifiedDocIdsDiffrentTokenNoChange() throws Exception {
  MockUserProfileServiceFactoryImpl serviceFactory =
      new MockUserProfileServiceFactoryImpl(
          "new token");
  adaptor = new SharePointUserProfileAdaptor(serviceFactory,
      authenticationFactory);
  RecordingDocIdPusher pusher = new RecordingDocIdPusher();
  adaptor.init(new MockAdaptorContext(config, pusher));
  adaptor.setUserProfileChangeToken("old token");
  assertEquals(0, pusher.getRecords().size());
  adaptor.getModifiedDocIds(pusher);
  assertEquals(0, pusher.getRecords().size());
  assertEquals("new token",
      adaptor.getUserProfileChangeToken());
}
 
开发者ID:googlegsa,项目名称:sharepoint,代码行数:17,代码来源:SharePointUserProfileAdaptorTest.java


示例14: testGetModifiedDocIdsInvalidToken

import com.google.enterprise.adaptor.testing.RecordingDocIdPusher; //导入依赖的package包/类
@Test
public void testGetModifiedDocIdsInvalidToken()throws Exception {
  MockUserProfileServiceFactoryImpl serviceFactory =
      new MockUserProfileServiceFactoryImpl(
          "sp token");
  adaptor = new SharePointUserProfileAdaptor(serviceFactory,
      authenticationFactory);
  RecordingDocIdPusher pusher = new RecordingDocIdPusher();
  adaptor.init(new MockAdaptorContext(config, pusher));
  adaptor.setUserProfileChangeToken("invalid");
  assertEquals(0, pusher.getRecords().size());
  adaptor.getModifiedDocIds(pusher);
  assertEquals(0, pusher.getRecords().size());
  assertEquals("sp token",
      adaptor.getUserProfileChangeToken());
}
 
开发者ID:googlegsa,项目名称:sharepoint,代码行数:17,代码来源:SharePointUserProfileAdaptorTest.java


示例15: testUpdateAcls

import com.google.enterprise.adaptor.testing.RecordingDocIdPusher; //导入依赖的package包/类
private Map<DocId, Acl> testUpdateAcls(DocumentumAdaptor adaptor,
    Checkpoint checkpoint, DfException expectedCause,
    Set<DocId> expectedAclIds, Checkpoint expectedCheckpoint)
    throws DfException, IOException, InterruptedException {
  RecordingDocIdPusher pusher = new RecordingDocIdPusher();
  adaptor.modifiedAclTraverser.setCheckpoint(checkpoint);
  try {
    adaptor.getModifiedDocIds(pusher);
    assertNull("Expected an exception at " + checkpoint, expectedCause);
  } catch (IOException e) {
    if (expectedCause == NO_EXCEPTION || expectedCause != e.getCause()) {
      throw e;
    }
  }
  assertEquals(expectedCheckpoint,
      adaptor.modifiedAclTraverser.getCheckpoint());

  Map<DocId, Acl> aclMap = pusher.getNamedResources();
  assertEquals(expectedAclIds, aclMap.keySet());
  return aclMap;
}
 
开发者ID:googlegsa,项目名称:documentum,代码行数:22,代码来源:DocumentumAdaptorTest.java


示例16: checkModifiedGroupsPushed

import com.google.enterprise.adaptor.testing.RecordingDocIdPusher; //导入依赖的package包/类
private void checkModifiedGroupsPushed(DocumentumAdaptor adaptor,
    Checkpoint checkpoint, DfException expectedCause,
    Map<GroupPrincipal, ? extends Collection<? extends Principal>>
    expectedGroups, Checkpoint expectedCheckpoint)
    throws DfException, IOException, InterruptedException {
  RecordingDocIdPusher pusher = new RecordingDocIdPusher();
  adaptor.modifiedGroupTraverser.setCheckpoint(checkpoint);

  try {
    adaptor.getModifiedDocIds(pusher);
    assertNull("Expected an exception at " + checkpoint, expectedCause);
  } catch (IOException e) {
    if (expectedCause == NO_EXCEPTION || expectedCause != e.getCause()) {
      throw e;
    }
  }

  assertEquals(expectedGroups, pusher.getGroupDefinitions());
  assertEquals(expectedCheckpoint,
      adaptor.modifiedGroupTraverser.getCheckpoint());
}
 
开发者ID:googlegsa,项目名称:documentum,代码行数:22,代码来源:DocumentumAdaptorTest.java


示例17: testFakeAdaptorInit

import com.google.enterprise.adaptor.testing.RecordingDocIdPusher; //导入依赖的package包/类
@Test
public void testFakeAdaptorInit() throws Exception {
  AdAdaptor adAdaptor = new FakeAdaptor();
  RecordingDocIdPusher pusher = new RecordingDocIdPusher();
  Map<String, String> configEntries = new HashMap<String, String>();
  configEntries.put("gsa.hostname", "localhost");
  configEntries.put("ad.servers", "server1,server2");
  configEntries.put("ad.servers.server1.host", "localhost");
  configEntries.put("ad.servers.server1.port", "1234");
  configEntries.put("ad.servers.server1.user", "user-override");
  configEntries.put("ad.servers.server1.method", "ssl");
  configEntries.put("ad.servers.server2.host", "localhost");
  configEntries.put("ad.servers.server2.port", "1234");
  configEntries.put("ad.servers.server2.password", "password-override");
  configEntries.put("ad.servers.server2.method", "standard");
  configEntries.put("ad.defaultUser", "defaultUser");
  configEntries.put("ad.defaultPassword", "password");
  configEntries.put("ad.ldapReadTimeoutSecs", "");
  configEntries.put("ad.userSearchFilter", "cn=UserNotFound");
  configEntries.put("server.port", "5680");
  configEntries.put("server.dashboardPort", "5681");
  pushGroupDefinitions(adAdaptor, configEntries, pusher, /*fullPush=*/ true,
      /*init=*/ true);
  Map<GroupPrincipal, Collection<Principal>> results =
      pusher.getGroupDefinitions();
  // the above (eventually) calls AdAdaptor.init() with the specified config.
}
 
开发者ID:googlegsa,项目名称:activedirectory,代码行数:28,代码来源:AdAdaptorTest.java


示例18: testFakeAdaptorInitZeroTimeout

import com.google.enterprise.adaptor.testing.RecordingDocIdPusher; //导入依赖的package包/类
@Test
public void testFakeAdaptorInitZeroTimeout() throws Exception {
  AdAdaptor adAdaptor = new FakeAdaptor();
  RecordingDocIdPusher pusher = new RecordingDocIdPusher();
  Map<String, String> configEntries = new HashMap<String, String>();
  configEntries.put("gsa.hostname", "localhost");
  configEntries.put("ad.servers", "server1,server2");
  configEntries.put("ad.servers.server1.host", "localhost");
  configEntries.put("ad.servers.server1.port", "1234");
  configEntries.put("ad.servers.server1.user", "user-override");
  configEntries.put("ad.servers.server1.method", "ssl");
  configEntries.put("ad.servers.server2.host", "localhost");
  configEntries.put("ad.servers.server2.port", "1234");
  configEntries.put("ad.servers.server2.password", "password-override");
  configEntries.put("ad.servers.server2.method", "standard");
  configEntries.put("ad.defaultUser", "defaultUser");
  configEntries.put("ad.defaultPassword", "password");
  configEntries.put("ad.ldapReadTimeoutSecs", "0");
  configEntries.put("ad.groupSearchFilter", "cn=GroupNotFound");
  configEntries.put("server.port", "5680");
  configEntries.put("server.dashboardPort", "5681");
  pushGroupDefinitions(adAdaptor, configEntries, pusher, /*fullPush=*/ true,
      /*init=*/ true);
  Map<GroupPrincipal, Collection<Principal>> results =
      pusher.getGroupDefinitions();
  // the above (eventually) calls AdAdaptor.init() with the specified config.
}
 
开发者ID:googlegsa,项目名称:activedirectory,代码行数:28,代码来源:AdAdaptorTest.java


示例19: testFakeAdaptorGetDocIds

import com.google.enterprise.adaptor.testing.RecordingDocIdPusher; //导入依赖的package包/类
@Test
public void testFakeAdaptorGetDocIds() throws Exception {
  AdAdaptor adAdaptor = new FakeAdaptor();
  RecordingDocIdPusher pusher = new RecordingDocIdPusher();
  Map<String, String> configEntries = defaultConfig();
  pushGroupDefinitions(adAdaptor, configEntries, pusher, /*fullPush=*/ true,
      /*init=*/ true);
  Map<GroupPrincipal, Collection<Principal>> results =
      pusher.getGroupDefinitions();

  final Map<GroupPrincipal, Collection<Principal>> goldenGroups =
      new HashMap<GroupPrincipal, Collection<Principal>>();
  {
    Principal everyone = new GroupPrincipal("Everyone", "Default");
    goldenGroups.put((GroupPrincipal) everyone, new ArrayList<Principal>());
    goldenGroups.put(new GroupPrincipal("[email protected]", "Default"),
        new ArrayList<Principal>());
    goldenGroups.put(new GroupPrincipal("Authenticated [email protected] Authority",
        "Default"), Arrays.asList(everyone));
    goldenGroups.put(new GroupPrincipal("[email protected] Authority",
        "Default"), Arrays.asList(everyone));
  }
  assertEquals(goldenGroups, results);

  // make sure pushGroupDefinitions call is idempotent
  pushGroupDefinitions(adAdaptor, configEntries, pusher, /*fullPush=*/ true,
      /*init=*/ false);
  results = pusher.getGroupDefinitions();
  assertEquals(goldenGroups, results);

  // even when doing an incremental push
  pushGroupDefinitions(adAdaptor, configEntries, pusher, /*fullPush=*/ false,
      /*init=*/ false);
  results = pusher.getGroupDefinitions();
  assertEquals(goldenGroups, results);
}
 
开发者ID:googlegsa,项目名称:activedirectory,代码行数:37,代码来源:AdAdaptorTest.java


示例20: testMultipleFullGroupPushes

import com.google.enterprise.adaptor.testing.RecordingDocIdPusher; //导入依赖的package包/类
@Test
public void testMultipleFullGroupPushes() throws Exception {
  MockLdapContext ldapContext = defaultMockLdapContext();
  AdAdaptor adAdaptor = new FakeAdaptor(ldapContext);
  RecordingDocIdPusher pusher = new RecordingDocIdPusher();
  initializeAdaptorConfig(adAdaptor, defaultConfig());

  adAdaptor.getDocIds(pusher);
  HashMap<GroupPrincipal, Collection<Principal>> goldenGroups =
      new HashMap<GroupPrincipal, Collection<Principal>>();
  Principal everyone = new GroupPrincipal("Everyone", "Default");
  goldenGroups.put((GroupPrincipal) everyone, new ArrayList<Principal>());
  goldenGroups.put(new GroupPrincipal("Authenticated [email protected] Authority",
      "Default"), Arrays.asList(everyone));
  goldenGroups.put(new GroupPrincipal("[email protected] Authority",
      "Default"), Arrays.asList(everyone));
  assertEquals(goldenGroups, pusher.getGroupDefinitions());

  // Add the sam group.
  addDefsToMockLdapContext(ldapContext, false);
  adAdaptor.getDocIds(pusher);
  HashMap<GroupPrincipal, Collection<Principal>> newGoldenGroups =
      new HashMap<GroupPrincipal, Collection<Principal>>(goldenGroups);
  newGoldenGroups.put(new GroupPrincipal("[email protected]", "Default"),
      new ArrayList<Principal>());
  assertEquals(newGoldenGroups, pusher.getGroupDefinitions());

  // Clear the added group.
  ldapContext.clearSearchResults();
  adAdaptor.getDocIds(pusher);
  assertEquals(goldenGroups, pusher.getGroupDefinitions());
}
 
开发者ID:googlegsa,项目名称:activedirectory,代码行数:33,代码来源:AdAdaptorTest.java



注:本文中的com.google.enterprise.adaptor.testing.RecordingDocIdPusher类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java JackrabbitAccessControlList类代码示例发布时间:2022-05-22
下一篇:
Java ScaleDescriptor类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap