Package geodress.model

Examples of geodress.model.Coordinate


   * @throws Exception
   *             may cause an exception
   */
  @Test
  public void testValidCoordinates() throws Exception {
    coords = new Coordinate(30, 20);
    Assert.assertEquals((double) 30, coords.getLatitude());
    Assert.assertEquals((double) 20, coords.getLongitude());

    coords.setLatitude(60.8237);
    Assert.assertEquals(60.8237, coords.getLatitude());

    coords.setLongitude(-102.287);
    Assert.assertEquals(-102.287, coords.getLongitude());

    coords.setLatitude(-90);
    Assert.assertEquals((double) -90, coords.getLatitude());

    coords.setLongitude(180);
    Assert.assertEquals((double) 180, coords.getLongitude());

    coords = new Coordinate("-34.5342", "-78.2345");
    Assert.assertEquals(-34.5342, coords.getLatitude());
    Assert.assertEquals(-78.2345, coords.getLongitude());
  }
View Full Code Here


   * @throws Exception
   *             may cause an exception
   */
  @Test(expected = ParameterOutOfRangeException.class)
  public void testInvalidCoordinates1() throws Exception {
    coords = new Coordinate(43.3454, -98.2343);
    Assert.assertEquals(43.3454, coords.getLatitude());
    Assert.assertEquals(-98.2343, coords.getLongitude());

    coords.setLatitude(92.3452);
  }
View Full Code Here

   * @throws Exception
   *             may cause an exception
   */
  @Test
  public void testCoordinateString() throws Exception {
    coords = new Coordinate(48.86547, 2.32122);
    Assert.assertEquals("N 48° 51,928'", coords.getLatitudeAsString());
    Assert.assertEquals("E 002° 19,273'", coords.getLongitudeAsString());
    Assert.assertEquals("N 48° 51,928' E 002° 19,273'", coords.toString());

    coords.setLatitude(40.64552);
View Full Code Here

   * @throws Exception
   *             may cause an exception
   */
  @Test(expected = ParameterOutOfRangeException.class)
  public void testInvalidCoordinates2() throws Exception {
    coords = new Coordinate(43.3452, -197.2344);
  }
View Full Code Here

   * @throws Exception
   *             may cause an exception
   */
  @Test(expected = ParameterOutOfRangeException.class)
  public void testInvalidCoordinates3() throws Exception {
    coords = new Coordinate("foo", "-98.2342");
  }
View Full Code Here

   * @throws java.lang.Exception
   */
  @Before
  public void setUp() throws Exception {
    /* Berliner Straße 1, 13507 Berlin, Germany */
    testCoordinate1 = new Coordinate(52.589840, 13.283194);
    /* Place Charles-de-Gaulle, 75008 Paris, France */
    testCoordinate2 = new Coordinate(48.873901, 2.295899);
    /*
     * Cmte. Luis Piedrabuena 600-699, Río Grande, Tierra del Fuego,
     * Argentina
     */
    testCoordinate3 = new Coordinate(-53.784956, -67.703286);

    testReader = new GoogleMapsReader();
  }
View Full Code Here

TOP

Related Classes of geodress.model.Coordinate

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.