Fix tests to clean up container after method execution

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@42017 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Kevin Roast
2012-09-26 09:57:33 +00:00
parent 9ea4a2fe54
commit 5a0337796c

View File

@@ -158,7 +158,18 @@ public class RemoteCredentialsServicesTest
// To start with, the container shouldn't be there
NodeRef container = ((RemoteCredentialsServiceImpl)PRIVATE_REMOTE_CREDENTIALS_SERVICE).getSharedContainerNodeRef(false);
assertEquals(null, container);
if (container != null)
{
// Tidy up
AuthenticationUtil.setAdminUserAsFullyAuthenticatedUser();
// Zap the container
PUBLIC_NODE_SERVICE.deleteNode(container);
}
// Run as a test user
AuthenticationUtil.setFullyAuthenticatedUser(TEST_USER_ONE);
// Ask for the list of shared remote systems
REMOTE_CREDENTIALS_SERVICE.listSharedRemoteSystems(new PagingRequest(10));
@@ -184,6 +195,13 @@ public class RemoteCredentialsServicesTest
// Should have single node in it
assertEquals(1, PUBLIC_NODE_SERVICE.getChildAssocs(container).size());
// Tidy up
AuthenticationUtil.setAdminUserAsFullyAuthenticatedUser();
// Zap the container
PUBLIC_NODE_SERVICE.deleteNode(container);
}
/**