diff --git a/source/test-java/org/alfresco/opencmis/CMISTest.java b/source/test-java/org/alfresco/opencmis/CMISTest.java index 36b0ba57cc..1d1d1a3a5d 100644 --- a/source/test-java/org/alfresco/opencmis/CMISTest.java +++ b/source/test-java/org/alfresco/opencmis/CMISTest.java @@ -3589,126 +3589,4 @@ public class CMISTest AuthenticationUtil.popAuthentication(); } } - - @Test - public void testMNT16375() throws Exception - { - setupAudit(); - - AuthenticationUtil.pushAuthentication(); - AuthenticationUtil.setFullyAuthenticatedUser(AuthenticationUtil.getAdminUserName()); - - withCmisService(new CmisServiceCallback() - { - @Override - public Void execute(CmisService cmisService) - { - long start = System.currentTimeMillis(); - - List repositories = cmisService.getRepositoryInfos(null); - - long end = System.currentTimeMillis(); - - logger.info("time = " + (end - start) + "ms"); - - assertNotNull(repositories); - assertTrue(repositories.size() > 0); - - return null; - } - }, CmisVersion.CMIS_1_1); - } - - //@Test - public void populate() throws Exception - { - setupAudit(); - - final NodeRef companyHomeNodeRef = repositoryHelper.getCompanyHome(); - final int batchSize = 100; - final int totalWork = 500000; - - BatchProcessor.BatchProcessWorker worker = new BatchProcessor.BatchProcessWorker() - { - public String getIdentifier(String folder) - { - return folder; - } - - public void beforeProcess() throws Throwable - { - AuthenticationUtil.pushAuthentication(); - AuthenticationUtil.setFullyAuthenticatedUser(AuthenticationUtil.getAdminUserName()); - } - - public void afterProcess() throws Throwable - { - AuthenticationUtil.popAuthentication(); - } - - public void process(final String guid) throws Throwable - { - Map auditData = new HashMap<>(); - HashMap data = new HashMap<>(); - data.put("nodeRef", "workspace://SpacesStore/" + guid); - data.put("objectId", guid); - auditData.put("/CMISChangeLog/CREATED/result/value", data); - auditDAO.createAuditEntry(2l, System.currentTimeMillis(), "admin", auditData); - - // perform CREATED, UPDATED, SECURITY, DELETED CMIS change type actions -// FileInfo folderInfo = fileFolderService.create(companyHomeNodeRef, folder, ContentModel.TYPE_FOLDER); -// nodeService.setProperty(folderInfo.getNodeRef(), ContentModel.PROP_NAME, folder); -// assertNotNull(folderInfo); -// -// String content = GUID.generate(); -// FileInfo document = fileFolderService.create(folderInfo.getNodeRef(), content, ContentModel.TYPE_CONTENT); -// assertNotNull(document); -// nodeService.setProperty(document.getNodeRef(), ContentModel.PROP_NAME, content); -// -// permissionService.setPermission(document.getNodeRef(), "SomeAuthority", PermissionService.EXECUTE_CONTENT, true); -// -// fileFolderService.delete(document.getNodeRef()); -// fileFolderService.delete(folderInfo.getNodeRef()); - } - }; - - BatchProcessWorkProvider provider = new BatchProcessWorkProvider() - { - private int counter = 0; - - @Override - public int getTotalEstimatedWorkSize() - { - return totalWork; - } - - @Override - public Collection getNextWork() - { - if(counter < totalWork) - { - counter += batchSize; - List guids = new ArrayList<>(batchSize); - for(int i = 0; i < batchSize; i++) - { - guids.add(GUID.generate()); - } - - return guids; - } - else - { - return Collections.emptyList(); - } - } - }; - - new BatchProcessor( - "CMISTest.createAuditEntries", - transactionService.getRetryingTransactionHelper(), - provider, - 4, batchSize, - ctx, - logger, 100).process(worker, true); - } }