[maven-release-plugin] copy for tag wamblee-utils-0.2.2
[utils] / security / impl / src / test / java / org / wamblee / usermgt / InMemoryUserSetTest.java
index 98e585dcff5399184d7c67565dacc25d7d57aba9..5c885376091c066c372481e7c931eb59d9f4acfb 100644 (file)
@@ -108,7 +108,7 @@ public class InMemoryUserSetTest extends TestCase {
      *            User to check for existence.
      * 
      */
-    protected void checkUserExists(String aUser) throws SQLException {
+    protected void checkUserExists(String aUser) throws Exception {
         // Empty
     }
 
@@ -119,7 +119,7 @@ public class InMemoryUserSetTest extends TestCase {
      *            User to check for non-existence.
      * 
      */
-    protected void checkUserNotExists(String aUser) throws SQLException {
+    protected void checkUserNotExists(String aUser) throws Exception {
         // Empty
     }
 
@@ -130,7 +130,7 @@ public class InMemoryUserSetTest extends TestCase {
      *            Expected number of users.
      * 
      */
-    protected void checkUserCount(int aSize) throws SQLException {
+    protected void checkUserCount(int aSize) throws Exception {
         assertEquals(aSize, users.size());
     }
 
@@ -141,7 +141,7 @@ public class InMemoryUserSetTest extends TestCase {
      *            User to check for existence.
      * 
      */
-    protected void checkGroupExists(String aUser) throws SQLException {
+    protected void checkGroupExists(String aUser) throws Exception {
         // Empty
     }
 
@@ -152,7 +152,7 @@ public class InMemoryUserSetTest extends TestCase {
      *            User to check for non-existence.
      * 
      */
-    protected void checkGroupNotExists(String aUser) throws SQLException {
+    protected void checkGroupNotExists(String aUser) throws Exception {
         // Empty
     }
 
@@ -163,7 +163,7 @@ public class InMemoryUserSetTest extends TestCase {
      *            Expected number of users.
      * 
      */
-    protected void checkGroupCount(int aSize) throws SQLException {
+    protected void checkGroupCount(int aSize) throws Exception {
         // Empty
     }
 
@@ -172,7 +172,7 @@ public class InMemoryUserSetTest extends TestCase {
      * contains().
      * 
      */
-    public void testAdd() throws SQLException, UserMgtException {
+    public void testAdd() throws Exception {
         User user = createUser("user1", PASSWORD, group);
         assertTrue(users.add(user));
         checkUserExists(user.getName());
@@ -191,7 +191,7 @@ public class InMemoryUserSetTest extends TestCase {
      * Tries to find a non-existing user. Verifies that null is returned.
      * 
      */
-    public void testFindUnknownUser() throws SQLException, UserMgtException {
+    public void testFindUnknownUser() throws Exception {
         User user1 = createUser("user1", PASSWORD, group);
         User user2 = createUser("user2", PASSWORD, group);
         users.add(user1);
@@ -207,7 +207,7 @@ public class InMemoryUserSetTest extends TestCase {
      * Adds duplicate user. Verifies that the existing user is left untouched.
      * 
      */
-    public void testAddDuplicateUser() throws SQLException, UserMgtException {
+    public void testAddDuplicateUser() throws Exception {
         User user1 = createUser("user1", PASSWORD, group);
         users.add(user1);
 
@@ -226,7 +226,7 @@ public class InMemoryUserSetTest extends TestCase {
      * true.
      * 
      */
-    public void testRemoveUser() throws SQLException, UserMgtException {
+    public void testRemoveUser() throws Exception {
         User user1 = createUser("user1", PASSWORD, group);
         users.add(user1);
         assertTrue(users.contains(user1));
@@ -244,15 +244,13 @@ public class InMemoryUserSetTest extends TestCase {
      * the return value is true.
      * 
      */
-    public void testRemoveNonExistingUser() throws SQLException,
+    public void testRemoveNonExistingUser() throws Exception,
         UserMgtException {
         User user1 = createUser("user1", PASSWORD, group);
         users.add(user1);
         checkUserCount(1);
 
         User nonExistingUser = createUser("user2", PASSWORD, group);
-        nonExistingUser.setPrimaryKey(new Long(1000));
-        nonExistingUser.setPersistedVersion(10);
         assertFalse(users.remove(nonExistingUser));
         assertTrue(users.contains(user1));
         assertEquals(1, users.list().size());
@@ -264,7 +262,7 @@ public class InMemoryUserSetTest extends TestCase {
      * all.
      * 
      */
-    public void testList() throws SQLException, UserMgtException {
+    public void testList() throws Exception {
         User user1 = createUser("user1", PASSWORD, group);
         User user2 = createUser("user2", PASSWORD, group);
         User user3 = createUser("user3", PASSWORD, group);
@@ -290,7 +288,7 @@ public class InMemoryUserSetTest extends TestCase {
      * 
      * @throws SQLException
      */
-    public void testListByGroup() throws SQLException, UserMgtException {
+    public void testListByGroup() throws Exception {
         Group group1 = new Group("group1");
         Group group2 = new Group("group2");
         Group group3 = new Group("group3");