Merged BRANCHES/DEV/V4.0-BUG-FIX to HEAD

37628: Build Fix


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@37696 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Andrew Hind
2012-06-12 18:49:03 +00:00
parent d7432dcc64
commit 6b19ff80b0

View File

@@ -819,6 +819,10 @@ public class SOLRTrackingComponentTest extends TestCase
{
expectedNumMetaDataNodes++;
}
if(nodeStatus == NodeStatus.DELETED)
{
expectedNumMetaDataNodes++;
}
if(doChecks)
{
@@ -885,113 +889,117 @@ public class SOLRTrackingComponentTest extends TestCase
Long nodeId = nodeMetaData.getNodeId();
NodeRef nodeRef = nodeMetaData.getNodeRef();
Set<QName> aspects = nodeMetaData.getAspects();
Set<QName> actualAspects = nodeService.getAspects(nodeRef);
assertEquals("Aspects are incorrect", actualAspects, aspects);
Map<QName, Serializable> properties = nodeMetaData.getProperties();
// NodeService converts properties so use nodeDAO to get unadulterated property value
Map<QName, Serializable> actualProperties = filterResudualProperties(nodeDAO.getNodeProperties(nodeId));
//assertTrue("Properties are incorrect", compareProperties(actualProperties, properties));
assertEquals("Properties are incorrect", actualProperties, properties);
NodeAssertions assertions = getNodeAssertions(nodeRef);
// NodeAssertions assertions = nodes.get(nodeRef);
Set<QName> expectedAspects = assertions.getAspects();
if(expectedAspects != null)
if(nodeService.exists(nodeRef))
{
for(QName aspect : expectedAspects)
Set<QName> aspects = nodeMetaData.getAspects();
Set<QName> actualAspects = nodeService.getAspects(nodeRef);
assertEquals("Aspects are incorrect", actualAspects, aspects);
Map<QName, Serializable> properties = nodeMetaData.getProperties();
// NodeService converts properties so use nodeDAO to get unadulterated property value
Map<QName, Serializable> actualProperties = filterResudualProperties(nodeDAO.getNodeProperties(nodeId));
//assertTrue("Properties are incorrect", compareProperties(actualProperties, properties));
assertEquals("Properties are incorrect", actualProperties, properties);
NodeAssertions assertions = getNodeAssertions(nodeRef);
// NodeAssertions assertions = nodes.get(nodeRef);
Set<QName> expectedAspects = assertions.getAspects();
if(expectedAspects != null)
{
assertTrue("Expected aspect" + aspect, aspects.contains(aspect));
for(QName aspect : expectedAspects)
{
assertTrue("Expected aspect" + aspect, aspects.contains(aspect));
}
}
}
Map<QName, Serializable> expectedProperties = assertions.getProperties();
if(expectedProperties != null)
{
for(QName propName : expectedProperties.keySet())
Map<QName, Serializable> expectedProperties = assertions.getProperties();
if(expectedProperties != null)
{
Serializable expectedPropValue = expectedProperties.get(propName);
Serializable actualPropValue = properties.get(propName);
assertNotNull("Missing property " + propName, actualPropValue);
assertEquals("Incorrect property value", expectedPropValue, actualPropValue);
for(QName propName : expectedProperties.keySet())
{
Serializable expectedPropValue = expectedProperties.get(propName);
Serializable actualPropValue = properties.get(propName);
assertNotNull("Missing property " + propName, actualPropValue);
assertEquals("Incorrect property value", expectedPropValue, actualPropValue);
}
}
}
// TODO complete path tests
// List<Path> actualPaths = nodeMetaData.getPaths();
// List<Path> expectedPaths = nodeService.getPaths(nodeRef, false);
// assertEquals("Paths are incorrect", expectedPaths, actualPaths);
// TODO complete path tests
// List<Path> actualPaths = nodeMetaData.getPaths();
// List<Path> expectedPaths = nodeService.getPaths(nodeRef, false);
// assertEquals("Paths are incorrect", expectedPaths, actualPaths);
boolean expectAspects = assertions.isExpectAspects();
if(expectAspects && nodeMetaData.getAspects() == null)
{
fail("Expecting aspects but got no aspects");
}
else if(!expectAspects && nodeMetaData.getAspects() != null)
{
fail("Not expecting aspects but got aspects");
}
boolean expectAspects = assertions.isExpectAspects();
if(expectAspects && nodeMetaData.getAspects() == null)
{
fail("Expecting aspects but got no aspects");
}
else if(!expectAspects && nodeMetaData.getAspects() != null)
{
fail("Not expecting aspects but got aspects");
}
boolean expectProperties = assertions.isExpectProperties();
if(expectProperties && nodeMetaData.getProperties() == null)
{
fail("Expecting properties but got no properties");
}
else if(!expectProperties && nodeMetaData.getProperties() != null)
{
fail("Not expecting properties but got properties");
}
boolean expectProperties = assertions.isExpectProperties();
if(expectProperties && nodeMetaData.getProperties() == null)
{
fail("Expecting properties but got no properties");
}
else if(!expectProperties && nodeMetaData.getProperties() != null)
{
fail("Not expecting properties but got properties");
}
boolean expectType = assertions.isExpectType();
if(expectType && nodeMetaData.getNodeType() == null)
{
fail("Expecting type but got no type");
}
else if(!expectType && nodeMetaData.getNodeType() != null)
{
fail("Not expecting type but got type");
}
boolean expectType = assertions.isExpectType();
if(expectType && nodeMetaData.getNodeType() == null)
{
fail("Expecting type but got no type");
}
else if(!expectType && nodeMetaData.getNodeType() != null)
{
fail("Not expecting type but got type");
}
boolean expectAclId = assertions.isExpectAclId();
if(expectAclId && nodeMetaData.getAclId() == null)
{
fail("Expecting acl id but got no acl id");
}
else if(!expectAclId && nodeMetaData.getAclId() != null)
{
fail("Not expecting acl id but got acl id");
}
boolean expectAclId = assertions.isExpectAclId();
if(expectAclId && nodeMetaData.getAclId() == null)
{
fail("Expecting acl id but got no acl id");
}
else if(!expectAclId && nodeMetaData.getAclId() != null)
{
fail("Not expecting acl id but got acl id");
}
boolean expectPaths = assertions.isExpectPaths();
if(expectPaths && nodeMetaData.getPaths() == null)
{
fail("Expecting paths but got no paths");
}
else if(!expectPaths && nodeMetaData.getPaths() != null)
{
fail("Not expecting paths but got paths");
}
boolean expectPaths = assertions.isExpectPaths();
if(expectPaths && nodeMetaData.getPaths() == null)
{
fail("Expecting paths but got no paths");
}
else if(!expectPaths && nodeMetaData.getPaths() != null)
{
fail("Not expecting paths but got paths");
}
boolean expectAssociations = assertions.isExpectAssociations();
if(expectAssociations && nodeMetaData.getChildAssocs() == null)
{
fail("Expecting associations but got no associations");
}
else if(!expectAssociations && nodeMetaData.getChildAssocs() != null)
{
fail("Not expecting associations but got associations");
}
boolean expectAssociations = assertions.isExpectAssociations();
if(expectAssociations && nodeMetaData.getChildAssocs() == null)
{
fail("Expecting associations but got no associations");
}
else if(!expectAssociations && nodeMetaData.getChildAssocs() != null)
{
fail("Not expecting associations but got associations");
}
boolean expectOwner = assertions.isExpectOwner();
if(expectOwner && nodeMetaData.getOwner() == null)
{
fail("Expecting owner but got no owner");
}
else if(!expectOwner && nodeMetaData.getOwner() != null)
{
fail("Not expecting owner but got owner");
boolean expectOwner = assertions.isExpectOwner();
if(expectOwner && nodeMetaData.getOwner() == null)
{
fail("Expecting owner but got no owner");
}
else if(!expectOwner && nodeMetaData.getOwner() != null)
{
fail("Not expecting owner but got owner");
}
}
}