Merged V4.1-BUG-FIX to HEAD

42774: ALF-16367: MT fix for "Exporting a tenant from one instance A and importing it to another Alfresco instance B does not work"
   42775: Merged DEV to V4.1-BUG-FIX
      42274: First part of ALF-14341: WQS: SOLR Request failed wit error 500: DTENANT_FILTER_FROM_JSON
             WQS jobs don't execute if repository is in the bootstrapping state.
             RepositoryState class was made thread safe. 
   42781: ALF-15135: Apple Mail always fails when copying folders with nested folders
   - Because FileFolderService.resolveNamePath was not properly honouring mustExist==false for parent folders
   42798: ALF-16384 - checkLicenseForSyncMode exposed via properties files
      code comments changed.
   42799: ALF-16384 - checkLicenseForSyncMode exposed via properties files    properties comments changed.
   42801: Merged BRANCHES/DEV/BELARUS/V4.1-BUG-FIX-2012_10_17 to BRANCHES/DEV/V4.1-BUG-FIX:
      42748: ALF-14200: Adding Invalid Aspects Via CMIS ATOM API Results in NullPointerException
   42802: Fix failing NodeServiceTest
   - Moved parentless node validation to correct location to avoid NPEs in indexing
   - Fixed unit test to temporarily disable indexing in order to be able to create a corrupt parentless node


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@42803 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Dave Ward
2012-10-18 12:03:53 +00:00
parent 18e20933e5
commit 502bb3d954
6 changed files with 77 additions and 41 deletions

View File

@@ -53,6 +53,7 @@ import org.alfresco.repo.node.NodeServicePolicies.OnUpdateNodePolicy;
import org.alfresco.repo.node.NodeServicePolicies.OnUpdatePropertiesPolicy;
import org.alfresco.repo.node.db.NodeHierarchyWalker;
import org.alfresco.repo.node.db.NodeHierarchyWalker.VisitedNode;
import org.alfresco.repo.node.index.NodeIndexer;
import org.alfresco.repo.policy.BehaviourFilter;
import org.alfresco.repo.policy.JavaBehaviour;
import org.alfresco.repo.policy.Policy;
@@ -101,6 +102,7 @@ public class NodeServiceTest extends TestCase
protected ServiceRegistry serviceRegistry;
protected NodeService nodeService;
protected NodeIndexer nodeIndexer;
protected NodeDAO nodeDAO;
private TransactionService txnService;
private PolicyComponent policyComponent;
@@ -120,6 +122,7 @@ public class NodeServiceTest extends TestCase
serviceRegistry = (ServiceRegistry) ctx.getBean(ServiceRegistry.SERVICE_REGISTRY);
nodeService = serviceRegistry.getNodeService();
nodeIndexer = (NodeIndexer) ctx.getBean("nodeIndexer");
nodeDAO = (NodeDAO) ctx.getBean("nodeDAO");
txnService = serviceRegistry.getTransactionService();
policyComponent = (PolicyComponent) ctx.getBean("policyComponent");
@@ -1245,16 +1248,25 @@ public class NodeServiceTest extends TestCase
// forcefully remove the primary parent assoc
final Long childNodeId = (Long)nodeService.getProperty(childNodeRef, ContentModel.PROP_NODE_DBID);
txnService.getRetryingTransactionHelper().doInTransaction(new RetryingTransactionCallback<Void>()
// We'll need to disable indexing to do this or the transaction will be thrown out
nodeIndexer.setDisabled(true);
try
{
@Override
public Void execute() throws Throwable
txnService.getRetryingTransactionHelper().doInTransaction(new RetryingTransactionCallback<Void>()
{
Pair<Long, ChildAssociationRef> assocPair = nodeDAO.getPrimaryParentAssoc(childNodeId);
nodeDAO.deleteChildAssoc(assocPair.getFirst());
return null;
}
});
@Override
public Void execute() throws Throwable
{
Pair<Long, ChildAssociationRef> assocPair = nodeDAO.getPrimaryParentAssoc(childNodeId);
nodeDAO.deleteChildAssoc(assocPair.getFirst());
return null;
}
});
}
finally
{
nodeIndexer.setDisabled(false);
}
}
// Now need to identify the problem nodes