예제 #1
0
  @Test
  public void testParseComObjetosInner() {

    InnerObjectSource de = new InnerObjectSource(new NoAnnotationSource("BB", "123321"));
    DestinyInnerObject para = copier.from(de).doCopy();

    assertEquals("BB", para.getObject().getFirst());
  }
예제 #2
0
  @Test
  public void testParseComObjetosDeInnerEParaOuter() {

    InnerObjectMultipleObjectFieldsToFields de =
        new InnerObjectMultipleObjectFieldsToFields(new NoAnnotationSource("BB", "123321"));
    Destiny para = copier.from(de).doCopy();
    assertEquals("BB", para.getFirst());
    assertEquals("123321", para.getSecond());
  }
예제 #3
0
  @Test
  public void testParseComObjetosInnerEVariosAtributos() {

    InnerObjectMultipleObjectFieldsToObjectFields de =
        new InnerObjectMultipleObjectFieldsToObjectFields(new NoAnnotationSource("BB", "123321"));
    DestinyInnerObject para = copier.from(de).doCopy();
    assertEquals("BB", para.getObject().getFirst());
    assertEquals("123321", para.getObject().getSecond());
  }
예제 #4
0
  @Test
  public void testParseComObjetosParaInnerEDeOuter() {

    InnerObjectMultipleFieldsToObjectFields de =
        new InnerObjectMultipleFieldsToObjectFields("BB", "123321");
    DestinyInnerObject para = copier.from(de).doCopy();
    assertEquals("BB", para.getObject().getFirst());
    assertEquals("123321", para.getObject().getSecond());
  }
예제 #5
0
  @Test
  public void testParseAtributosComAnnotacaoParaPreenchido() {

    InvertedFieldsSource de = new InvertedFieldsSource("BB", "123321", "M");
    Destiny para = copier.from(de).doCopy();

    assertEquals("123321", para.getFirst());
    assertEquals("BB", para.getSecond());
    assertEquals(null, para.getOther());
  }
예제 #6
0
  @Test
  public void testParseAtributosComAnnotacaoDefault() {

    FieldAnnotationSource de = new FieldAnnotationSource("BB", "123321", "M");
    Destiny para = copier.from(de).doCopy();

    assertEquals("BB", para.getFirst());
    assertEquals("123321", para.getSecond());
    assertEquals(null, para.getOther());
  }
예제 #7
0
  @Test
  public void testParseAtributosComMesmoNome() {

    ClassAnnotationSource de = new ClassAnnotationSource("BB", "123321", "M");
    Destiny para = copier.from(de).doCopy();

    assertEquals("BB", para.getFirst());
    assertEquals("123321", para.getSecond());
    assertEquals(null, para.getOther());
  }
예제 #8
0
  @Test
  public void testParseObjetoSimples() {

    ClassAnnotationSource de = new ClassAnnotationSource("BB", "123321", null);
    ClassAnnotationSource para = copier.from(de).doCopy(ClassAnnotationSource.class);

    assertEquals("BB", para.getFirst());
    assertEquals("123321", para.getSecond());
    assertEquals(null, para.getThird());
  }
예제 #9
0
 @Test(expected = RuntimeException.class)
 public void testParseSemAnnotacao() {
   copier.from(new NoAnnotationSource("BB", "123321")).doCopy();
 }
예제 #10
0
 @Test(expected = IllegalArgumentException.class)
 public void whenPassingNullToFromAnnotedObject() {
   copier.from(null);
 }