mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-14 17:58:59 +00:00
Merged DEV to HEAD (5.0)
86271 : ACE-2960 : getRepositories service no longer works for the atom pub binding - Do not change -default- to blank string 86300 : ACE-2960 : getRepositories service no longer works for the atom pub binding - Return reqQueryString if networkId not specified. Test extended with 1.0 and 1.1 versions and browser binding git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@86365 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -100,10 +100,15 @@ import org.apache.chemistry.opencmis.client.api.Property;
|
||||
import org.apache.chemistry.opencmis.client.api.Relationship;
|
||||
import org.apache.chemistry.opencmis.client.api.Repository;
|
||||
import org.apache.chemistry.opencmis.client.api.SecondaryType;
|
||||
import org.apache.chemistry.opencmis.client.api.Session;
|
||||
import org.apache.chemistry.opencmis.client.api.SessionFactory;
|
||||
import org.apache.chemistry.opencmis.client.api.Tree;
|
||||
import org.apache.chemistry.opencmis.client.runtime.OperationContextImpl;
|
||||
import org.apache.chemistry.opencmis.client.runtime.SessionFactoryImpl;
|
||||
import org.apache.chemistry.opencmis.commons.PropertyIds;
|
||||
import org.apache.chemistry.opencmis.commons.SessionParameter;
|
||||
import org.apache.chemistry.opencmis.commons.data.ContentStream;
|
||||
import org.apache.chemistry.opencmis.commons.data.RepositoryInfo;
|
||||
import org.apache.chemistry.opencmis.commons.enums.IncludeRelationships;
|
||||
import org.apache.chemistry.opencmis.commons.enums.VersioningState;
|
||||
import org.apache.chemistry.opencmis.commons.exceptions.CmisObjectNotFoundException;
|
||||
@@ -1920,4 +1925,40 @@ public class TestCMIS extends EnterpriseTestApi
|
||||
assertNotNull(("'" + PropertyIds.IS_PRIVATE_WORKING_COPY + "' property value must not be null!"), isPwcValueTrue);
|
||||
assertTrue(("'" + PropertyIds.IS_PRIVATE_WORKING_COPY + "' property value must be equal to 'true'!"), isPwcValueTrue);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCanConnectCMISUsingDefaultTenant() throws Exception
|
||||
{
|
||||
testCanConnectCMISUsingDefaultTenantImpl(Binding.atom, CMIS_VERSION_11);
|
||||
testCanConnectCMISUsingDefaultTenantImpl(Binding.atom, CMIS_VERSION_10);
|
||||
testCanConnectCMISUsingDefaultTenantImpl(Binding.browser, CMIS_VERSION_11);
|
||||
}
|
||||
|
||||
private void testCanConnectCMISUsingDefaultTenantImpl(Binding binding, String cmisVersion)
|
||||
{
|
||||
String url = httpClient.getPublicApiCmisUrl(TenantUtil.DEFAULT_TENANT, binding, cmisVersion, null);
|
||||
|
||||
Map<String, String> parameters = new HashMap<String, String>();
|
||||
|
||||
// user credentials
|
||||
parameters.put(SessionParameter.USER, "admin");
|
||||
parameters.put(SessionParameter.PASSWORD, "admin");
|
||||
|
||||
parameters.put(SessionParameter.ATOMPUB_URL, url);
|
||||
parameters.put(SessionParameter.BROWSER_URL, url);
|
||||
parameters.put(SessionParameter.BINDING_TYPE, binding.getOpenCmisBinding().value());
|
||||
|
||||
SessionFactory factory = SessionFactoryImpl.newInstance();
|
||||
// perform request : http://host:port/alfresco/api/-default-/public/cmis/versions/${cmisVersion}/${binding}
|
||||
List<Repository> repositories = factory.getRepositories(parameters);
|
||||
|
||||
assertTrue(repositories.size() > 0);
|
||||
|
||||
parameters.put(SessionParameter.REPOSITORY_ID, TenantUtil.DEFAULT_TENANT);
|
||||
Session session = factory.createSession(parameters);
|
||||
// perform request : http://host:port/alfresco/api/-default-/public/cmis/versions/${cmisVersion}/${binding}/type?id=cmis:document
|
||||
ObjectType objectType = session.getTypeDefinition("cmis:document");
|
||||
|
||||
assertNotNull(objectType);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user