Package ch.inftec.ju.util.persistable.GenericMementoUtils

Examples of ch.inftec.ju.util.persistable.GenericMementoUtils.TypeHandlerBuilder.addMapping()


   
    // Check default instantiation
    Assert.assertEquals(TypeHandler1.class, builder.getHandler().newInstance(TypeHandler1.class.getName()).getClass());
   
    // Check automatic mapping without field
    builder.addMapping(TypeHandler1.class);
    Assert.assertEquals(TypeHandler1.class.getName(), builder.getHandler().getTypeName(th1));
   
    // Check automatic mapping with field
    builder.addMapping(TypeHandler2.class);
    Assert.assertEquals("H2", builder.getHandler().getTypeName(th2));
View Full Code Here


    // Check automatic mapping without field
    builder.addMapping(TypeHandler1.class);
    Assert.assertEquals(TypeHandler1.class.getName(), builder.getHandler().getTypeName(th1));
   
    // Check automatic mapping with field
    builder.addMapping(TypeHandler2.class);
    Assert.assertEquals("H2", builder.getHandler().getTypeName(th2));
    Assert.assertEquals(TypeHandler2.class, builder.getHandler().newInstance("H2").getClass());
   
    // Create instance of private class
    Assert.assertEquals(TypeHandler3.class, builder.getHandler().newInstance(TypeHandler3.class.getName()).getClass());
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.