mirror of https://github.com/apache/archiva.git
ensure cleanup datas for other tests
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1133543 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
c82abad170
commit
1fb61463c8
|
@ -19,12 +19,13 @@ package org.apache.maven.archiva.security;
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* DefaultUserRepositoriesTest
|
||||
*
|
||||
|
@ -36,7 +37,8 @@ public class DefaultUserRepositoriesTest
|
|||
|
||||
|
||||
@Before
|
||||
public void setUp() throws Exception
|
||||
public void setUp()
|
||||
throws Exception
|
||||
{
|
||||
super.setUp();
|
||||
restoreGuestInitialValues( USER_ALPACA );
|
||||
|
@ -69,8 +71,19 @@ public class DefaultUserRepositoriesTest
|
|||
|
||||
assertRepoIds( new String[]{ "central", "corporate" }, userRepos.getObservableRepositoryIds( USER_ALPACA ) );
|
||||
assertRepoIds( new String[]{ "coporate" }, userRepos.getObservableRepositoryIds( USER_GUEST ) );
|
||||
assertRepoIds( new String[] { "central", "internal", "corporate", "snapshots", "secret" }, userRepos
|
||||
.getObservableRepositoryIds( USER_ADMIN ) );
|
||||
assertRepoIds( new String[]{ "central", "internal", "corporate", "snapshots", "secret" },
|
||||
userRepos.getObservableRepositoryIds( USER_ADMIN ) );
|
||||
|
||||
}
|
||||
|
||||
@After
|
||||
public void tearDown()
|
||||
throws Exception
|
||||
{
|
||||
super.tearDown();
|
||||
restoreGuestInitialValues( USER_ALPACA );
|
||||
restoreGuestInitialValues( USER_GUEST );
|
||||
restoreGuestInitialValues( USER_ADMIN );
|
||||
}
|
||||
|
||||
private void assertRepoIds( String[] expectedRepoIds, List<String> observableRepositoryIds )
|
||||
|
@ -80,8 +93,9 @@ public class DefaultUserRepositoriesTest
|
|||
if ( expectedRepoIds.length != observableRepositoryIds.size() )
|
||||
{
|
||||
fail( "Size of Observable Repository Ids wrong, expected <" + expectedRepoIds.length + "> but got <"
|
||||
+ observableRepositoryIds.size() + "> instead. \nExpected: [" + StringUtils.join( expectedRepoIds, "," )
|
||||
+ "]\nActual: [" + StringUtils.join( observableRepositoryIds.iterator(), "," ) + "]" );
|
||||
+ observableRepositoryIds.size() + "> instead. \nExpected: ["
|
||||
+ StringUtils.join( expectedRepoIds, "," ) + "]\nActual: ["
|
||||
+ StringUtils.join( observableRepositoryIds.iterator(), "," ) + "]" );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -38,9 +38,7 @@ import javax.inject.Inject;
|
|||
public class RoleManagerTest
|
||||
extends TestCase
|
||||
{
|
||||
/**
|
||||
* @plexus.requirement role-hint="default"
|
||||
*/
|
||||
|
||||
@Inject
|
||||
RoleManager roleManager;
|
||||
|
||||
|
|
Loading…
Reference in New Issue