Package ma.glasnost.orika

Examples of ma.glasnost.orika.MapperFacade.map()


        A source = new A();
        source.field1 = "one";
        source.field2 = "two";
       
        B dest = mapper.map(source, B.class);
       
        Assert.assertEquals(source.field1, dest.field1);
        Assert.assertEquals(source.field2, dest.field2);

        A1 source2 = new A1();
View Full Code Here


        A1 source2 = new A1();
        source2.field1 = "one";
        source2.field2 = "two";
        source2.field3 = "three";
       
        dest = mapper.map(source2, B.class);
       
        Assert.assertEquals(source2.field1, dest.field1);
        Assert.assertEquals(source2.field2, dest.field2);
        Assert.assertEquals(source2.field3, dest.field3);
       
View Full Code Here

        source2.field1 = "one";
        source2.field2 = "two";
        source2.field3 = "three";
       
      
        B dest = mapper.map(source2, B.class);
       
        Assert.assertEquals(source2.field1, dest.field1);
        Assert.assertEquals(source2.field2, dest.field2);
        Assert.assertEquals(source2.field3, dest.field3);
       
View Full Code Here

       
        A source = new A();
        source.field1 = "one";
        source.field2 = "two";
       
        dest = mapper.map(source, B.class);
       
        Assert.assertEquals(source.field1, dest.field1);
        Assert.assertEquals(source.field2, dest.field2);

    }
View Full Code Here

        v1List.add(v1);
        l1.setList(v1List);
        list.add(l1);
        r1.setList(list);
       
        final R2 r2 = facade.map(r1, R2.class);

    Assert.assertNotNull(r2);
    Assert.assertNotNull(r2.getList());
    for (L2 l2: r2.getList()) {
      Assert.assertNotNull(l2);
View Full Code Here

        String[] array = new String[2];
        array[0] = "one";
        array[1] = "two";
        s.setArray(array);
       
        Destination d = mapper.map(s, Destination.class);
       
        Source mapBack = mapper.map(d, Source.class);
       
        Assert.assertEquals(s, mapBack);
       
View Full Code Here

        array[1] = "two";
        s.setArray(array);
       
        Destination d = mapper.map(s, Destination.class);
       
        Source mapBack = mapper.map(d, Source.class);
       
        Assert.assertEquals(s, mapBack);
       
    }
   
View Full Code Here

        .byDefault().toClassMap());
    MapperFacade mapper = factory.getMapperFacade();
    Bean bean = new Bean();
    bean.setSize(20);
    bean.setName("Kidney");
    mapper.map(bean, Bean.class);

    /* If map pass no need to check */
  }

  public static class Bean {
View Full Code Here

    MapperFactory factory = MappingUtil.getMapperFactory();
    factory.getConverterFactory().registerConverter(new DateToCalendarConverter());
    MapperFacade mapper = factory.getMapperFacade();
   
    Date now = new Date();
    Calendar cal = mapper.map(now, Calendar.class);
    Assert.assertEquals(now, cal.getTime());
   
    Date reverse = mapper.map(cal, Date.class);
    Assert.assertEquals(now, reverse);
  }
View Full Code Here

   
    Date now = new Date();
    Calendar cal = mapper.map(now, Calendar.class);
    Assert.assertEquals(now, cal.getTime());
   
    Date reverse = mapper.map(cal, Date.class);
    Assert.assertEquals(now, reverse);
  }
 
  @Test
  public void testDateToXmlGregorianCalendarConverter() {
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.