Beispiel #1
0
 @Override
 public void move() {
   long starttime = System.currentTimeMillis();
   System.out.println("move before");
   car.move();
   long endtime = System.currentTimeMillis();
   System.out.println("move after" + (endtime - starttime));
 }
Beispiel #2
0
 @Override
 void move() {
   System.out.println("car starting");
   long starttime = System.currentTimeMillis();
   car.move();
   long endtime = System.currentTimeMillis();
   System.out.println("car stopping, time: " + (endtime - starttime) + "ms");
 }
Beispiel #3
0
  /** Test method for {@link xapn.projects.tdd.car.v2.Car#move(Position)}. */
  @Test(timeout = 100)
  public void testMove() {
    LOGGER.debug("TEST: testMove");

    // Setup
    car.getGps().setCurrentPosition(new Position(-6, -2));
    Position destination = new Position(5, 7);

    // Process
    car.move(destination);

    // Verification
    // The car reached the destination.
    assertEquals(destination, car.getGps().getCurrentPosition());
    // The car is stopped.
    assertEquals(0, car.getEngine().getSpeed());

    EasyMock.verify(roadMapMock);
  }
 public void move() {
   System.out.print("Driving a family car ... ");
   super.move();
 }