Package org.dozer.vo.map

Examples of org.dozer.vo.map.MapToMap


    Map<String, TestObject> map2 = newInstance(HashMap.class);
    map2.put("to", to);
    map2.put("to2", to2);

    MapToMap mtm = new MapToMap(map, map2);

    MapToMapPrime mtmp = mapper.map(mtm, MapToMapPrime.class);
    assertEquals("one", ((TestObject) mtmp.getStandardMap().get("to")).getOne());
    assertEquals(2, ((TestObject) mtmp.getStandardMap().get("to2")).getTwo().intValue());
    // verify that we transformed from object to object prime
View Full Code Here


    TestObject to2 = newInstance(TestObject.class);
    to2.setTwo(new Integer(2));
    Map<String, TestObject> map = newInstance(HashMap.class);
    map.put("to", to);
    map.put("to2", to2);
    MapToMap mtm = newInstance(MapToMap.class);
    mtm.setStandardMap(map);

    // create an existing map and set a value so we can test if it exists after
    // mapping
    MapToMapPrime mtmp = newInstance(MapToMapPrime.class);
    Map<String, Serializable> map2 = newInstance(Hashtable.class);
View Full Code Here

  }

  @Ignore("failing for some reason.  was commented out")
  @Test
  public void testMapWithNullEntries_WithoutHints() {
    MapToMap source = newInstance(MapToMap.class);
    HashMap<String, Object> map = newInstance(HashMap.class);
    map.put("A", Boolean.TRUE);
    map.put("B", null);
    source.setStandardMap(map);
    MapToMapPrime destination = newInstance(MapToMapPrime.class);
    HashMap<String, Object> hashMap = newInstance(HashMap.class);
    hashMap.put("C", Boolean.TRUE);
    destination.setStandardMap(hashMap);
View Full Code Here

    assertNull(resultingMap.get("B"));
  }

  @Test
  public void testMapWithNullEntries_NullPointer() {
    MapToMap source = newInstance(MapToMap.class);
    HashMap<String, TestObject> map = newInstance(HashMap.class);
    map.put("A", null);
    source.setStandardMap(map);

    MapToMapPrime destination = newInstance(MapToMapPrime.class);
    HashMap<String, Serializable> map2 = newInstance(HashMap.class);
    map2.put("B", Boolean.TRUE);
    destination.setStandardMap(map2);
View Full Code Here

    assertEquals(Boolean.TRUE, resultingMap.get("B"));
  }

  @Test
  public void testMapNullEntry_MultipleEntries() {
    MapToMap source = newInstance(MapToMap.class);
    HashMap<String, Boolean> map = newInstance(HashMap.class);
    map.put("A", null);
    map.put("B", null);
    map.put("C", null);
    source.setStandardMap(map);

    MapToMapPrime destination = newInstance(MapToMapPrime.class);
    HashMap<String, Serializable> map2 = newInstance(HashMap.class);
    destination.setStandardMap(map2);
View Full Code Here

    assertNull(resultingMap.get("C"));
  }

  @Test
  public void testMapMapWithList_Simple() {
    MapToMap source = newInstance(MapToMap.class);
    HashMap<String, List> map = newInstance(HashMap.class);
    ArrayList<Boolean> list = new ArrayList<Boolean>();
    list.add(Boolean.TRUE);
    map.put("A", list);
    source.setStandardMap(map);

    MapToMapPrime destination = mapper.map(source, MapToMapPrime.class);

    Map<String, List> resultingMap = destination.getStandardMap();
View Full Code Here

    Map<String, TestObject> map2 = newInstance(HashMap.class);
    map2.put("to", to);
    map2.put("to2", to2);

    MapToMap mtm = new MapToMap(map, map2);

    MapToMapPrime mtmp = mapper.map(mtm, MapToMapPrime.class);
    assertEquals("one", ((TestObject) mtmp.getStandardMap().get("to")).getOne());
    assertEquals(2, ((TestObject) mtmp.getStandardMap().get("to2")).getTwo().intValue());
    // verify that we transformed from object to object prime
View Full Code Here

    TestObject to2 = newInstance(TestObject.class);
    to2.setTwo(new Integer(2));
    Map<String, TestObject> map = newInstance(HashMap.class);
    map.put("to", to);
    map.put("to2", to2);
    MapToMap mtm = newInstance(MapToMap.class);
    mtm.setStandardMap(map);

    // create an existing map and set a value so we can test if it exists after
    // mapping
    MapToMapPrime mtmp = newInstance(MapToMapPrime.class);
    Map<String, Serializable> map2 = newInstance(Hashtable.class);
View Full Code Here

  }

  @Ignore("failing for some reason.  was commented out")
  @Test
  public void testMapWithNullEntries_WithoutHints() {
    MapToMap source = newInstance(MapToMap.class);
    HashMap<String, Object> map = newInstance(HashMap.class);
    map.put("A", Boolean.TRUE);
    map.put("B", null);
    source.setStandardMap(map);
    MapToMapPrime destination = newInstance(MapToMapPrime.class);
    HashMap<String, Object> hashMap = newInstance(HashMap.class);
    hashMap.put("C", Boolean.TRUE);
    destination.setStandardMap(hashMap);
View Full Code Here

    assertNull(resultingMap.get("B"));
  }

  @Test
  public void testMapWithNullEntries_NullPointer() {
    MapToMap source = newInstance(MapToMap.class);
    HashMap<String, TestObject> map = newInstance(HashMap.class);
    map.put("A", null);
    source.setStandardMap(map);

    MapToMapPrime destination = newInstance(MapToMapPrime.class);
    HashMap<String, Serializable> map2 = newInstance(HashMap.class);
    map2.put("B", Boolean.TRUE);
    destination.setStandardMap(map2);
View Full Code Here

TOP

Related Classes of org.dozer.vo.map.MapToMap

Copyright © 2018 www.massapicom. 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.