src/androidTest/java/de/blau/android/osm/ReadPbfTest.java
/**
     * Read a PBF file and do some superficial checks that it was successfully read
     */
Read a PBF file and do some superficial checks that it was successfully read
Read a PBF file and do some superficial checks that it was successfully read
@Test
    public void pbfRead() {
        StorageDelegator delegator = App.getDelegator();
        App.getLogic().performAddNode(main, 8.3874640 * 1E7D, 47.3906515 * 1E7D); 
        assertTrue(TestUtils.clickMenuButton(device, main.getString(R.string.menu_transfer), false, false));
        assertTrue(TestUtils.clickText(device, false, main.getString(R.string.menu_transfer_file), false, false));
        assertTrue(TestUtils.clickText(device, false, main.getString(R.string.menu_transfer_read_pbf_file), true, false));
        TestUtils.clickText(device, false, main.getString(R.string.unsaved_data_proceed), false, false);
        TestUtils.selectFile(device, main, null, PBF_FILE, true);
        TestUtils.findText(device, false, "Loading", 2000);  spinner appears
        TestUtils.textGone(device, "Loading", 60000); spinner goes away
        assertNotNull(delegator.getOsmElement(Relation.NAME, 1252853L));
        assertNotNull(delegator.getOsmElement(Way.NAME, 243055643L));
        Storage current = delegator.getCurrentStorage();
        assertEquals(3404, current.getNodes().size());
        assertEquals(391, current.getWays().size());
        assertEquals(76, current.getRelations().size());
    }
@ Test public void pbfRead ( ) { StorageDelegator delegator = App . getDelegator ( ) ; App . getLogic ( ) . performAddNode ( main , 8.3874640 * 1E7D , 47.3906515 * 1E7D ) ; assertTrue ( TestUtils . clickMenuButton ( device , main . getString ( R . string . menu_transfer ) , false , false ) ) ; assertTrue ( TestUtils . clickText ( device , false , main . getString ( R . string . menu_transfer_file ) , false , false ) ) ; assertTrue ( TestUtils . clickText ( device , false , main . getString ( R . string . menu_transfer_read_pbf_file ) , true , false ) ) ; TestUtils . clickText ( device , false , main . getString ( R . string . unsaved_data_proceed ) , false , false ) ; TestUtils . selectFile ( device , main , null , PBF_FILE , true ) ; TestUtils . findText ( device , false , "Loading" , 2000 ) ; TestUtils . textGone ( device , "Loading" , 60000 ) ; assertNotNull ( delegator . getOsmElement ( Relation . NAME , 1252853L ) ) ; assertNotNull ( delegator . getOsmElement ( Way . NAME , 243055643L ) ) ; Storage current = delegator . getCurrentStorage ( ) ; assertEquals ( 3404 , current . getNodes ( ) . size ( ) ) ; assertEquals ( 391 , current . getWays ( ) . size ( ) ) ; assertEquals ( 76 , current . getRelations ( ) . size ( ) ) ; }
Read a PBF file and do some superficial checks that it was successfully read
Read a PBF file and do some superficial checks that it was successfully read
// force menu // warning dialog // // spinner appears // spinner goes away