Package siena.base.test.model

Examples of siena.base.test.model.PersonLongAutoID


    assertEquals(maxwell, people.get(3));
  }

  public void testInsertLongAutoID() {
    if(supportsAutoincrement()){
      PersonLongAutoID maxwell = new PersonLongAutoID();
      maxwell.firstName = "James Clerk";
      maxwell.lastName = "Maxwell";
      maxwell.city = "Edinburgh";
      maxwell.n = 4;
 
      pm.insert(maxwell);
      assertNotNull(maxwell.id);
 
      List<PersonLongAutoID> people = queryPersonLongAutoIDOrderBy("n", 0, false).fetch();
      assertEquals(4, people.size());
 
      assertEquals(LongAutoID_TESLA, people.get(0));
      assertEquals(LongAutoID_CURIE, people.get(1));
      assertEquals(LongAutoID_EINSTEIN, people.get(2));
      assertEquals(maxwell, people.get(3));
    }else {
      try {
        PersonLongAutoID maxwell = new PersonLongAutoID();
        maxwell.firstName = "James Clerk";
        maxwell.lastName = "Maxwell";
        maxwell.city = "Edinburgh";
        maxwell.n = 4;
   
View Full Code Here


    assertEquals(UUID_CURIE, curie);
  }

  public void testGetLongAutoID() {
    if(supportsAutoincrement()){
      PersonLongAutoID curie = getPersonLongAutoID(LongAutoID_CURIE.id);
      assertEquals(LongAutoID_CURIE, curie);
    }else {
      try {
        PersonLongAutoID curie = getPersonLongAutoID(LongAutoID_CURIE.id);
      }catch(SienaRestrictedApiException ex){
        return;
      }
      fail();
    }
View Full Code Here

    assertEquals(curie2, curie);
  }

  public void testUpdateLongAutoID() {
    if(supportsAutoincrement()){
      PersonLongAutoID curie = getPersonLongAutoID(LongAutoID_CURIE.id);
      curie.lastName = "Sklodowska–Curie";
      pm.update(curie);
      PersonLongAutoID curie2 = getPersonLongAutoID(LongAutoID_CURIE.id);
      assertEquals(curie2, curie);
    }else {
      try {
        PersonLongAutoID curie = getPersonLongAutoID(LongAutoID_CURIE.id);
      }catch(SienaRestrictedApiException ex){
        return;
      }
      fail();
    }
View Full Code Here

  }

 
  public void testSaveLongAutoID() {
    if(supportsAutoincrement()){
      PersonLongAutoID maxwell = new PersonLongAutoID();
      maxwell.firstName = "James Clerk";
      maxwell.lastName = "Maxwell";
      maxwell.city = "Edinburgh";
      maxwell.n = 4;
 
      pm.save(maxwell);
      assertNotNull(maxwell.id);
 
      List<PersonLongAutoID> people = queryPersonLongAutoIDOrderBy("n", 0, false).fetch();
      assertEquals(4, people.size());
 
      assertEquals(LongAutoID_TESLA, people.get(0));
      assertEquals(LongAutoID_CURIE, people.get(1));
      assertEquals(LongAutoID_EINSTEIN, people.get(2));
      assertEquals(maxwell, people.get(3));
     
      maxwell.firstName = "James Clerk UPD";
      maxwell.lastName = "Maxwell UPD";
      maxwell.city = "Edinburgh UPD";
      maxwell.n = 5;
     
      pm.save(maxwell);
      assertNotNull(maxwell.id);
     
      people = queryPersonLongAutoIDOrderBy("n", 0, false).fetch();
      assertEquals(4, people.size());
 
      assertEquals(LongAutoID_TESLA, people.get(0));
      assertEquals(LongAutoID_CURIE, people.get(1));
      assertEquals(LongAutoID_EINSTEIN, people.get(2));
      assertEquals(maxwell, people.get(3));
    }else {
      try {
        PersonLongAutoID maxwell = new PersonLongAutoID();
        maxwell.firstName = "James Clerk";
        maxwell.lastName = "Maxwell";
        maxwell.city = "Edinburgh";
        maxwell.n = 4;
   
View Full Code Here

    assertEquals(l.get(0), person);
  }
 
  public void testFilterOperatorEqualLongAutoID() {
    if(supportsAutoincrement()){
      PersonLongAutoID person = pm.createQuery(PersonLongAutoID.class).filter("id", LongAutoID_EINSTEIN.id).get();
      assertNotNull(person);
      assertEquals(LongAutoID_EINSTEIN, person);
    }else {
      try {
        PersonLongAutoID person = pm.createQuery(PersonLongAutoID.class).filter("id", LongAutoID_EINSTEIN.id).get();
      }catch(SienaRestrictedApiException ex){
        return;
      }
      fail();
    }
View Full Code Here

    assertNotNull(person);
    assertEquals(l.get(0), person);
  }
 
  public void testFilterOperatorEqualLongAutoID() {
    PersonLongAutoID person = pm.createQuery(PersonLongAutoID.class).filter("id", LongAutoID_EINSTEIN.id).get();
    assertNotNull(person);
    assertEquals(LongAutoID_EINSTEIN, person);
  }
View Full Code Here

    assertEquals(UUID_EINSTEIN, people.get(2));
    assertEquals(maxwell, people.get(3));
  }

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

    assertEquals(UUID_CURIE, curie);
  }

  public void testGetNonExisting() {
    try {
    PersonLongAutoID pers = getPersonLongAutoID(1234567L);
    }catch(SienaException e){
      return;
    }
   
    fail();
View Full Code Here

   
    fail();
  }
 
  public void testGetLongAutoID() {
    PersonLongAutoID curie = getPersonLongAutoID(LongAutoID_CURIE.id);
    assertEquals(LongAutoID_CURIE, curie);
  }
View Full Code Here

    PersonUUID curie2 = getPersonUUID(UUID_CURIE.id);
    assertEquals(curie2, curie);
  }

  public void testUpdateLongAutoID() {
    PersonLongAutoID curie = getPersonLongAutoID(LongAutoID_CURIE.id);
    curie.lastName = "Sklodowska–Curie";
    pm.update(curie);
    PersonLongAutoID curie2 = getPersonLongAutoID(LongAutoID_CURIE.id);
    assertEquals(curie2, curie);
  }
View Full Code Here

TOP

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

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.