Package siena.base.test.model

Examples of siena.base.test.model.PersonUUID


import siena.sdb.SdbPersistenceManager;

public abstract class BaseTestNoAutoInc_1_CRUD extends BaseTestNoAutoInc_BASE {
 
  public void testInsertUUID() {
    PersonUUID maxwell = new PersonUUID();
    maxwell.firstName = "James Clerk";
    maxwell.lastName = "Maxwell";
    maxwell.city = "Edinburgh";
    maxwell.n = 4;
View Full Code Here


    assertEquals(maxwell, people.get(3));
  }
 
 
  public void testGetUUID() {
    PersonUUID curie = getPersonUUID(UUID_CURIE.id);
    assertEquals(UUID_CURIE, curie);
  }
View Full Code Here

    PersonStringID curie = getPersonStringID(StringID_CURIE.id);
    assertEquals(StringID_CURIE, curie);
  }
 
  public void testUpdateUUID() {
    PersonUUID curie = getPersonUUID(UUID_CURIE.id);
    curie.lastName = "Sklodowska–Curie";
    pm.update(curie);
    PersonUUID curie2 = getPersonUUID(UUID_CURIE.id);
    assertEquals(curie2, curie);
  }
View Full Code Here

      fail();
    }
  }
 
  public void testDeleteUUID() {
    PersonUUID curie = getPersonUUID(UUID_CURIE.id);
    pm.delete(curie);
   
    List<PersonUUID> people = queryPersonUUIDOrderBy("n", 0, false).fetch();
    assertNotNull(people);
    assertEquals(2, people.size());
View Full Code Here

    }
     
  }
 
  public void testSaveUUID() {
    PersonUUID maxwell = new PersonUUID();
    maxwell.firstName = "James Clerk";
    maxwell.lastName = "Maxwell";
    maxwell.city = "Edinburgh";
    maxwell.n = 4;
View Full Code Here

    assertEquals(l.get(0).id, people.get(2).id);
  }
 
 
  public void testFilterOperatorEqualString() {
    PersonUUID person = pm.createQuery(PersonUUID.class).filter("firstName", "Albert").get();
    assertNotNull(person);
    assertEquals(UUID_EINSTEIN, person);
  }
View Full Code Here

    assertNotNull(person);
    assertEquals(UUID_EINSTEIN, person);
  }
 
  public void testFilterOperatorEqualInt() {
    PersonUUID person = pm.createQuery(PersonUUID.class).filter("n", 3).get();
    assertNotNull(person);
    assertEquals(UUID_EINSTEIN, person);
  }
View Full Code Here

  }
 
  public void testFilterOperatorEqualUUID() {
    List<PersonUUID> l = getOrderedPersonUUIDs();
 
    PersonUUID person = pm.createQuery(PersonUUID.class).filter("id", l.get(0).id).get();
    assertNotNull(person);
    assertEquals(l.get(0), person);
  }
View Full Code Here

    assertNull(pm.createQuery(PersonUUID.class).filter("firstName", "John").get());
  }
 
  public void testDeleteObjectNotFound() {
    try {
      PersonUUID p = new PersonUUID();
      pm.delete(p);
      fail();
    } catch(Exception e) {
      System.out.println("Everything is OK");
    }
View Full Code Here

   
    return l;
  }
 
  private PersonUUID getPersonUUID(String id) {
    PersonUUID p = new PersonUUID();
    p.id = id;
    pm.get(p).get();
    return p;
  }
View Full Code Here

TOP

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

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.