Package org.monjo.example

Examples of org.monjo.example.ListWithin


        .getDefaultObjectConverter(ListWithin.class);
  }

  @Test
  public void shouldSaveElementWithStringList(){
    ListWithin pojo = new ListWithin();
    pojo.addName(42);
    pojo.addName(43);
   
    Monjo<ObjectId, ListWithin> monjo = new Monjo<ObjectId, ListWithin>(getMongoDB(), ListWithin.class);
    ObjectId objectId = monjo.save(pojo);
    ListWithin listWithin = monjo.findOne(objectId);
    List<String> strings = listWithin.getNames();
    Assert.assertTrue(strings.contains("42"));
    Assert.assertTrue(strings.contains("43"));
  }
View Full Code Here


    Assert.assertTrue(strings.contains("43"));
  }
 
  @Test
  public void shouldSaveElementWithIntegerList(){
    ListWithin pojo = new ListWithin();
    pojo.addGroup(10);
    pojo.addGroup(20);
   
    Monjo<ObjectId, ListWithin> monjo = new Monjo<ObjectId, ListWithin>(getMongoDB(), ListWithin.class);
    ObjectId objectId = monjo.save(pojo);
    ListWithin listWithin = monjo.findOne(objectId);
    List<Integer> integers = listWithin.getGroups();
    Assert.assertTrue(integers.contains(10));
    Assert.assertTrue(integers.contains(20));
  }
View Full Code Here

TOP

Related Classes of org.monjo.example.ListWithin

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.