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
|
||||
protected void onTearDownInTransaction() throws Exception
|
||||
{
|
||||
authenticationComponent.clearCurrentSecurityContext();
|
||||
try
|
||||
{
|
||||
authenticationComponent.clearCurrentSecurityContext();
|
||||
}
|
||||
catch (Throwable e)
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
super.onTearDownInTransaction();
|
||||
}
|
||||
|
||||
@@ -707,7 +714,7 @@ public abstract class BaseNodeServiceTest extends BaseSpringTest
|
||||
return count;
|
||||
}
|
||||
|
||||
public void testAddChild() throws Exception
|
||||
public void testAddBogusChild() throws Exception
|
||||
{
|
||||
// create a bogus reference
|
||||
NodeRef bogusChildRef = new NodeRef(rootNodeRef.getStoreRef(), "BOGUS");
|
||||
@@ -720,6 +727,10 @@ public abstract class BaseNodeServiceTest extends BaseSpringTest
|
||||
{
|
||||
// expected
|
||||
}
|
||||
}
|
||||
|
||||
public void testAddChild() throws Exception
|
||||
{
|
||||
NodeRef childNodeRef = nodeService.createNode(
|
||||
rootNodeRef,
|
||||
ASSOC_TYPE_QNAME_TEST_CHILDREN,
|
||||
@@ -1115,7 +1126,7 @@ public abstract class BaseNodeServiceTest extends BaseSpringTest
|
||||
return assocRef;
|
||||
}
|
||||
|
||||
public void testCreateAndRemoveAssociation() throws Exception
|
||||
public void testAssociationToIncorrectNodeType() throws Exception
|
||||
{
|
||||
AssociationRef assocRef = createAssociation();
|
||||
NodeRef sourceRef = assocRef.getSourceRef();
|
||||
@@ -1131,6 +1142,14 @@ public abstract class BaseNodeServiceTest extends BaseSpringTest
|
||||
{
|
||||
// expected
|
||||
}
|
||||
}
|
||||
|
||||
public void testDuplicateAssociationDetection() throws Exception
|
||||
{
|
||||
AssociationRef assocRef = createAssociation();
|
||||
NodeRef sourceRef = assocRef.getSourceRef();
|
||||
NodeRef targetRef = assocRef.getTargetRef();
|
||||
QName qname = assocRef.getTypeQName();
|
||||
try
|
||||
{
|
||||
// attempt repeat
|
||||
@@ -1141,6 +1160,12 @@ public abstract class BaseNodeServiceTest extends BaseSpringTest
|
||||
{
|
||||
// expected
|
||||
}
|
||||
}
|
||||
|
||||
public void testCreateAndRemoveAssociation() throws Exception
|
||||
{
|
||||
AssociationRef assocRef = createAssociation();
|
||||
NodeRef sourceRef = assocRef.getSourceRef();
|
||||
|
||||
// create another
|
||||
Map<QName, Serializable> properties = new HashMap<QName, Serializable>(5);
|
||||
|
Reference in New Issue
Block a user