mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged V3.1 to HEAD
- incl. taking Hibernate libs from 3.1 and adding missing file from earlier merge 13321: Fix ETHREEOH-1407: System error occur during "Undo Selected" action if no items are selected 13322: ETHREEOH-1206: Throwing Alfresco Exception on OnUpdateProperties behaviour resets Encoding field to Big (first entry) 13326: (RECORD ONLY) Removed 'dev' from version label. 13330: Fix ETHREEOH-1408: Incorrect button name at "Manage Task: Submitted" page 13337: Fix for ETHREEOH-1409 and further fix for ETHREEOH-1408 13338: Removed svn:mergeinfo 13346: Make startup bat script check JAVA can be found. 13351: ETHREEOH-1386 validate ASR and FSR hostname. 13359: ETHREEOH-1435: Share doesn't extract document metadata correctly 13360: Fix ETHREEOH-821: SDK dependencies 13369: Fixed distribute-sdk target for when it's run locally 13382: ETHREEOH-1437: Container creation induces an unexpected permission allocation in Share 13391: Shutdown backstop continues if logging throws errors. 13394: Fix ETHREEOH-1457 - MT coci issue with bootstrap (eg. data dictionary) content 13400: Activate JAWS-223: Adobe LC Hibernate Dialect Loading 13401: Support for JAWS-215, mysql and oracle 13413: Fix ETHREEOH-1458 - MT delete->archive ___________________________________________________________________ Modified: svn:mergeinfo Merged /alfresco/BRANCHES/V3.1:r 13321-13322,13326-13327,13330,13337-13339,13341-13347,13351,13354-13355,13358-13363, 13365,13367,13369,13382,13385-13392,13394,13400-13403,13405-13406,13413 git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@13617 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -42,6 +42,7 @@ import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.repo.content.MimetypeMap;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork;
|
||||
import org.alfresco.service.cmr.coci.CheckOutCheckInService;
|
||||
import org.alfresco.service.cmr.repository.ChildAssociationRef;
|
||||
import org.alfresco.service.cmr.repository.ContentService;
|
||||
import org.alfresco.service.cmr.repository.ContentWriter;
|
||||
@@ -85,6 +86,7 @@ public class MultiTDemoTest extends TestCase
|
||||
private TenantService tenantService;
|
||||
private AuthorityService authorityService;
|
||||
private CategoryService categoryService;
|
||||
private CheckOutCheckInService cociService;
|
||||
|
||||
public static int NUM_TENANTS = 11;
|
||||
|
||||
@@ -140,6 +142,7 @@ public class MultiTDemoTest extends TestCase
|
||||
ownableService = (OwnableService) ctx.getBean("OwnableService");
|
||||
authorityService = (AuthorityService) ctx.getBean("AuthorityService");
|
||||
categoryService = (CategoryService) ctx.getBean("CategoryService");
|
||||
cociService = (CheckOutCheckInService) ctx.getBean("CheckoutCheckinService");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -572,6 +575,85 @@ public class MultiTDemoTest extends TestCase
|
||||
}
|
||||
}
|
||||
|
||||
public void testCOCIandSearch()
|
||||
{
|
||||
logger.info("Test checkout/checkin and search");
|
||||
|
||||
for (final String tenantDomain : tenants)
|
||||
{
|
||||
final String tenantAdminName = tenantService.getDomainUser(AuthenticationUtil.getAdminUserName(), tenantDomain);
|
||||
|
||||
AuthenticationUtil.runAs(new RunAsWork<Object>()
|
||||
{
|
||||
public Object doWork() throws Exception
|
||||
{
|
||||
// search for local copy of bootstrapped file 'invite_user_email.ftl' (see email_templates.acp)
|
||||
String origText = "You have been invited to";
|
||||
String query = "+PATH:\"/app:company_home/app:dictionary/app:email_templates/*\" +TEXT:\""+origText+"\"";
|
||||
ResultSet resultSet = searchService.query(SPACES_STORE, SearchService.LANGUAGE_LUCENE, query);
|
||||
assertEquals(1, resultSet.length());
|
||||
|
||||
NodeRef nodeRef = resultSet.getNodeRef(0);
|
||||
|
||||
// checkout, update and checkin
|
||||
|
||||
NodeRef workingCopyNodeRef = cociService.checkout(nodeRef);
|
||||
|
||||
ContentWriter writer = contentService.getWriter(workingCopyNodeRef, ContentModel.PROP_CONTENT, true);
|
||||
|
||||
writer.setMimetype(MimetypeMap.MIMETYPE_TEXT_PLAIN);
|
||||
writer.setEncoding("UTF-8");
|
||||
|
||||
String updateText = "Updated by "+tenantAdminName;
|
||||
writer.putContent(updateText);
|
||||
|
||||
cociService.checkin(workingCopyNodeRef, null);
|
||||
|
||||
query = "+PATH:\"/app:company_home/app:dictionary/app:email_templates/*\" +TEXT:\""+origText+"\"";
|
||||
resultSet = searchService.query(SPACES_STORE, SearchService.LANGUAGE_LUCENE, query);
|
||||
assertEquals(0, resultSet.length());
|
||||
|
||||
query = "+PATH:\"/app:company_home/app:dictionary/app:email_templates/*\" +TEXT:\""+updateText+"\"";
|
||||
resultSet = searchService.query(SPACES_STORE, SearchService.LANGUAGE_LUCENE, query);
|
||||
assertEquals(1, resultSet.length());
|
||||
|
||||
return null;
|
||||
}
|
||||
}, tenantAdminName);
|
||||
}
|
||||
}
|
||||
|
||||
public void testDeleteArchiveAndRestoreContent()
|
||||
{
|
||||
logger.info("test delete/archive & restore content");
|
||||
|
||||
for (final String tenantDomain : tenants)
|
||||
{
|
||||
final String tenantUserName = tenantService.getDomainUser(TEST_USER1, tenantDomain);
|
||||
|
||||
AuthenticationUtil.runAs(new RunAsWork<Object>()
|
||||
{
|
||||
public Object doWork() throws Exception
|
||||
{
|
||||
NodeRef homeSpaceRef = getHomeSpaceFolderNode(tenantUserName);
|
||||
NodeRef contentRef = addTextContent(homeSpaceRef, tenantUserName+" tqbfjotld.txt", "The quick brown fox jumps over the lazy dog (tenant " + tenantDomain + ")");
|
||||
|
||||
NodeRef storeArchiveNode = nodeService.getStoreArchiveNode(contentRef.getStoreRef());
|
||||
|
||||
nodeService.deleteNode(contentRef);
|
||||
|
||||
// deduce archived nodeRef
|
||||
StoreRef archiveStoreRef = storeArchiveNode.getStoreRef();
|
||||
NodeRef archivedContentRef = new NodeRef(archiveStoreRef, contentRef.getId());
|
||||
|
||||
nodeService.restoreNode(archivedContentRef, null, null, null);
|
||||
|
||||
return null;
|
||||
}
|
||||
}, tenantUserName);
|
||||
}
|
||||
}
|
||||
|
||||
private void createGroup(String shortName, String parentShortName)
|
||||
{
|
||||
// create new Group using authority Service
|
||||
|
Reference in New Issue
Block a user