mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Broke up tests that were testing failure modes and then trying to test success modes
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2151 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -159,7 +159,14 @@ public abstract class BaseNodeServiceTest extends BaseSpringTest
|
|||||||
@Override
|
@Override
|
||||||
protected void onTearDownInTransaction() throws Exception
|
protected void onTearDownInTransaction() throws Exception
|
||||||
{
|
{
|
||||||
authenticationComponent.clearCurrentSecurityContext();
|
try
|
||||||
|
{
|
||||||
|
authenticationComponent.clearCurrentSecurityContext();
|
||||||
|
}
|
||||||
|
catch (Throwable e)
|
||||||
|
{
|
||||||
|
// do nothing
|
||||||
|
}
|
||||||
super.onTearDownInTransaction();
|
super.onTearDownInTransaction();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -707,7 +714,7 @@ public abstract class BaseNodeServiceTest extends BaseSpringTest
|
|||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testAddChild() throws Exception
|
public void testAddBogusChild() throws Exception
|
||||||
{
|
{
|
||||||
// create a bogus reference
|
// create a bogus reference
|
||||||
NodeRef bogusChildRef = new NodeRef(rootNodeRef.getStoreRef(), "BOGUS");
|
NodeRef bogusChildRef = new NodeRef(rootNodeRef.getStoreRef(), "BOGUS");
|
||||||
@@ -720,6 +727,10 @@ public abstract class BaseNodeServiceTest extends BaseSpringTest
|
|||||||
{
|
{
|
||||||
// expected
|
// expected
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void testAddChild() throws Exception
|
||||||
|
{
|
||||||
NodeRef childNodeRef = nodeService.createNode(
|
NodeRef childNodeRef = nodeService.createNode(
|
||||||
rootNodeRef,
|
rootNodeRef,
|
||||||
ASSOC_TYPE_QNAME_TEST_CHILDREN,
|
ASSOC_TYPE_QNAME_TEST_CHILDREN,
|
||||||
@@ -1115,7 +1126,7 @@ public abstract class BaseNodeServiceTest extends BaseSpringTest
|
|||||||
return assocRef;
|
return assocRef;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testCreateAndRemoveAssociation() throws Exception
|
public void testAssociationToIncorrectNodeType() throws Exception
|
||||||
{
|
{
|
||||||
AssociationRef assocRef = createAssociation();
|
AssociationRef assocRef = createAssociation();
|
||||||
NodeRef sourceRef = assocRef.getSourceRef();
|
NodeRef sourceRef = assocRef.getSourceRef();
|
||||||
@@ -1131,6 +1142,14 @@ public abstract class BaseNodeServiceTest extends BaseSpringTest
|
|||||||
{
|
{
|
||||||
// expected
|
// expected
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void testDuplicateAssociationDetection() throws Exception
|
||||||
|
{
|
||||||
|
AssociationRef assocRef = createAssociation();
|
||||||
|
NodeRef sourceRef = assocRef.getSourceRef();
|
||||||
|
NodeRef targetRef = assocRef.getTargetRef();
|
||||||
|
QName qname = assocRef.getTypeQName();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// attempt repeat
|
// attempt repeat
|
||||||
@@ -1141,6 +1160,12 @@ public abstract class BaseNodeServiceTest extends BaseSpringTest
|
|||||||
{
|
{
|
||||||
// expected
|
// expected
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void testCreateAndRemoveAssociation() throws Exception
|
||||||
|
{
|
||||||
|
AssociationRef assocRef = createAssociation();
|
||||||
|
NodeRef sourceRef = assocRef.getSourceRef();
|
||||||
|
|
||||||
// create another
|
// create another
|
||||||
Map<QName, Serializable> properties = new HashMap<QName, Serializable>(5);
|
Map<QName, Serializable> properties = new HashMap<QName, Serializable>(5);
|
||||||
|
Reference in New Issue
Block a user