Package at.fhj.itm.model

Examples of at.fhj.itm.model.Location


    public void testInsert() throws DAOException
    {
  // Configure mock object
  UserDAO mock = createMock(UserDAO.class);
  Connection mockConnection = createMock(Connection.class);
  Location location = new Location(1234, "Unit City");
  User p = new User("Unit", "Test", "UnitTest", "1234", "Unit@Test.com",
    "123456", location, new Date(), UUID.randomUUID().toString()
      .replace("-", ""));
  mock.update(p,mockConnection);
  replay(mock);
View Full Code Here


  List<Trip> mockTrips;
  User mockUser;

  @Before
  public void setup() {
    Location a = new Location(8605, "Kapfenberg");
    Location b = new Location(8010, "Graz");
    Location c = new Location(1020, "Wien");
    Location d = new Location(5030, "Salzburg");

    User u = new User(-1, "Bert", "Beutel", "bertBeut", "12345",
        "bert.beutel@local.at", "004312345678", a, new Date(),
        "qweiurioewhu");
View Full Code Here

 
  @Test
  public void testInsertDelete()
  {
    int count = dao.selectAll(connection).size();
    Location location = new Location(1234, "Unit City");
    User user = new User("Unit", "Test", "UnitTest", "1234", "Unit@Test.com", "123456",
        location, new Date(), UUID.randomUUID().toString().replace("-", ""));
    dao.update(user,connection);
    int newCount = dao.selectAll(connection).size();
    assertTrue(newCount > count);
View Full Code Here

   *
   * @throws Exception
   */
  @Before
  public void setUp() throws Exception {
        mockLocation = new Location(8605, "Kapfenberg");
    mockUser = new User("Hannes", "Lauser", "hlauser", "password", "lauser@aon.at", "+436641234567", this.mockLocation, null, "");
    mockUserDao = EasyMock.createMock(UserDAO.class);
    mockDataSource = EasyMock.createMock(DataSource.class);
    mockConnection = EasyMock.createMock(Connection.class);
    mockJsfUtil = EasyMock.createMock(JsfUtil.class);
View Full Code Here

  private User mockUser;
  private Location mockLocation;

  @Before
  public void setUp() {
        this.mockLocation = new Location(8605, "Kapfenberg");
    this.mockUser = new User("Hannes", "Lauser", "hlauser", "halauser", "lauser@aon.at", "+436641234567", this.mockLocation, null, "");
    mockServiceUser = EasyMock.createMock(ServiceUser.class);
    mockJsfUtil = EasyMock.createMock(JsfUtil.class);

    ServiceAssembler serviceAssembler = new ServiceAssembler() {
View Full Code Here

     * @throws Exception
     */
    @Before
    public void setUp() throws Exception
    {
  mockLocation = new Location(8605, "Kapfenberg");
  mockUser = new User("Hannes", "Lauser", "hlauser", "password",
    "lauser@aon.at", "+436641234567", this.mockLocation, null, "");
  mockUserDao = EasyMock.createMock(UserDAO.class);
  mockDataSource = EasyMock.createMock(DataSource.class);
  mockConnection = EasyMock.createMock(Connection.class);
View Full Code Here

    int to_location = set.getInt("to_location");
    int user_id = set.getInt("user_id");
    String comment = set.getString("comment");
    boolean active = set.getBoolean("active");

    Location fromLocation = this.locationDAO.getByID(from_location,connection);
    Location toLocation = this.locationDAO.getByID(to_location, connection);
    User user = this.userDAO.getByID(user_id, connection);

    return new Waypoint(id, fromLocation, toLocation, user, comment, active);
  }
View Full Code Here

    } catch (ParseException e) {
//      throw new IllegalArgumentException("Cannot parse the date!", e);
      return "insertFailed";
    }

    Location fromLocation = new Location(fromZip, fromCity);
    Location toLocation = new Location(toZip, toCity);
    Location stopLocation = new Location(this.stopZip, this.stopCity);

    try {
      getServiceTrip().insertTrip(departure, getSeats(), fromLocation,
          toLocation, stopLocation);
    } catch (ServiceException e) {
View Full Code Here

      throws SQLException {
    int id = set.getInt("id");
    int zip = set.getInt("zip");
    String city = set.getString("city");

    return new Location(id, zip, city);

  }
View Full Code Here

      List<Location> locations = new ArrayList<Location>();
      PreparedStatement stmt = connection.prepareStatement(SELECT_ALL);
      ResultSet set = stmt.executeQuery();

      while (set.next()) {
        Location curLocation = getLocationFromResultSet(set);
        locations.add(curLocation);
      }

      set.close();
      stmt.close();
View Full Code Here

TOP

Related Classes of at.fhj.itm.model.Location

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.