Examples of NestedObj


Examples of org.dozer.vo.map.NestedObj

  @Test
  public void testMapToVo() throws Exception {
    // Test simple Map --> Vo with custom mappings defined.
    mapper = getMapper(new String[] { "mapMapping2.xml" });

    NestedObj nestedObj = newInstance(NestedObj.class);
    nestedObj.setField1("nestedfield1value");
    Map<String, Serializable> src = newInstance(HashMap.class);
    src.put("field1", "mapnestedfield1value");
    src.put("nested", nestedObj);

    SimpleObjPrime result = mapper.map(src, SimpleObjPrime.class, "caseA");
    assertEquals(src.get("field1"), result.getField1());
    assertEquals(nestedObj.getField1(), result.getNested().getField1());
  }
View Full Code Here

Examples of org.dozer.vo.map.NestedObj

    SimpleObj src = newInstance(SimpleObj.class);

    src.setField1("field1");

    NestedObj nested = newInstance(NestedObj.class);
    nested.setField1("nestedfield1");
    src.setNested(nested);

    Map<String, String> nested2 = newInstance(HashMap.class);
    nested2.put("field1", "field1MapValue");
    src.setNested2(nested2);
View Full Code Here

Examples of org.dozer.vo.map.NestedObj

  }

  @Test
  public void testMapToVo_NoCustomMappings() throws Exception {
    // Test simple Map --> Vo without any custom mappings defined.
    NestedObj nestedObj = newInstance(NestedObj.class);
    nestedObj.setField1("nestedfield1value");
    Map<String, Serializable> src = newInstance(HashMap.class);
    src.put("field1", "mapnestedfield1value");
    src.put("nested", nestedObj);

    SimpleObjPrime result = mapper.map(src, SimpleObjPrime.class);
    assertEquals(src.get("field1"), result.getField1());
    assertEquals(nestedObj.getField1(), result.getNested().getField1());
  }
View Full Code Here

Examples of org.dozer.vo.map.NestedObj

  @Test
  public void testMapType_MapToVo_CustomMapping_NoMapId() {
    // Test nested Map --> Vo using custom mappings without map-id
    mapper = getMapper("mapMapping3.xml");

    NestedObj nested = newInstance(NestedObj.class);
    nested.setField1("field1Value");

    Map<String, String> nested2 = newInstance(HashMap.class);
    nested2.put("field1", "mapnestedfield1value");
    nested2.put("field2", "mapnestedfield2value");
View Full Code Here

Examples of org.dozer.vo.map.NestedObj

  @Test
  public void testMapToVo() throws Exception {
    // Test simple Map --> Vo with custom mappings defined.
    mapper = getMapper(new String[] { "mapMapping2.xml" });

    NestedObj nestedObj = newInstance(NestedObj.class);
    nestedObj.setField1("nestedfield1value");
    Map<String, Serializable> src = newInstance(HashMap.class);
    src.put("field1", "mapnestedfield1value");
    src.put("nested", nestedObj);

    SimpleObjPrime result = mapper.map(src, SimpleObjPrime.class, "caseA");
    assertEquals(src.get("field1"), result.getField1());
    assertEquals(nestedObj.getField1(), result.getNested().getField1());
  }
View Full Code Here

Examples of org.dozer.vo.map.NestedObj

  @Test
  public void testMapToVoSimple() throws Exception {
    mapper = getMapper(new String[] { });

    NestedObj nestedObj = newInstance(NestedObj.class);
    nestedObj.setField1("nestedfield1value");
    Map<String, Serializable> src = newInstance(HashMap.class);
    src.put("field1", "mapnestedfield1value");

    SimpleObjPrime result = mapper.map(src, SimpleObjPrime.class);
    assertEquals(src.get("field1"), result.getField1());
View Full Code Here

Examples of org.dozer.vo.map.NestedObj

  @Test
  public void testMapToVoWithRenameField() throws Exception {
    // Test simple Map --> Vo with custom mappings defined.
    mapper = getMapper(new String[] { "mapMapping2.xml" });

    NestedObj nestedObj = newInstance(NestedObj.class);
    nestedObj.setField1("nestedfield1value");
    Map<String, Object> src = new HashMap<String, Object>();
    src.put("first", "mapnestedfield1value");
    src.put("nested", nestedObj);

    SimpleObjPrime result = mapper.map(src, SimpleObjPrime.class, "caseC");
    assertEquals(src.get("first"), result.getField1());
    assertEquals(nestedObj.getField1(), result.getNested().getField1());
  }
View Full Code Here

Examples of org.dozer.vo.map.NestedObj

  @Test
  public void testMapToVoWithRenameFieldReverse() throws Exception {
    // Test simple Map --> Vo with custom mappings defined.
    mapper = getMapper(new String[] { "mapMapping2.xml" });

    NestedObj nestedObj = newInstance(NestedObj.class);
    nestedObj.setField1("nestedfield1value");
    Map<String, Object> src = new HashMap<String, Object>();
    src.put("first", "mapnestedfield1value");
    src.put("nested", nestedObj);

    SimpleObjPrime result = mapper.map(src, SimpleObjPrime.class, "caseD");
    assertEquals(src.get("first"), result.getField1());
    assertEquals(nestedObj.getField1(), result.getNested().getField1());
  }
View Full Code Here

Examples of org.dozer.vo.map.NestedObj

    SimpleObj src = newInstance(SimpleObj.class);

    src.setField1("field1");

    NestedObj nested = newInstance(NestedObj.class);
    nested.setField1("nestedfield1");
    src.setNested(nested);

    Map<String, String> nested2 = newInstance(HashMap.class);
    nested2.put("field1", "field1MapValue");
    src.setNested2(nested2);
View Full Code Here

Examples of org.dozer.vo.map.NestedObj

  }

  @Test
  public void testMapToVo_NoCustomMappings() throws Exception {
    // Test simple Map --> Vo without any custom mappings defined.
    NestedObj nestedObj = newInstance(NestedObj.class);
    nestedObj.setField1("nestedfield1value");
    Map<String, Serializable> src = newInstance(HashMap.class);
    src.put("field1", "mapnestedfield1value");
    src.put("nested", nestedObj);

    SimpleObjPrime result = mapper.map(src, SimpleObjPrime.class);
    assertEquals(src.get("field1"), result.getField1());
    assertEquals(nestedObj.getField1(), result.getNested().getField1());
  }
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.