SEC-1165: Relax the requirement that the ObjectIdentity "type" be a Java class. Modified ObjectIdentity, changing the javaType property to "type" which is now a plain String. Also removes the requirement that the class be present on the classpath when creating the ObjectIdentityImpl instance (e.g. in the case of a permissions administration app which doesn't actually use the domain classes itself).

This commit is contained in:
Luke Taylor
2009-06-09 00:17:45 +00:00
parent 0473cfbfc0
commit 39d76d5b5f
6 changed files with 41 additions and 42 deletions

View File

@@ -64,7 +64,7 @@ public class ObjectIdentityImplTests {
public void gettersReturnExpectedValues() throws Exception {
ObjectIdentity obj = new ObjectIdentityImpl(DOMAIN_CLASS, Long.valueOf(1));
assertEquals(Long.valueOf(1), obj.getIdentifier());
assertEquals(MockIdDomainObject.class, obj.getJavaType());
assertEquals(MockIdDomainObject.class.getName(), obj.getType());
}
@Test
@@ -106,9 +106,9 @@ public class ObjectIdentityImplTests {
}
}
@Test(expected=IllegalStateException.class)
public void testConstructorInvalidClassParameter() throws Exception {
new ObjectIdentityImpl("not.a.Class", Long.valueOf(1));
@Test(expected=IllegalArgumentException.class)
public void constructorRejectsInvalidTypeParameter() throws Exception {
new ObjectIdentityImpl("", Long.valueOf(1));
}
@Test