* User to check for existence.
*
*/
- protected void checkUserExists(String aUser) throws SQLException {
+ protected void checkUserExists(String aUser) throws Exception {
// Empty
}
* User to check for non-existence.
*
*/
- protected void checkUserNotExists(String aUser) throws SQLException {
+ protected void checkUserNotExists(String aUser) throws Exception {
// Empty
}
* Expected number of users.
*
*/
- protected void checkUserCount(int aSize) throws SQLException {
+ protected void checkUserCount(int aSize) throws Exception {
assertEquals(aSize, users.size());
}
* User to check for existence.
*
*/
- protected void checkGroupExists(String aUser) throws SQLException {
+ protected void checkGroupExists(String aUser) throws Exception {
// Empty
}
* User to check for non-existence.
*
*/
- protected void checkGroupNotExists(String aUser) throws SQLException {
+ protected void checkGroupNotExists(String aUser) throws Exception {
// Empty
}
* Expected number of users.
*
*/
- protected void checkGroupCount(int aSize) throws SQLException {
+ protected void checkGroupCount(int aSize) throws Exception {
// Empty
}
* 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());
* 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);
* 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);
* 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));
* 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());
* 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);
*
* @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");