src/androidTest/java/de/blau/android/gpx/GpxTest.java
/**
     * Open the current position info dialog and create a Node at the current position
     */
Open the current position info dialog and create a Node at the current position
Open the current position info dialog and create a Node at the current position
@Test
    public void createNodeAtLocation() {
        ExtendedLocation loc = new ExtendedLocation(LocationManager.GPS_PROVIDER);
        final double lat = 47.3978982D;
        final double lon = 8.3762937D;
        loc.setLatitude(lat);
        loc.setLongitude(lon);
        loc.setAltitude(600);
        loc.setBarometricHeight(555);
        loc.setGeoidCorrection(48);
        loc.setGeoidHeight(552);
        loc.setHdop(2.0);
        main.getTracker().updateLocation(loc);
        main.invalidateOptionsMenu();
        clickGpsButton(device);
        assertTrue(TestUtils.clickText(device, false, "Current position info", true, false));
        assertTrue(TestUtils.findText(device, false, Double.toString(lat)));
        assertTrue(TestUtils.findText(device, false, Double.toString(lon)));
        assertTrue(TestUtils.clickText(device, false, "New Node", true, false));
        assertTrue(TestUtils.findText(device, false, "Node selected"));
        Node n = App.getLogic().getSelectedNode();
        assertNotNull(n);
        assertEquals(lat, n.getLat() / 1E7D, 0.000001);
        assertEquals(lon, n.getLon() / 1E7D, 0.000001);
    }
@ Test public void createNodeAtLocation ( ) { ExtendedLocation loc = new ExtendedLocation ( LocationManager . GPS_PROVIDER ) ; final double lat = 47.3978982D ; final double lon = 8.3762937D ; loc . setLatitude ( lat ) ; loc . setLongitude ( lon ) ; loc . setAltitude ( 600 ) ; loc . setBarometricHeight ( 555 ) ; loc . setGeoidCorrection ( 48 ) ; loc . setGeoidHeight ( 552 ) ; loc . setHdop ( 2.0 ) ; main . getTracker ( ) . updateLocation ( loc ) ; main . invalidateOptionsMenu ( ) ; clickGpsButton ( device ) ; assertTrue ( TestUtils . clickText ( device , false , "Current position info" , true , false ) ) ; assertTrue ( TestUtils . findText ( device , false , Double . toString ( lat ) ) ) ; assertTrue ( TestUtils . findText ( device , false , Double . toString ( lon ) ) ) ; assertTrue ( TestUtils . clickText ( device , false , "New Node" , true , false ) ) ; assertTrue ( TestUtils . findText ( device , false , "Node selected" ) ) ; Node n = App . getLogic ( ) . getSelectedNode ( ) ; assertNotNull ( n ) ; assertEquals ( lat , n . getLat ( ) / 1E7D , 0.000001 ) ; assertEquals ( lon , n . getLon ( ) / 1E7D , 0.000001 ) ; }
Open the current position info dialog and create a Node at the current position
Open the current position info dialog and create a Node at the current position