src/test/java/de/blau/android/osm/StorageDelegatorTest.java
/**
     * Replace a Node in Ways it is a member of
     */
Replace a Node in Ways it is a member of
Replace a Node in Ways it is a member of
@Test
    public void repplaceNodeInWays() {
        StorageDelegator d = new StorageDelegator();
        Way w = DelegatorUtil.addWayToStorage(d, false);
        Way temp = (Way) d.getOsmElement(Way.NAME, w.getOsmId());
        assertNotNull(temp);
        Node n = w.getNodes().get(2);
        d.splitAtNode(w, n);
        assertEquals(2, d.getCurrentStorage().getWays(n).size());
        Node newNode = d.replaceNode(n);
        assertEquals(2, d.getCurrentStorage().getWays(newNode).size());
        assertEquals(0, d.getCurrentStorage().getWays(n).size());
    }
@ Test public void repplaceNodeInWays ( ) { StorageDelegator d = new StorageDelegator ( ) ; Way w = DelegatorUtil . addWayToStorage ( d , false ) ; Way temp = ( Way ) d . getOsmElement ( Way . NAME , w . getOsmId ( ) ) ; assertNotNull ( temp ) ; Node n = w . getNodes ( ) . get ( 2 ) ; d . splitAtNode ( w , n ) ; assertEquals ( 2 , d . getCurrentStorage ( ) . getWays ( n ) . size ( ) ) ; Node newNode = d . replaceNode ( n ) ; assertEquals ( 2 , d . getCurrentStorage ( ) . getWays ( newNode ) . size ( ) ) ; assertEquals ( 0 , d . getCurrentStorage ( ) . getWays ( n ) . size ( ) ) ; }
Replace a Node in Ways it is a member of
Replace a Node in Ways it is a member of