예제 #1
0
  @Test
  public void testCreateEvent() throws Exception {

    Map<String, String> values = new HashMap<String, String>();
    values.put("bus_name", "Inter Cape");
    values.put("from_location", "Port elizabeth");
    values.put("to_location", "Cape town");
    values.put("departure_time", "8:00");
    values.put("arrival_time", "15:00");

    Bus bus = BusFactory.createBus(values);

    Assert.assertEquals("Inter Cape", bus.getbus_name());
  }
예제 #2
0
  @Test
  public void testUpadteEvent() throws Exception {

    Map<String, String> values = new HashMap<String, String>();
    values.put("bus_name", "Inter Cape");
    values.put("from_location", "Port elizabeth");
    values.put("to_location", "Cape town");
    values.put("departure_time", "8:00");
    values.put("arrival_time", "15:00");

    Bus bus = BusFactory.createBus(values);

    Bus bus1 = new Bus.Builder(bus.getbus_name()).copy(bus).build();
    // Assert.assertEquals("sport",event1.getEvent_type());
    // Assert.assertEquals("Rugby",event1.getEvent_name());

  }