示例#1
0
  @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());
  }
示例#2
0
  @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());
  }
示例#3
0
  @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());
  }
示例#4
0
  @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));
  }
示例#5
0
 @Test
 public void testConvertFromStringWithQualifier() {
   assertEquals(
       new SubjectD("Test"), BINDER.convertTo(String.class, SubjectD.class, "Test", Narrow.class));
 }
示例#6
0
 @Test
 public void testConvertFromString() {
   assertEquals(
       new SubjectD("Test"),
       BINDER.convertTo(String.class, SubjectD.class, "Test:MARSHALLED_BY_B"));
 }
示例#7
0
 @Test
 public void testConvertToStringWithQualifier() {
   SubjectD sub = new SubjectD("Test");
   assertEquals(
       "Test:MARSHALLED_BY_A", BINDER.convertTo(SubjectD.class, String.class, sub, Narrow.class));
 }