Package siena.base.test.model

Examples of siena.base.test.model.PersonStringID


    // TODO Auto-generated method stub
   
  }

  public void testInsertPersonStringID() {
    PersonStringID maxwell = new PersonStringID();
    maxwell.id = "MAXWELL";
    maxwell.firstName = "James Clerk";
    maxwell.lastName = "Maxwell";
    maxwell.city = "Edinburgh";
    maxwell.n = 4;

    pm.insert(maxwell);
    assertEquals(maxwell.id, "MAXWELL");
   
    PersonStringID maxwellbis = new PersonStringID();
    maxwellbis.id = "MAXWELL";
    pm.option(SdbPersistenceManager.CONSISTENT_READ).get(maxwellbis);
   
    assertEquals(maxwell, maxwellbis);
   
    maxwell.firstName = "James Clerk UPD";
    maxwell.lastName = "Maxwell UPD";
    maxwell.city = "Edinburgh UPD";
    maxwell.n = 5;
   
    pm.update(maxwell);

    maxwellbis = new PersonStringID();
    maxwellbis.id = "MAXWELL";
    pm.option(SdbPersistenceManager.CONSISTENT_READ).get(maxwellbis);
   
    assertEquals(maxwell, maxwellbis);
   
View Full Code Here


 
  public void testInsertPersonStringIDMultiple() {
    // INSERTS
    ArrayList<PersonStringID> l = new ArrayList<PersonStringID>();
    for(int i=0; i<10; i++){
      PersonStringID maxwell = new PersonStringID();
      maxwell.id = "MAXWELL"+i;
      maxwell.firstName = "James"+i;
      maxwell.lastName = "Maxwell"+i;
      maxwell.city = "Edinburgh"+i;
      maxwell.n = i;
      l.add(maxwell);
    }
   
    int nb = pm.insert(l);
    assertEquals(10, nb);
   
    // GETS
    ArrayList<PersonStringID> l2 = new ArrayList<PersonStringID>();
    for(int i=0; i<10; i++){
      PersonStringID maxwell = new PersonStringID();
      maxwell.id = "MAXWELL"+i;
      l2.add(maxwell);
    }
    nb = pm.option(SdbPersistenceManager.CONSISTENT_READ).get(l2);
    assertEquals(10, nb);

    for(int i=0; i<10; i++){
      assertEquals(l.get(i), l2.get(i));
    }
   
    // UPDATES
    for(int i=0; i<10; i++){
      PersonStringID maxwell = l.get(i);
      maxwell.firstName = "James UPD"+i;
      maxwell.lastName = "Maxwell UPD"+i;
      maxwell.city = "Edinburgh UPD"+i;
      maxwell.n = i+5;
    }
View Full Code Here

  public void testSavePersonStringIDMultiple() {
    // INSERTS
    ArrayList<PersonStringID> l = new ArrayList<PersonStringID>();
    for(int i=0; i<10; i++){
      PersonStringID maxwell = new PersonStringID();
      maxwell.id = "MAXWELL"+i;
      maxwell.firstName = "James"+i;
      maxwell.lastName = "Maxwell"+i;
      maxwell.city = "Edinburgh"+i;
      maxwell.n = i;
      l.add(maxwell);
    }
   
    int nb = pm.save(l);
    assertEquals(10, nb);
   
    // GETS
    ArrayList<PersonStringID> l2 = new ArrayList<PersonStringID>();
    for(int i=0; i<10; i++){
      PersonStringID maxwell = new PersonStringID();
      maxwell.id = "MAXWELL"+i;
      l2.add(maxwell);
    }
    nb = pm.option(SdbPersistenceManager.CONSISTENT_READ).get(l2);
    assertEquals(10, nb);

    for(int i=0; i<10; i++){
      assertEquals(l.get(i), l2.get(i));
    }
   
    // UPDATES
    for(int i=0; i<10; i++){
      PersonStringID maxwell = l.get(i);
      maxwell.firstName = "James UPD"+i;
      maxwell.lastName = "Maxwell UPD"+i;
      maxwell.city = "Edinburgh UPD"+i;
      maxwell.n = i+5;
    }
View Full Code Here

    assertEquals(0, nb);

  }
 
  public void testGetByKeyPersonStringID() {
    PersonStringID maxwell = new PersonStringID();
    maxwell.id = "MAXWELL";
    maxwell.firstName = "James Clerk";
    maxwell.lastName = "Maxwell";
    maxwell.city = "Edinburgh";
    maxwell.n = 4;

    pm.insert(maxwell);
    assertEquals(maxwell.id, "MAXWELL");
   
    PersonStringID maxwellbis = pm.option(SdbPersistenceManager.CONSISTENT_READ).getByKey(PersonStringID.class, maxwell.id);
   
    assertEquals(maxwell, maxwellbis);
   
    pm.delete(maxwell);
  }
View Full Code Here

 
  public void testGetByKeysPersonStringID() {
    // INSERTS
    ArrayList<PersonStringID> l = new ArrayList<PersonStringID>();
    for(int i=0; i<10; i++){
      PersonStringID maxwell = new PersonStringID();
      maxwell.id = "MAXWELL"+i;
      maxwell.firstName = "James"+i;
      maxwell.lastName = "Maxwell"+i;
      maxwell.city = "Edinburgh"+i;
      maxwell.n = i;
View Full Code Here

 
  public void testSimpleCountPersonStringID() {
    // INSERTS
    ArrayList<PersonStringID> l = new ArrayList<PersonStringID>();
    for(int i=0; i<10; i++){
      PersonStringID maxwell = new PersonStringID();
      maxwell.id = "MAXWELL"+i;
      maxwell.firstName = "James"+i;
      maxwell.lastName = "Maxwell"+i;
      maxwell.city = "Edinburgh"+i;
      maxwell.n = i;
View Full Code Here

 
  public void testSimpleCountFilterPersonStringID() {
    // INSERTS
    ArrayList<PersonStringID> l = new ArrayList<PersonStringID>();
    for(int i=0; i<10; i++){
      PersonStringID maxwell = new PersonStringID();
      maxwell.id = "MAXWELL"+i;
      maxwell.firstName = "James"+i;
      maxwell.lastName = "Maxwell"+i;
      maxwell.city = "Edinburgh"+i;
      maxwell.n = i;
View Full Code Here

  public void testQueryFetchPersonStringID() {
    // INSERTS
    ArrayList<PersonStringID> l = new ArrayList<PersonStringID>();
    for(int i=0; i<10; i++){
      PersonStringID maxwell = new PersonStringID();
      maxwell.id = "MAXWELL"+i;
      maxwell.firstName = "James"+i;
      maxwell.lastName = "Maxwell"+i;
      maxwell.city = "Edinburgh"+i;
      maxwell.n = i;
View Full Code Here

 
  public void testQueryFetchLimitPersonStringID() {
    // INSERTS
    ArrayList<PersonStringID> l = new ArrayList<PersonStringID>();
    for(int i=0; i<10; i++){
      PersonStringID maxwell = new PersonStringID();
      maxwell.id = "MAXWELL"+i;
      maxwell.firstName = "James"+i;
      maxwell.lastName = "Maxwell"+i;
      maxwell.city = "Edinburgh"+i;
      maxwell.n = i;
View Full Code Here

 
  public void testQueryFetchLimitOffsetPersonStringID() {
    // INSERTS
    ArrayList<PersonStringID> l = new ArrayList<PersonStringID>();
    for(int i=0; i<10; i++){
      PersonStringID maxwell = new PersonStringID();
      maxwell.id = "MAXWELL"+i;
      maxwell.firstName = "James"+i;
      maxwell.lastName = "Maxwell"+i;
      maxwell.city = "Edinburgh"+i;
      maxwell.n = i;
View Full Code Here

TOP

Related Classes of siena.base.test.model.PersonStringID

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.