Package org.dozer.vo.set

Examples of org.dozer.vo.set.NamesSet


  public void testNullSet() {
    NamesArray namesArray = new NamesArray();
    String[] arr = new String[] {null, "two"};
    namesArray.setNames(arr);
   
    NamesSet namesSet = mapper.map(namesArray, NamesSet.class, "null-set");

    assertEquals(2, namesSet.getNames().size());
    assertTrue(namesSet.getNames().contains(arr[0]));
    assertTrue(namesSet.getNames().contains(arr[1]));
  }
View Full Code Here


    assertEquals(names.size(), to.getNames().length);
  }

  @Test
  public void testSetToSortedSet() {
    NamesSet from = newInstance(NamesSet.class);
    NamesSortedSet to = null;
    Set<String> names = newInstance(HashSet.class);

    names.add("Red");
    names.add("Blue");
    names.add("Green");
    from.setNames(names);

    to = mapper.map(from, NamesSortedSet.class);

    assertNotNull(to);
    assertEquals(names.size(), to.getNames().size());
View Full Code Here

  }

  @Test
  public void testSortedSetToSet() {
    NamesSortedSet from = newInstance(NamesSortedSet.class);
    NamesSet to = null;
    SortedSet<String> names = newInstance(TreeSet.class);

    names.add("Bone");
    names.add("White");
    names.add("Beige");
    names.add("Ivory");
    names.add("Cream");
    names.add("Off white");
    from.setNames(names);

    to = mapper.map(from, NamesSet.class);

    assertNotNull(to);
    assertEquals(names.size(), to.getNames().size());
  }
View Full Code Here

    assertEquals(names.size(), to.getNames().length);
  }

  @Test
  public void testSetToSortedSet() {
    NamesSet from = newInstance(NamesSet.class);
    NamesSortedSet to = null;
    Set<String> names = newInstance(HashSet.class);

    names.add("Red");
    names.add("Blue");
    names.add("Green");
    from.setNames(names);

    to = mapper.map(from, NamesSortedSet.class);

    assertNotNull(to);
    assertEquals(names.size(), to.getNames().size());
View Full Code Here

  }

  @Test
  public void testSortedSetToSet() {
    NamesSortedSet from = newInstance(NamesSortedSet.class);
    NamesSet to = null;
    SortedSet<String> names = newInstance(TreeSet.class);

    names.add("Bone");
    names.add("White");
    names.add("Beige");
    names.add("Ivory");
    names.add("Cream");
    names.add("Off white");
    from.setNames(names);

    to = mapper.map(from, NamesSet.class);

    assertNotNull(to);
    assertEquals(names.size(), to.getNames().size());
  }
View Full Code Here

  public void testNullSet() {
    NamesArray namesArray = new NamesArray();
    String[] arr = new String[] {null, "two"};
    namesArray.setNames(arr);
   
    NamesSet namesSet = mapper.map(namesArray, NamesSet.class, "null-set");

    assertEquals(2, namesSet.getNames().size());
    assertTrue(namesSet.getNames().contains(arr[0]));
    assertTrue(namesSet.getNames().contains(arr[1]));
  }
View Full Code Here

TOP

Related Classes of org.dozer.vo.set.NamesSet

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.