Search in sources :

Example 1 with OpenCMISClientContext

use of org.alfresco.opencmis.OpenCMISClientContext in project alfresco-remote-api by Alfresco.

the class TestEnterpriseAtomPubTCK method setup.

@Before
public void setup() throws Exception {
    JettyComponent jetty = getTestFixture().getJettyComponent();
    final SearchService searchService = (SearchService) jetty.getApplicationContext().getBean("searchService");
    ;
    final NodeService nodeService = (NodeService) jetty.getApplicationContext().getBean("nodeService");
    final FileFolderService fileFolderService = (FileFolderService) jetty.getApplicationContext().getBean("fileFolderService");
    final NamespaceService namespaceService = (NamespaceService) jetty.getApplicationContext().getBean("namespaceService");
    final TransactionService transactionService = (TransactionService) jetty.getApplicationContext().getBean("transactionService");
    final String name = "abc" + System.currentTimeMillis();
    transactionService.getRetryingTransactionHelper().doInTransaction(new RetryingTransactionCallback<Void>() {

        @Override
        public Void execute() throws Throwable {
            AuthenticationUtil.setFullyAuthenticatedUser(AuthenticationUtil.getAdminUserName());
            Repository repositoryHelper = (Repository) jetty.getApplicationContext().getBean("repositoryHelper");
            NodeRef companyHome = repositoryHelper.getCompanyHome();
            fileFolderService.create(companyHome, name, ContentModel.TYPE_FOLDER).getNodeRef();
            return null;
        }
    }, false, true);
    int port = jetty.getPort();
    Map<String, String> cmisParameters = new HashMap<String, String>();
    cmisParameters.put(TestParameters.DEFAULT_RELATIONSHIP_TYPE, "R:cm:replaces");
    cmisParameters.put(TestParameters.DEFAULT_TEST_FOLDER_PARENT, "/" + name);
    clientContext = new OpenCMISClientContext(BindingType.ATOMPUB, MessageFormat.format(CMIS_URL, "localhost", String.valueOf(port), "alfresco"), "admin", "admin", cmisParameters, jetty.getApplicationContext());
    overrideVersionableAspectProperties(jetty.getApplicationContext());
}
Also used : TransactionService(org.alfresco.service.transaction.TransactionService) HashMap(java.util.HashMap) NodeService(org.alfresco.service.cmr.repository.NodeService) FileFolderService(org.alfresco.service.cmr.model.FileFolderService) NodeRef(org.alfresco.service.cmr.repository.NodeRef) Repository(org.alfresco.repo.model.Repository) NamespaceService(org.alfresco.service.namespace.NamespaceService) SearchService(org.alfresco.service.cmr.search.SearchService) JettyComponent(org.alfresco.repo.web.util.JettyComponent) OpenCMISClientContext(org.alfresco.opencmis.OpenCMISClientContext) Before(org.junit.Before)

Example 2 with OpenCMISClientContext

use of org.alfresco.opencmis.OpenCMISClientContext in project alfresco-remote-api by Alfresco.

the class TestPublicApiAtomPub10TCK method before.

@Before
public void before() throws Exception {
    // see REPO-1524
    // the tests are always run on PostgreSQL only
    // Dialect dialect = (Dialect) applicationContext.getBean("dialect");
    // assumeFalse(dialect instanceof Oracle9Dialect);
    int port = getTestFixture().getJettyComponent().getPort();
    TestNetwork network = getTestFixture().getRandomNetwork();
    Map<String, String> cmisParameters = new HashMap<String, String>();
    cmisParameters.put(TestParameters.DEFAULT_RELATIONSHIP_TYPE, "R:cm:replaces");
    clientContext = new OpenCMISClientContext(BindingType.ATOMPUB, MessageFormat.format(CMIS_URL, "localhost", String.valueOf(port), "alfresco", network.getId(), "public"), "admin@" + network.getId(), "admin", cmisParameters, getTestFixture().getJettyComponent().getApplicationContext());
    overrideVersionableAspectProperties(getTestFixture().getJettyComponent().getApplicationContext());
}
Also used : HashMap(java.util.HashMap) TestNetwork(org.alfresco.rest.api.tests.RepoService.TestNetwork) OpenCMISClientContext(org.alfresco.opencmis.OpenCMISClientContext) Before(org.junit.Before)

Example 3 with OpenCMISClientContext

use of org.alfresco.opencmis.OpenCMISClientContext in project alfresco-remote-api by Alfresco.

the class TestPublicApiAtomPub11TCK method before.

@Before
public void before() throws Exception {
    // see REPO-1524
    // the tests are always run on PostgreSQL only
    // Dialect dialect = (Dialect) applicationContext.getBean("dialect");
    // assumeFalse(dialect instanceof Oracle9Dialect);
    int port = getTestFixture().getJettyComponent().getPort();
    TestNetwork network = getTestFixture().getRandomNetwork();
    Map<String, String> cmisParameters = new HashMap<String, String>();
    cmisParameters.put(TestParameters.DEFAULT_RELATIONSHIP_TYPE, "R:cm:replaces");
    cmisParameters.put(TestParameters.DEFAULT_SECONDARY_TYPE, "P:cm:author");
    cmisParameters.put(TestParameters.DEFAULT_ITEM_TYPE, "I:cm:cmobject");
    clientContext = new OpenCMISClientContext(BindingType.ATOMPUB, MessageFormat.format(CMIS_URL, "localhost", String.valueOf(port), "alfresco", network.getId(), "public"), "admin@" + network.getId(), "admin", cmisParameters, getTestFixture().getJettyComponent().getApplicationContext());
    overrideVersionableAspectProperties(getTestFixture().getJettyComponent().getApplicationContext());
}
Also used : HashMap(java.util.HashMap) TestNetwork(org.alfresco.rest.api.tests.RepoService.TestNetwork) OpenCMISClientContext(org.alfresco.opencmis.OpenCMISClientContext) Before(org.junit.Before)

Example 4 with OpenCMISClientContext

use of org.alfresco.opencmis.OpenCMISClientContext in project alfresco-remote-api by Alfresco.

the class TestPublicApiBrowser11TCK method before.

@Before
public void before() throws Exception {
    // see REPO-1524
    // the tests are always run on PostgreSQL only
    // Dialect dialect = (Dialect) applicationContext.getBean("dialect");
    // assumeFalse(dialect instanceof Oracle9Dialect);
    int port = getTestFixture().getJettyComponent().getPort();
    TestNetwork network = getTestFixture().getRandomNetwork();
    Map<String, String> cmisParameters = new HashMap<String, String>();
    cmisParameters.put(TestParameters.DEFAULT_RELATIONSHIP_TYPE, "R:cm:replaces");
    cmisParameters.put(TestParameters.DEFAULT_SECONDARY_TYPE, "P:cm:author");
    cmisParameters.put(TestParameters.DEFAULT_ITEM_TYPE, "I:cm:cmobject");
    clientContext = new OpenCMISClientContext(BindingType.BROWSER, MessageFormat.format(CMIS_URL, "localhost", String.valueOf(port), "alfresco", network.getId(), "public"), "admin@" + network.getId(), "admin", cmisParameters, getTestFixture().getJettyComponent().getApplicationContext());
    overrideVersionableAspectProperties(getTestFixture().getJettyComponent().getApplicationContext());
}
Also used : HashMap(java.util.HashMap) TestNetwork(org.alfresco.rest.api.tests.RepoService.TestNetwork) OpenCMISClientContext(org.alfresco.opencmis.OpenCMISClientContext) Before(org.junit.Before)

Aggregations

HashMap (java.util.HashMap)4 OpenCMISClientContext (org.alfresco.opencmis.OpenCMISClientContext)4 Before (org.junit.Before)4 TestNetwork (org.alfresco.rest.api.tests.RepoService.TestNetwork)3 Repository (org.alfresco.repo.model.Repository)1 JettyComponent (org.alfresco.repo.web.util.JettyComponent)1 FileFolderService (org.alfresco.service.cmr.model.FileFolderService)1 NodeRef (org.alfresco.service.cmr.repository.NodeRef)1 NodeService (org.alfresco.service.cmr.repository.NodeService)1 SearchService (org.alfresco.service.cmr.search.SearchService)1 NamespaceService (org.alfresco.service.namespace.NamespaceService)1 TransactionService (org.alfresco.service.transaction.TransactionService)1