use of org.alfresco.repo.web.util.JettyComponent 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());
}
Aggregations