当前位置: 首页>>代码示例>>Java>>正文


Java Config.overrideKey方法代码示例

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


在下文中一共展示了Config.overrideKey方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testXmlSearchDocIdNoStartPoint

import com.google.enterprise.adaptor.Config; //导入方法依赖的package包/类
@Test
public void testXmlSearchDocIdNoStartPoint() throws Exception {
  String response =
      "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
      + "<SearchResult>"
      + "  <OTLocation>"
      + "  <![CDATA[2000 1234 5678]]>"
      + " </OTLocation>"
      + "</SearchResult>";

  SoapFactoryMock soapFactory = new SoapFactoryMock();
  OpentextAdaptor adaptor = new OpentextAdaptor(soapFactory);
  AdaptorContext context = ProxyAdaptorContext.getInstance();
  Config config = initConfig(adaptor, context);
  config.overrideKey("opentext.src", "9012");
  adaptor.init(context);

  String docId = adaptor.getXmlSearchDocId(parseXml(response));
  assertEquals(null, docId);
}
 
开发者ID:googlegsa,项目名称:opentext,代码行数:21,代码来源:OpentextAdaptorTest.java

示例2: testAclPublicRightNotEnabled

import com.google.enterprise.adaptor.Config; //导入方法依赖的package包/类
@Test
public void testAclPublicRightNotEnabled() throws IOException {
  thrown.expect(RuntimeException.class);
  thrown.expectMessage(
      "No ACL information for DocId(2000/DocumentName:3000)");

  NodeRights nodeRights = new NodeRights();
  nodeRights.setPublicRight(getNodeRight(-1, "Public"));
  NodeMock documentNode = new NodeMock(3000, "DocumentName", "Document");
  SoapFactoryMock soapFactory = new SoapFactoryMock();
  soapFactory.documentManagementMock
      .setNodeRights(documentNode.getID(), nodeRights);
  OpentextAdaptor adaptor = new OpentextAdaptor(soapFactory);
  AdaptorContext context = ProxyAdaptorContext.getInstance();
  Config config = initConfig(adaptor, context);
  config.overrideKey("opentext.publicAccessGroupEnabled", "false");
  adaptor.init(context);
  RecordingResponse response = new RecordingResponse();
  adaptor.doAcl(soapFactory.newDocumentManagement("token"),
      new OpentextDocId(new DocId("2000/DocumentName:3000")),
      documentNode, response);
}
 
开发者ID:googlegsa,项目名称:opentext,代码行数:23,代码来源:OpentextAdaptorTest.java

示例3: testAuthenticateUserDirectoryServices

import com.google.enterprise.adaptor.Config; //导入方法依赖的package包/类
@Test
public void testAuthenticateUserDirectoryServices() {
  SoapFactoryMock soapFactory = new SoapFactoryMock();
  OpentextAdaptor adaptor = new OpentextAdaptor(soapFactory);
  assertFalse("authenticate called before init",
      soapFactory.dsAuthenticationMock.authenticateCalled);
  AdaptorContext context = ProxyAdaptorContext.getInstance();
  Config config = initConfig(adaptor, context);
  config.overrideKey("opentext.directoryServicesUrl", "/otdsws/");
  adaptor.init(context);
  assertFalse("authUser called after init",
      soapFactory.authenticationMock.authenticateUserCalled);
  assertTrue("authenticate not called after init",
      soapFactory.dsAuthenticationMock.authenticateCalled);
  assertTrue("validateUser not called after init",
      soapFactory.authenticationMock.validateUserCalled);
  assertEquals("unexpected authentication token", "validation_token",
      soapFactory.authenticationMock.authenticationToken);
}
 
开发者ID:googlegsa,项目名称:opentext,代码行数:20,代码来源:OpentextAdaptorTest.java

示例4: testAuthenticateUserDirectoryServicesOtherError

import com.google.enterprise.adaptor.Config; //导入方法依赖的package包/类
@Test
public void testAuthenticateUserDirectoryServicesOtherError() {
  thrown.expect(SOAPFaultException.class);
  thrown.expectMessage("Other failure");

  SoapFactoryMock soapFactory = new SoapFactoryMock();
  OpentextAdaptor adaptor = new OpentextAdaptor(soapFactory);
  assertFalse("authenticate called before init",
      soapFactory.dsAuthenticationMock.authenticateCalled);
  AdaptorContext context = ProxyAdaptorContext.getInstance();
  Config config = initConfig(adaptor, context);
  config.overrideKey("opentext.directoryServicesUrl", "/otdsws/");

  soapFactory.dsAuthenticationMock.faultCode = "AuthenticationService.Other";
  soapFactory.dsAuthenticationMock.message = "Other failure";
  adaptor.init(context);
}
 
开发者ID:googlegsa,项目名称:opentext,代码行数:18,代码来源:OpentextAdaptorTest.java

示例5: testGetDocIdsMarkPublicFalse

import com.google.enterprise.adaptor.Config; //导入方法依赖的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

示例6: testGetNodeStartPoint

import com.google.enterprise.adaptor.Config; //导入方法依赖的package包/类
@Test
public void testGetNodeStartPoint() throws InterruptedException {
  SoapFactoryMock soapFactory = new SoapFactoryMock();
  OpentextAdaptor adaptor = new OpentextAdaptor(soapFactory);
  AdaptorContext context = ProxyAdaptorContext.getInstance();
  Config config = initConfig(adaptor, context);
  config.overrideKey("opentext.src", "EnterpriseWS");
  adaptor.init(context);

  DocumentManagement documentManagement =
      soapFactory.newDocumentManagement("token");
  Node node = adaptor.getNode(documentManagement,
      new OpentextDocId(new DocId("EnterpriseWS:2000")));
  assertNotNull(node);
  assertEquals(2000, node.getID());
  assertEquals("Enterprise Workspace", node.getName());

  assertNull(adaptor.getNode(documentManagement,
          new OpentextDocId(new DocId("InvalidStartPoint:1111"))));
}
 
开发者ID:googlegsa,项目名称:opentext,代码行数:21,代码来源:OpentextAdaptorTest.java

示例7: testXmlSearchDocIdNameIdMismatch

import com.google.enterprise.adaptor.Config; //导入方法依赖的package包/类
@Test
public void testXmlSearchDocIdNameIdMismatch() throws Exception {
  String response =
      "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
      + "<SearchResult>"
      + "  <OTLocation>"
      + "  <![CDATA[2000 1234 5678 9012 3456 7890]]>"
      + " </OTLocation>"
      + "  <OTLocationPath> "
      + "    <LocationPathString>"
      + "    Enterprise:Folder 1"
      + "    </LocationPathString>"
      + "  </OTLocationPath> "
      + "</SearchResult>";

  SoapFactoryMock soapFactory = new SoapFactoryMock();
  OpentextAdaptor adaptor = new OpentextAdaptor(soapFactory);
  AdaptorContext context = ProxyAdaptorContext.getInstance();
  Config config = initConfig(adaptor, context);
  config.overrideKey("opentext.src", "1234");
  adaptor.init(context);

  String docId = adaptor.getXmlSearchDocId(parseXml(response));
  assertEquals(null, docId);
}
 
开发者ID:googlegsa,项目名称:opentext,代码行数:26,代码来源:OpentextAdaptorTest.java

示例8: initializeAdaptorConfig

import com.google.enterprise.adaptor.Config; //导入方法依赖的package包/类
/**
 * Copied in from TestHelper (from the library)
 */
public static void initializeAdaptorConfig(Adaptor adaptor,
    Map<String, String> configEntries) throws Exception {
  final Config config = new Config();
  adaptor.initConfig(config);
  for (Map.Entry<String, String> entry : configEntries.entrySet()) {
    config.overrideKey(entry.getKey(), entry.getValue());
  }
  adaptor.init(new UnsupportedAdaptorContext() {
      @Override
      public Config getConfig() {
        return config;
      }

      @Override
      public void setPollingIncrementalLister(PollingIncrementalLister l) {
      }

      @Override
      public SensitiveValueDecoder getSensitiveValueDecoder() {
        return new SensitiveValueDecoder() {
          @Override
          public String decodeValue(String notEncodedDuringTesting) {
            return notEncodedDuringTesting;
          }
        };
      }
    });
}
 
开发者ID:googlegsa,项目名称:activedirectory,代码行数:32,代码来源:AdAdaptorTest.java

示例9: testDoNodePropertiesCustomDateFormat

import com.google.enterprise.adaptor.Config; //导入方法依赖的package包/类
@Test
public void testDoNodePropertiesCustomDateFormat() {
  SoapFactoryMock soapFactory = new SoapFactoryMock();
  OpentextAdaptor adaptor = new OpentextAdaptor(soapFactory);
  AdaptorContext context = ProxyAdaptorContext.getInstance();
  Config config = initConfig(adaptor, context);
  config.overrideKey("opentext.metadataDateFormat", "MM dd, yyyy");
  adaptor.init(context);

  NodeMock node = new NodeMock(54678, "Node Name", "NodeType");
  node.setCreateDate(2012, 3, 1, 4, 34, 21);
  node.setModifyDate(2013, 3, 1, 4, 34, 21);

  RecordingResponse response = new RecordingResponse();
  adaptor.doNodeProperties(soapFactory.newDocumentManagement("token"),
      node, response);
  assertEquals(
      expectedMetadata(
          new ImmutableMap.Builder<String, String>()
          .put("ID", "54678")
          .put("Name", "Node Name")
          .put("CreateDate", "04 01, 2012")
          .put("ModifyDate", "04 01, 2013")
          .put("SubType", "NodeType")
          .put("VolumeID", "0")
          .build()),
      response.getMetadata());
}
 
开发者ID:googlegsa,项目名称:opentext,代码行数:29,代码来源:OpentextAdaptorTest.java

示例10: testDoDocumentContentServer

import com.google.enterprise.adaptor.Config; //导入方法依赖的package包/类
@Test
public void testDoDocumentContentServer() throws IOException {
  DocId docId = new DocId("2000/Document:3143");
  OpentextDocId testDocId = new OpentextDocId(docId);
  SoapFactoryMock soapFactory = new SoapFactoryMock();
  NodeMock documentNode =
      new NodeMock(3143, "Title of Document", "Document");
  documentNode.setVersion(1, "text/plain",
      new GregorianCalendar(2015, 1, 3, 9, 42, 42));
  soapFactory.documentManagementMock.addNode(documentNode);

  HttpServer server = startServer("this is the web-based content");
  try {
    OpentextAdaptor adaptor = new OpentextAdaptor(soapFactory);
    AdaptorContext context = ProxyAdaptorContext.getInstance();
    Config config = initConfig(adaptor, context);
    config.overrideKey("opentext.indexing.downloadMethod", "contentserver");
    config.overrideKey("opentext.indexing.contentServerUrl",
        "http://127.0.0.1:" + server.getAddress().getPort() + "/");

    adaptor.init(context);

    Request request = new RequestMock(docId);
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    RecordingResponse response = new RecordingResponse(baos);
    DocumentManagement documentManagement =
        soapFactory.newDocumentManagement("token");
    adaptor.doDocument(documentManagement, testDocId,
        documentNode, request, response);

    assertEquals("text/plain", response.getContentType());
    assertEquals("this is the web-based content",
        baos.toString(UTF_8.name()));
  } finally {
    server.stop(0);
  }
}
 
开发者ID:googlegsa,项目名称:opentext,代码行数:38,代码来源:OpentextAdaptorTest.java

示例11: testXmlSearchDocIdNestedStartPoint

import com.google.enterprise.adaptor.Config; //导入方法依赖的package包/类
@Test
public void testXmlSearchDocIdNestedStartPoint() throws Exception {
  String response =
      "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
      + "<SearchResult>"
      + " <OTLocation>"
      + "  <![CDATA[2000 1234 5678 9012]]>"
      + " </OTLocation>"
      + " <OTLocationPath> "
      + "   <LocationPathString>"
      + "    Enterprise:Folder 1:Folder 2"
      + "   </LocationPathString>"
      + " </OTLocationPath> "
      + " <OTName>"
      + "  Document"
      + "  <Value lang=\"en\">Document</Value>"
      + " </OTName>"
      + "</SearchResult>";

  SoapFactoryMock soapFactory = new SoapFactoryMock();
  OpentextAdaptor adaptor = new OpentextAdaptor(soapFactory);
  AdaptorContext context = ProxyAdaptorContext.getInstance();
  Config config = initConfig(adaptor, context);
  config.overrideKey("opentext.src", "1234");
  adaptor.init(context);

  String docId = adaptor.getXmlSearchDocId(parseXml(response));
  assertEquals("1234/Folder+2/Document:9012", docId);
}
 
开发者ID:googlegsa,项目名称:opentext,代码行数:30,代码来源:OpentextAdaptorTest.java

示例12: testShouldIndexInExcludeList

import com.google.enterprise.adaptor.Config; //导入方法依赖的package包/类
@Test
public void testShouldIndexInExcludeList() {
  SoapFactoryMock soapFactory = new SoapFactoryMock();
  OpentextAdaptor adaptor = new OpentextAdaptor(soapFactory);
  AdaptorContext context = ProxyAdaptorContext.getInstance();
  Config config = initConfig(adaptor, context);
  config.overrideKey("opentext.excludedCategories", "12345, 23456");
  adaptor.init(context);

  AttributeGroup attributeGroup = new AttributeGroup();
  attributeGroup.setType("Category");
  attributeGroup.setKey("12345.3");
  assertFalse(adaptor.shouldIndex(attributeGroup));
}
 
开发者ID:googlegsa,项目名称:opentext,代码行数:15,代码来源:OpentextAdaptorTest.java

示例13: testDoDocumentCws

import com.google.enterprise.adaptor.Config; //导入方法依赖的package包/类
@Test
public void testDoDocumentCws() throws IOException {
  DocId docId = new DocId("2000/Document:3143");
  OpentextDocId testDocId = new OpentextDocId(docId);
  SoapFactoryMock soapFactory = new SoapFactoryMock();
  NodeMock documentNode =
      new NodeMock(3143, "Title of Document", "Document");
  documentNode.setVersion(1, "text/plain",
      new GregorianCalendar(2015, 1, 3, 9, 42, 42));
  soapFactory.documentManagementMock.addNode(documentNode);

  OpentextAdaptor adaptor = new OpentextAdaptor(soapFactory);
  AdaptorContext context = ProxyAdaptorContext.getInstance();
  Config config = initConfig(adaptor, context);
  config.overrideKey("opentext.indexing.downloadMethod", "webservices");
  adaptor.init(context);

  Request request = new RequestMock(docId);
  ByteArrayOutputStream baos = new ByteArrayOutputStream();
  RecordingResponse response = new RecordingResponse(baos);
  DocumentManagement documentManagement =
      soapFactory.newDocumentManagement("token");
  adaptor.doDocument(documentManagement, testDocId,
      documentNode, request, response);

  assertEquals("text/plain", response.getContentType());
  assertEquals("this is the content", baos.toString(UTF_8.name()));
}
 
开发者ID:googlegsa,项目名称:opentext,代码行数:29,代码来源:OpentextAdaptorTest.java

示例14: testIncludeCategoryName

import com.google.enterprise.adaptor.Config; //导入方法依赖的package包/类
@Test
public void testIncludeCategoryName() {
  AttributeGroupDefinition categoryDefinition =
      new AttributeGroupDefinition();
  categoryDefinition.setID(82345);
  categoryDefinition.setKey("82345.3");

  AttributeGroup attributeGroup = new AttributeGroup();
  attributeGroup.setType("Category");
  attributeGroup.setKey("82345.3");
  attributeGroup.setDisplayName("Category Display Name");
  Metadata metadata = new Metadata();
  metadata.getAttributeGroups().add(attributeGroup);

  SoapFactoryMock soapFactory = new SoapFactoryMock();
  OpentextAdaptor adaptor = new OpentextAdaptor(soapFactory);
  AdaptorContext context = ProxyAdaptorContext.getInstance();
  Config config = initConfig(adaptor, context);
  config.overrideKey("opentext.indexCategoryNames", "true");
  adaptor.init(context);

  NodeMock documentNode =
      new NodeMock(3143, "Title of Document", "Document");
  documentNode.setMetadata(metadata);
  soapFactory.documentManagementMock.addNode(documentNode);
  soapFactory.documentManagementMock.addCategoryDefinition(
      categoryDefinition);

  RecordingResponse response = new RecordingResponse();
  adaptor.doCategories(soapFactory.newDocumentManagement("token"),
      documentNode, response);
  assertEquals(
      expectedMetadata(
          ImmutableMap.of("Category", "Category Display Name")),
      response.getMetadata());
}
 
开发者ID:googlegsa,项目名称:opentext,代码行数:37,代码来源:OpentextAdaptorTest.java

示例15: testValidateDocIds

import com.google.enterprise.adaptor.Config; //导入方法依赖的package包/类
@Test
public void testValidateDocIds() throws InterruptedException {
  SoapFactoryMock soapFactory = new SoapFactoryMock();
  OpentextAdaptor adaptor = new OpentextAdaptor(soapFactory);
  AdaptorContext context = ProxyAdaptorContext.getInstance();
  Config config = initConfig(adaptor, context);
  config.overrideKey("opentext.src", "1001, 1002, 1003");
  adaptor.init(context);

  RecordingDocIdPusher pusher = new RecordingDocIdPusher();
  adaptor.getDocIds(pusher);
  assertEquals(2, pusher.getDocIds().size());
  assertEquals("1001:1001", pusher.getDocIds().get(0).getUniqueId());
  assertEquals("1003:1003", pusher.getDocIds().get(1).getUniqueId());
}
 
开发者ID:googlegsa,项目名称:opentext,代码行数:16,代码来源:OpentextAdaptorTest.java


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