use of org.springsource.loaded.TypeRegistry in project spring-loaded by spring-projects.
the class ReflectiveReflectionTests method testJLClassGetAnnotations.
@Test
public void testJLClassGetAnnotations() throws Exception {
String t = "iri.JLCGetAnnotations";
TypeRegistry r = getTypeRegistry(t);
ReloadableType rtype = r.addType(t, loadBytesForClass(t));
result = runUnguarded(rtype.getClazz(), "run");
assertEquals("1:@reflection.AnnoT()", result.returnValue);
rtype.loadNewVersion(retrieveRenameRetarget(t));
result = runUnguarded(rtype.getClazz(), "run");
assertEquals("1:@java.lang.Deprecated()", result.returnValue);
}
use of org.springsource.loaded.TypeRegistry in project spring-loaded by spring-projects.
the class ReflectiveReflectionTests method testJLClassGetDeclaredConstructor.
@Test
public void testJLClassGetDeclaredConstructor() throws Exception {
String t = "iri.JLCGetDecConstructor";
TypeRegistry r = getTypeRegistry(t);
ReloadableType rtype = r.addType(t, loadBytesForClass(t));
result = runUnguarded(rtype.getClazz(), "run");
assertEquals("iri.JLCGetDecConstructor()", result.returnValue);
rtype.loadNewVersion(retrieveRenameRetarget(t));
result = runUnguarded(rtype.getClazz(), "run");
assertEquals("iri.JLCGetDecConstructor(String)", result.returnValue);
}
use of org.springsource.loaded.TypeRegistry in project spring-loaded by spring-projects.
the class ReflectiveReflectionTests method testJLRFIsAnnotationPresent.
@Test
public void testJLRFIsAnnotationPresent() throws Exception {
String t = "iri.JLRFIsAnnotationPresent";
TypeRegistry r = getTypeRegistry(t);
ReloadableType rtype = r.addType(t, loadBytesForClass(t));
result = runUnguarded(rtype.getClazz(), "run");
assertEquals("truefalse", result.returnValue);
rtype.loadNewVersion(retrieveRenameRetarget(t));
result = runUnguarded(rtype.getClazz(), "run");
assertEquals("falsetrue", result.returnValue);
}
use of org.springsource.loaded.TypeRegistry in project spring-loaded by spring-projects.
the class ReflectiveReflectionTests method testJLRFGetTheRest.
// All the other gets!
@Test
public void testJLRFGetTheRest() throws Exception {
String t = "iri.JLRFGetTheRest";
TypeRegistry r = getTypeRegistry(t);
ReloadableType rtype = r.addType(t, loadBytesForClass(t));
result = runUnguarded(rtype.getClazz(), "run");
System.out.println(result);
assertEquals("true 123 a 3.141 33.0 12345 444 99", result.returnValue);
rtype.loadNewVersion(retrieveRenameRetarget(t));
result = runUnguarded(rtype.getClazz(), "run");
assertEquals("true 23 b 4.141 43.0 22345 544 999", result.returnValue);
}
use of org.springsource.loaded.TypeRegistry in project spring-loaded by spring-projects.
the class ReflectiveReflectionTests method testJLClassGetModifiers.
@Test
public void testJLClassGetModifiers() throws Exception {
String t = "iri.JLCGetModifiers";
TypeRegistry r = getTypeRegistry(t + ",iri.Helper");
ReloadableType rtype = r.addType(t, loadBytesForClass(t));
ReloadableType rtypeh = r.addType("iri.Helper", loadBytesForClass("iri.Helper"));
result = runUnguarded(rtype.getClazz(), "run");
assertEquals("0", result.returnValue);
rtypeh.loadNewVersion(rtypeh.bytesInitial);
result = runUnguarded(rtype.getClazz(), "run");
assertEquals("0", result.returnValue);
}
Aggregations