Package de.linwave.tutorial

Examples of de.linwave.tutorial.Pilot


    assertNotNull(db);
    db.deleteClass(Pilot.class);
  }
 
  public void testStoreFirstPilot() {
    Pilot pilot1 = new Pilot("Michael Schumacher", 100);
    Long oid1 = db.store(pilot1);
    Pilot pilot2 = new Pilot("Rubens Barrichello", 99);
    Long oid2 = db.store(pilot2);

    assertTrue(oid1 != 0);
    assertTrue(oid2 != 0);
    assertTrue(oid2 > oid1);
View Full Code Here


    Long diff = new Long(oid2)-1;
    assertEquals(oid1, diff);
  }

  public void testRetrieveAllPilotQBE() {
    Pilot proto = new Pilot(null, 0);
    ObjectSet<Pilot> result = db.queryByExample(proto);
    assertEquals(2, result.size());
  }
View Full Code Here

    ObjectSet<Pilot> result = db.queryByExample(Pilot.class);
    assertEquals(2, result.size());
  }

  public void testRetrievePilotByName() {
    Pilot proto = new Pilot("Michael Schumacher", 0);
    ObjectSet<Pilot> result = db.queryByExample(proto);
    assertEquals(1, result.size());
  }
View Full Code Here

    ObjectSet<Pilot> result = db.queryByExample(proto);
    assertEquals(1, result.size());
  }

  public void testRetrievePilotByExactPoints() {
    Pilot proto = new Pilot(null, 100);
    ObjectSet<Pilot> result = db.queryByExample(proto);
    assertEquals(1, result.size());
  }
View Full Code Here

    ObjectSet<Pilot> result = db.queryByExample(proto);
    assertEquals(1, result.size());
  }

  public void testUpdatePilot() {
    ObjectSet<Pilot> result = db.queryByExample(new Pilot("Michael Schumacher", 0));
    Pilot found = (Pilot) result.next();
    found.addPoints(11);
    int newPoints = found.getPoints();
    db.store(found);
    System.out.println("Added 11 points for " + found);
    testRetrieveAllPilots();
   
    result = db.queryByExample(new Pilot("Michael Schumacher", newPoints));
    found = (Pilot) result.next();
    assertNotNull(found);
    assertEquals(newPoints, found.getPoints());
  }
View Full Code Here

    assertNotNull(found);
    assertEquals(newPoints, found.getPoints());
  }

  public void testDeleteFirstPilotByName() {
    ObjectSet<Pilot> result = db.queryByExample(new Pilot("Michael Schumacher", 0));
    Pilot found = (Pilot) result.next();
    db.delete(found);
    System.out.println("Deleted " + found);
    result = db.queryByExample(Pilot.class);
    assertEquals(1, result.size());
  }
View Full Code Here

    result = db.queryByExample(Pilot.class);
    assertEquals(1, result.size());
  }

  public void testDeleteSecondPilotByName() {
    ObjectSet<Pilot> result = db.queryByExample(new Pilot("Rubens Barrichello", 0));
    Pilot found = (Pilot) result.next();
    db.delete(found);
    System.out.println("Deleted " + found);
    result = db.queryByExample(Pilot.class);
    assertEquals(0, result.size());
  }
View Full Code Here

TOP

Related Classes of de.linwave.tutorial.Pilot

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.