@Test public void testFindBinding() { Binding<SubjectD, String> match = BINDER.findBinding(SubjectD.class, String.class); assertEquals(CompositeBinding.class, match.getClass()); Binding<AtomicBoolean, String> match2 = BINDER.findBinding(AtomicBoolean.class, String.class); assertEquals(AtomicBooleanStringBinding.class, match2.getClass()); }
@Test public void testFindMarshaller() { ToMarshaller<SubjectD, String> match = BINDER.findMarshaller(SubjectD.class, String.class); assertEquals(CompositeBinding.class, match.getClass()); ToMarshaller<AtomicBoolean, String> match2 = BINDER.findMarshaller(AtomicBoolean.class, String.class); assertEquals(AtomicBooleanStringBinding.class, match2.getClass()); }
@Test public void testFindUnmarshallerWithQualifier() { FromUnmarshaller<SubjectD, String> match = BINDER.findUnmarshaller(SubjectD.class, String.class, Narrow.class); assertEquals(CompositeBinding.class, match.getClass()); FromUnmarshaller<AtomicBoolean, String> match2 = BINDER.findUnmarshaller(AtomicBoolean.class, String.class, DefaultBinding.class); assertEquals(AtomicBooleanStringBinding.class, match2.getClass()); }
@Test public void testConvertToString() { // BigInteger integer = new BigInteger("10"); // assertEquals("10", BINDER.convertTo(BigInteger.class, String.class, integer)); SubjectC sub = new SubjectC("Test"); assertEquals("Test:MARSHALLED_BY_A", BINDER.convertTo(SubjectC.class, String.class, sub)); }
@Test public void testConvertFromStringWithQualifier() { assertEquals( new SubjectD("Test"), BINDER.convertTo(String.class, SubjectD.class, "Test", Narrow.class)); }
@Test public void testConvertFromString() { assertEquals( new SubjectD("Test"), BINDER.convertTo(String.class, SubjectD.class, "Test:MARSHALLED_BY_B")); }
@Test public void testConvertToStringWithQualifier() { SubjectD sub = new SubjectD("Test"); assertEquals( "Test:MARSHALLED_BY_A", BINDER.convertTo(SubjectD.class, String.class, sub, Narrow.class)); }