Search in sources :

Example 1 with A

use of jodd.util.testdata.A in project jodd by oblac.

the class ClassConverterTest method testCast.

@Test
public void testCast() {
    String s = "123";
    Integer d = TypeConverterManager.convertType(s, Integer.class);
    assertEquals(123, d.intValue());
    s = TypeConverterManager.convertType(d, String.class);
    assertEquals("123", s);
    MutableInteger md = TypeConverterManager.convertType(s, MutableInteger.class);
    assertEquals(123, md.intValue());
    B b = new B();
    A a = TypeConverterManager.convertType(b, A.class);
    assertEquals(a, b);
}
Also used : MutableInteger(jodd.mutable.MutableInteger) A(jodd.util.testdata.A) B(jodd.util.testdata.B) MutableInteger(jodd.mutable.MutableInteger) Test(org.junit.Test)

Aggregations

MutableInteger (jodd.mutable.MutableInteger)1 A (jodd.util.testdata.A)1 B (jodd.util.testdata.B)1 Test (org.junit.Test)1