本文整理汇总了Java中com.google.enterprise.adaptor.Config类的典型用法代码示例。如果您正苦于以下问题:Java Config类的具体用法?Java Config怎么用?Java Config使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Config类属于com.google.enterprise.adaptor包,在下文中一共展示了Config类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: testGetXmlSearchIdsNonNumericIds
import com.google.enterprise.adaptor.Config; //导入依赖的package包/类
@Test
public void testGetXmlSearchIdsNonNumericIds() throws Exception {
String response =
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
+ "<SearchResult>"
+ " <OTLocation>"
+ " <![CDATA[2000 foo 1000]]>"
+ " </OTLocation>"
+ "</SearchResult>";
SoapFactoryMock soapFactory = new SoapFactoryMock();
OpentextAdaptor adaptor = new OpentextAdaptor(soapFactory);
AdaptorContext context = ProxyAdaptorContext.getInstance();
Config config = initConfig(adaptor, context);
adaptor.init(context);
List<String> ids = adaptor.getXmlSearchIds(parseXml(response));
assertEquals(Lists.newArrayList(), ids);
assertNull(response, adaptor.getXmlSearchDocId(parseXml(response)));
}
开发者ID:googlegsa,项目名称:opentext,代码行数:21,代码来源:OpentextAdaptorTest.java
示例2: testSoapFactoryImplGetWebServiceAddress
import com.google.enterprise.adaptor.Config; //导入依赖的package包/类
/**
* Check that trailing slashes or the lack thereof are handled
* on the webServicesUrl property.
*/
@Test
public void testSoapFactoryImplGetWebServiceAddress() {
Config config = new Config();
config.addKey("opentext.directoryServicesUrl", "");
config.addKey("opentext.webServicesUrl", "webServicesUrl");
config.addKey("opentext.webServicesServer", "Tomcat");
SoapFactoryImpl factory = new SoapFactoryImpl();
factory.configure(config);
assertEquals("webServicesUrl/Authentication",
factory.getWebServiceAddress("Authentication"));
config.overrideKey("opentext.webServicesUrl", "webServicesUrl/");
factory.configure(config);
assertEquals("webServicesUrl/Authentication",
factory.getWebServiceAddress("Authentication"));
}
开发者ID:googlegsa,项目名称:opentext,代码行数:21,代码来源: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: testGetDocIdsMarkPublicTrue
import com.google.enterprise.adaptor.Config; //导入依赖的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
示例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: testXmlSearchDocIdEnterpriseWs
import com.google.enterprise.adaptor.Config; //导入依赖的package包/类
@Test
public void testXmlSearchDocIdEnterpriseWs() throws Exception {
String response =
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
+ "<SearchResult>"
+ " <OTLocation>"
+ " <![CDATA[2000]]>"
+ " </OTLocation>"
+ " <OTLocationPath> "
+ " <LocationPathString>"
+ " Enterprise"
+ " </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", "EnterpriseWS");
adaptor.init(context);
String docId = adaptor.getXmlSearchDocId(parseXml(response));
assertEquals("EnterpriseWS:2000", docId);
}
开发者ID:googlegsa,项目名称:opentext,代码行数:26,代码来源:OpentextAdaptorTest.java
示例8: testGetDocContentMarkPublicTrue
import com.google.enterprise.adaptor.Config; //导入依赖的package包/类
@Test
public void testGetDocContentMarkPublicTrue() throws IOException {
Member owner = getMember(1001, "testuser1", "User");
NodeRights nodeRights = new NodeRights();
nodeRights.setOwnerRight(getNodeRight(owner.getID(), "Owner"));
SoapFactoryMock soapFactory = new SoapFactoryMock();
NodeMock node = new NodeMock(3143, "Folder Name", "Folder");
node.setStartPointId(2000);
node.setPath(node.getName());
soapFactory.documentManagementMock.addNode(node);
soapFactory.documentManagementMock
.setNodeRights(node.getID(), nodeRights);
soapFactory.memberServiceMock.addMember(owner);
OpentextAdaptor adaptor = new OpentextAdaptor(soapFactory);
AdaptorContext context = ProxyAdaptorContext.getInstance();
Config config = initConfig(adaptor, context);
config.overrideKey("adaptor.markAllDocsAsPublic", "true");
adaptor.init(context);
RecordingResponse response = new RecordingResponse();
Request request = new RequestMock("EnterpriseWS/Folder+Name:3143");
adaptor.getDocContent(request, response);
assertEquals(null, response.getAcl());
}
开发者ID:googlegsa,项目名称:opentext,代码行数:26,代码来源:OpentextAdaptorTest.java
示例9: testGetDisplayUrl
import com.google.enterprise.adaptor.Config; //导入依赖的package包/类
@Test
public void testGetDisplayUrl() throws Exception {
SoapFactoryMock soapFactory = new SoapFactoryMock();
OpentextAdaptor adaptor = new OpentextAdaptor(soapFactory);
AdaptorContext context = ProxyAdaptorContext.getInstance();
Config config = initConfig(adaptor, context);
config.addKey("opentext.displayUrl.objAction.111", "actionFor111");
adaptor.init(context);
URI displayUrl = adaptor.getDisplayUrl("Document", 12345);
assertEquals("http://localhost/otcs/livelink.exe"
+ "?func=ll&objAction=overview&objId=12345", displayUrl.toString());
displayUrl = adaptor.getDisplayUrl("UnknownType", 12345);
assertEquals("http://localhost/otcs/livelink.exe"
+ "?func=ll&objAction=properties&objId=12345", displayUrl.toString());
displayUrl = adaptor.getDisplayUrl("GenericNode:111", 12345);
assertEquals("http://localhost/otcs/livelink.exe"
+ "?func=ll&objAction=actionFor111&objId=12345", displayUrl.toString());
}
开发者ID:googlegsa,项目名称:opentext,代码行数:22,代码来源:OpentextAdaptorTest.java
示例10: testGetDisplayUrlPathInfo
import com.google.enterprise.adaptor.Config; //导入依赖的package包/类
@Test
public void testGetDisplayUrlPathInfo() throws Exception {
SoapFactoryMock soapFactory = new SoapFactoryMock();
OpentextAdaptor adaptor = new OpentextAdaptor(soapFactory);
AdaptorContext context = ProxyAdaptorContext.getInstance();
Config config = initConfig(adaptor, context);
config.addKey(
"opentext.displayUrl.queryString.Document", "/open/{1}");
config.addKey(
"opentext.displayUrl.queryString.111", "/open111/{1}");
adaptor.init(context);
URI displayUrl = adaptor.getDisplayUrl("Document", 12345);
assertEquals("http://localhost/otcs/livelink.exe/open/12345",
displayUrl.toString());
displayUrl = adaptor.getDisplayUrl("GenericNode:111", 12345);
assertEquals("http://localhost/otcs/livelink.exe/open111/12345",
displayUrl.toString());
}
开发者ID:googlegsa,项目名称:opentext,代码行数:20,代码来源:OpentextAdaptorTest.java
示例11: testDoDocumentNoVersions
import com.google.enterprise.adaptor.Config; //导入依赖的package包/类
@Test
public void testDoDocumentNoVersions() throws IOException {
DocId docId = new DocId("2000/Document Name:3143");
OpentextDocId testDocId = new OpentextDocId(docId);
thrown.expect(RuntimeException.class);
thrown.expectMessage(
"Document does not support versions: " + testDocId);
SoapFactoryMock soapFactory = new SoapFactoryMock();
NodeMock documentNode = new NodeMock(3143, "Document Name");
documentNode.setIsVersionable(false);
soapFactory.documentManagementMock.addNode(documentNode);
OpentextAdaptor adaptor = new OpentextAdaptor(soapFactory);
AdaptorContext context = ProxyAdaptorContext.getInstance();
Config config = initConfig(adaptor, context);
adaptor.init(context);
Request request = new RequestMock(docId);
RecordingResponse response = new RecordingResponse();
DocumentManagement documentManagement =
soapFactory.newDocumentManagement("token");
adaptor.doDocument(documentManagement, testDocId,
documentNode, request, response);
}
开发者ID:googlegsa,项目名称:opentext,代码行数:27,代码来源:OpentextAdaptorTest.java
示例12: initializeAdaptor
import com.google.enterprise.adaptor.Config; //导入依赖的package包/类
private void initializeAdaptor(DocumentumAdaptor adaptor, String src,
String separator) throws DfException {
AdaptorContext context = ProxyAdaptorContext.getInstance();
Config config = context.getConfig();
adaptor.initConfig(config);
config.overrideKey("documentum.username", "testuser");
config.overrideKey("documentum.password", "testpwd");
config.overrideKey("documentum.docbaseName", "testdocbase");
config.overrideKey("documentum.displayUrlPattern",
"http://webtopurl/drl/{0}");
config.overrideKey("documentum.src", src);
if (separator != null) {
config.overrideKey("documentum.src.separator", separator);
}
config.overrideKey("documentum.documentTypes", "dm_document");
adaptor.init(context);
}
开发者ID:googlegsa,项目名称:documentum,代码行数:21,代码来源:DocumentumAdaptorTest.java
示例13: testDocWithExcludedNodeType
import com.google.enterprise.adaptor.Config; //导入依赖的package包/类
@Test
public void testDocWithExcludedNodeType() throws IOException {
SoapFactoryMock soapFactory = new SoapFactoryMock();
NodeMock documentNode =
new NodeMock(3143, "Title of Document", "Alias");
documentNode.setStartPointId(2000);
documentNode.setPath(documentNode.getName());
soapFactory.documentManagementMock.addNode(documentNode);
OpentextAdaptor adaptor = new OpentextAdaptor(soapFactory);
AdaptorContext context = ProxyAdaptorContext.getInstance();
Config config = initConfig(adaptor, context);
config.overrideKey("opentext.excludedNodeTypes", "Alias");
adaptor.init(context);
RecordingResponse response = new RecordingResponse();
Request request = new RequestMock("EnterpriseWS/Title+of+Document:3143");
adaptor.getDocContent(request, response);
assertEquals(RecordingResponse.State.NOT_FOUND, response.getState());
}
开发者ID:googlegsa,项目名称:opentext,代码行数:22,代码来源:OpentextAdaptorTest.java
示例14: testGetDocIdsRootStartPathDefaultWhereClause
import com.google.enterprise.adaptor.Config; //导入依赖的package包/类
/** @see #testGetRootContentDefaultWhereClause() */
@Test
public void testGetDocIdsRootStartPathDefaultWhereClause() throws Exception {
executeUpdate(
"CREATE TABLE dm_docbase_config (owner_name varchar)",
"INSERT INTO dm_docbase_config (owner_name) VALUES('Owner')",
"CREATE TABLE dm_server_config (r_install_owner varchar)",
"INSERT INTO dm_server_config (r_install_owner) VALUES('Installer')");
insertCabinets("Integration", "Resources", "System", "Temp");
insertCabinets("Templates", "Owner", "Installer", "dm_bof_registry");
insertCabinets("Cab1", "Cab2", "Cab3");
Config config = ProxyAdaptorContext.getInstance().getConfig();
new DocumentumAdaptor(null).initConfig(config);
testGetDocIds(
ImmutableMap.of(
"documentum.src", "/",
"documentum.cabinetWhereCondition",
config.getValue("documentum.cabinetWhereCondition")),
expectedRecordsFor(CABINET, "/Cab1", "/Cab2", "/Cab3"));
}
开发者ID:googlegsa,项目名称:documentum,代码行数:23,代码来源:DocumentumAdaptorTest.java
示例15: testDoNodeFeatures
import com.google.enterprise.adaptor.Config; //导入依赖的package包/类
@Test
public void testDoNodeFeatures() {
SoapFactoryMock soapFactory = new SoapFactoryMock();
OpentextAdaptor adaptor = new OpentextAdaptor(soapFactory);
AdaptorContext context = ProxyAdaptorContext.getInstance();
Config config = initConfig(adaptor, context);
config.addKey("opentext.includedNodeFeatures.NodeType",
"Feature1,Feature2");
adaptor.init(context);
NodeMock node = new NodeMock(3143, "Node Name", "NodeType");
NodeFeature feature = new NodeFeature();
feature.setName("Feature1");
feature.setBooleanValue(true);
feature.setType("Boolean");
node.getFeatures().add(feature);
RecordingResponse response = new RecordingResponse();
adaptor.doNodeFeatures(node, response);
assertEquals(
expectedMetadata(
ImmutableMap.of("Feature1", "true")),
response.getMetadata());
}
开发者ID:googlegsa,项目名称:opentext,代码行数:25,代码来源:OpentextAdaptorTest.java
示例16: testDoNodeFeaturesWithDate
import com.google.enterprise.adaptor.Config; //导入依赖的package包/类
@Test
public void testDoNodeFeaturesWithDate() {
SoapFactoryMock soapFactory = new SoapFactoryMock();
OpentextAdaptor adaptor = new OpentextAdaptor(soapFactory);
AdaptorContext context = ProxyAdaptorContext.getInstance();
Config config = initConfig(adaptor, context);
config.addKey("opentext.includedNodeFeatures.NodeType",
"Feature1,Feature2");
adaptor.init(context);
NodeMock node = new NodeMock(3143, "Node Name", "NodeType");
NodeFeature feature = new NodeFeature();
feature.setName("Feature1");
feature.setDateValue(getXmlGregorianCalendar(2011, 01, 01, 01, 01, 01));
feature.setType("Date");
node.getFeatures().add(feature);
RecordingResponse response = new RecordingResponse();
adaptor.doNodeFeatures(node, response);
assertEquals(
expectedMetadata(
ImmutableMap.of("Feature1", "2011-02-01")),
response.getMetadata());
}
开发者ID:googlegsa,项目名称:opentext,代码行数:25,代码来源:OpentextAdaptorTest.java
示例17: testDoNode
import com.google.enterprise.adaptor.Config; //导入依赖的package包/类
@Test
public void testDoNode() throws IOException {
NodeMock node = new NodeMock(432, "Test Node");
SoapFactoryMock soapFactory = new SoapFactoryMock();
OpentextAdaptor adaptor = new OpentextAdaptor(soapFactory);
AdaptorContext context = ProxyAdaptorContext.getInstance();
Config config = initConfig(adaptor, context);
adaptor.init(context);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
RecordingResponse response = new RecordingResponse(baos);
adaptor.doNode(soapFactory.newDocumentManagement("token"),
new OpentextDocId(new DocId("432:432")),
node, response);
String expected = "<!DOCTYPE html>\n"
+ "<html><head><title>Test Node</title></head>"
+ "<body><h1>Test Node</h1>"
+ "</body></html>";
assertEquals(expected, baos.toString(UTF_8.name()));
}
开发者ID:googlegsa,项目名称:opentext,代码行数:20,代码来源:OpentextAdaptorTest.java
示例18: 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
示例19: testAclOwnerRight
import com.google.enterprise.adaptor.Config; //导入依赖的package包/类
@Test
public void testAclOwnerRight() throws IOException {
Member owner = getMember(1001, "testuser1", "User");
NodeRights nodeRights = new NodeRights();
nodeRights.setOwnerRight(getNodeRight(owner.getID(), "Owner"));
NodeMock documentNode = new NodeMock(3000, "DocumentName", "Document");
SoapFactoryMock soapFactory = new SoapFactoryMock();
soapFactory.documentManagementMock
.setNodeRights(documentNode.getID(), nodeRights);
soapFactory.memberServiceMock.addMember(owner);
OpentextAdaptor adaptor = new OpentextAdaptor(soapFactory);
AdaptorContext context = ProxyAdaptorContext.getInstance();
Config config = initConfig(adaptor, context);
adaptor.init(context);
RecordingResponse response = new RecordingResponse();
adaptor.doAcl(soapFactory.newDocumentManagement("token"),
new OpentextDocId(new DocId("2000/DocumentName:3000")),
documentNode, response);
assertEquals(
Sets.newHashSet(newUserPrincipal(owner.getName())),
response.getAcl().getPermits());
}
开发者ID:googlegsa,项目名称:opentext,代码行数:23,代码来源:OpentextAdaptorTest.java
示例20: testAclOwnerGroupRight
import com.google.enterprise.adaptor.Config; //导入依赖的package包/类
@Test
public void testAclOwnerGroupRight() throws IOException {
Member ownerGroup = getMember(1002, "DefaultGroup", "Group");
NodeRights nodeRights = new NodeRights();
nodeRights.setOwnerGroupRight(
getNodeRight(ownerGroup.getID(), "OwnerGroup"));
NodeMock documentNode = new NodeMock(3000, "DocumentName", "Document");
SoapFactoryMock soapFactory = new SoapFactoryMock();
soapFactory.documentManagementMock
.setNodeRights(documentNode.getID(), nodeRights);
soapFactory.memberServiceMock.addMember(ownerGroup);
OpentextAdaptor adaptor = new OpentextAdaptor(soapFactory);
AdaptorContext context = ProxyAdaptorContext.getInstance();
Config config = initConfig(adaptor, context);
adaptor.init(context);
RecordingResponse response = new RecordingResponse();
adaptor.doAcl(soapFactory.newDocumentManagement("token"),
new OpentextDocId(new DocId("2000/DocumentName:3000")),
documentNode, response);
assertEquals(
Sets.newHashSet(newGroupPrincipal(ownerGroup.getName())),
response.getAcl().getPermits());
}
开发者ID:googlegsa,项目名称:opentext,代码行数:24,代码来源:OpentextAdaptorTest.java
注:本文中的com.google.enterprise.adaptor.Config类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论