Browse Source

add more unit tests

git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1163200 13f79535-47bb-0310-9956-ffa450edef68
tags/archiva-1.4-M1
Olivier Lamy 12 years ago
parent
commit
c23eed84a3

+ 16
- 0
archiva-modules/archiva-base/archiva-repository-admin/src/test/java/org/apache/archiva/admin/repository/managed/ManagedRepositoryAdminTest.java View File

@@ -139,6 +139,12 @@ public class ManagedRepositoryAdminTest
repo.setName( "test repo" );
repo.setLocation( APPSERVER_BASE_PATH + repo.getId() );
managedRepositoryAdmin.addManagedRepository( repo, false, getFakeAuditInformation() );

assertTrue(
roleManager.templatedRoleExists( ArchivaRoleConstants.TEMPLATE_REPOSITORY_OBSERVER, "test-new-one" ) );
assertTrue(
roleManager.templatedRoleExists( ArchivaRoleConstants.TEMPLATE_REPOSITORY_MANAGER, "test-new-one" ) );

repos = managedRepositoryAdmin.getManagedRepositories();
assertNotNull( repos );
assertEquals( initialSize + 1, repos.size() );
@@ -157,8 +163,18 @@ public class ManagedRepositoryAdminTest
assertEquals( APPSERVER_BASE_PATH + "new-path", repo.getLocation() );
assertTrue( new File( APPSERVER_BASE_PATH + "new-path" ).exists() );

assertTrue(
roleManager.templatedRoleExists( ArchivaRoleConstants.TEMPLATE_REPOSITORY_OBSERVER, "test-new-one" ) );
assertTrue(
roleManager.templatedRoleExists( ArchivaRoleConstants.TEMPLATE_REPOSITORY_MANAGER, "test-new-one" ) );

managedRepositoryAdmin.deleteManagedRepository( repo.getId(), getFakeAuditInformation() );

assertFalse(
roleManager.templatedRoleExists( ArchivaRoleConstants.TEMPLATE_REPOSITORY_OBSERVER, "test-new-one" ) );
assertFalse(
roleManager.templatedRoleExists( ArchivaRoleConstants.TEMPLATE_REPOSITORY_MANAGER, "test-new-one" ) );

assertEquals( "not 3 audit events " + mockAuditListener.getAuditEvents(), 3,
mockAuditListener.getAuditEvents().size() );


Loading…
Cancel
Save