diff options
author | Olivier Lamy <olamy@apache.org> | 2012-12-10 16:34:46 +0000 |
---|---|---|
committer | Olivier Lamy <olamy@apache.org> | 2012-12-10 16:34:46 +0000 |
commit | 30c1cfa2a4583ac63b02482776880edea0470296 (patch) | |
tree | 2ee94e254f46c3069abb5da489bcf29a52043e4d /redback-data-management/src/test | |
parent | e0dc1a19660ebdac272d3ef7a09c2122fee4000e (diff) | |
download | archiva-30c1cfa2a4583ac63b02482776880edea0470296.tar.gz archiva-30c1cfa2a4583ac63b02482776880edea0470296.zip |
UserManagerException is now a checked Exception
git-svn-id: https://svn.apache.org/repos/asf/archiva/redback/redback-core/trunk@1419568 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'redback-data-management/src/test')
-rw-r--r-- | redback-data-management/src/test/java/org/apache/archiva/redback/management/DataManagementTest.java | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/redback-data-management/src/test/java/org/apache/archiva/redback/management/DataManagementTest.java b/redback-data-management/src/test/java/org/apache/archiva/redback/management/DataManagementTest.java index 01342ea80..cf29e6c6b 100644 --- a/redback-data-management/src/test/java/org/apache/archiva/redback/management/DataManagementTest.java +++ b/redback-data-management/src/test/java/org/apache/archiva/redback/management/DataManagementTest.java @@ -28,6 +28,7 @@ import org.apache.archiva.redback.rbac.RBACManager; import org.apache.archiva.redback.rbac.Role; import org.apache.archiva.redback.rbac.UserAssignment; import org.apache.archiva.redback.users.UserManager; +import org.apache.archiva.redback.users.UserManagerException; import org.apache.commons.io.FileUtils; import org.apache.commons.io.IOUtils; import org.apache.commons.lang.SystemUtils; @@ -56,8 +57,8 @@ import java.util.List; import java.util.Locale; -@RunWith( SpringJUnit4ClassRunner.class ) -@ContextConfiguration( locations = { "classpath*:/META-INF/spring-context.xml", "classpath*:/spring-context.xml" } ) +@RunWith(SpringJUnit4ClassRunner.class) +@ContextConfiguration(locations = { "classpath*:/META-INF/spring-context.xml", "classpath*:/spring-context.xml" }) public class DataManagementTest extends TestCase { @@ -67,20 +68,20 @@ public class DataManagementTest private File targetDirectory; @Inject - @Named( value = "jdoFactory#users" ) + @Named(value = "jdoFactory#users") UserConfigurableJdoFactory jdoFactory; @Inject - @Named( value = "userManager#jdo" ) + @Named(value = "userManager#jdo") UserManager userManager; @Inject - @Named( value = "keyManager#jdo" ) + @Named(value = "keyManager#jdo") KeyManager keyManager; @Inject - @Named( value = "rBACManager#jdo" ) + @Named(value = "rBACManager#jdo") RBACManager rbacManager; @Before @@ -184,6 +185,7 @@ public class DataManagementTest } private void createUserDatabase( UserManager manager ) + throws UserManagerException { User user = manager.createUser( "smcqueen", "Steve McQueen", "the cooler king" ); user.setPassword( "abc123" ); @@ -250,7 +252,7 @@ public class DataManagementTest FileWriter fw = new FileWriter( backupFile ); - IOUtils.copy( is, fw); + IOUtils.copy( is, fw ); is.close(); @@ -373,6 +375,7 @@ public class DataManagementTest } private void assertEmpty( UserManager manager ) + throws UserManagerException { List<User> users = manager.getUsers(); assertEquals( 0, users.size() ); @@ -392,7 +395,7 @@ public class DataManagementTest FileWriter fw = new FileWriter( backupFile ); - IOUtils.copy( getClass().getResourceAsStream( "/expected-keys.xml" ), fw); + IOUtils.copy( getClass().getResourceAsStream( "/expected-keys.xml" ), fw ); fw.close(); |