NIHVIVO-2279 UserAccountsDao should recognize if a URI represents an object of the wrong type.

This commit is contained in:
j2blake 2011-06-01 14:58:22 +00:00
parent 498aea8ac0
commit 0c4d72f777
2 changed files with 39 additions and 0 deletions

View file

@ -103,6 +103,13 @@ public class UserAccountsDaoJenaTest extends AbstractTestClass {
UserAccount u = dao.getUserAccountByUri("bogusUri");
assertNull("null result", u);
}
@Test
public void getUserAccountByUriWrongType() {
UserAccount u = dao.getUserAccountByUri(URI_ROLE1);
System.out.println(u);
assertNull("null result", u);
}
@Test
public void getUserAccountByEmailSuccess() {
@ -264,6 +271,12 @@ public class UserAccountsDaoJenaTest extends AbstractTestClass {
assertNull("null result", ps);
}
@Test
public void getPermissionSetByUriWrongType() {
PermissionSet ps = dao.getPermissionSetByUri(URI_USER1);
assertNull("null result", ps);
}
@Test
public void getAllPermissionSets() {
setLoggerLevel(JenaBaseDao.class, Level.DEBUG);