src/testCommon/java/de/blau/android/OscTestCommon.java
/**
     * Check that the data is in the state we think it should be
     * 
     * @param delegator the StorageDelegator
     */
Check that the data is in the state we think it should be

@param delegator the StorageDelegator
Check that the data is in the state we think it should be @param delegator the StorageDelegator
public static void checkInitialState(@NonNull StorageDelegator delegator) {
        Assert.assertNotNull(delegator.getOsmElement(Way.NAME, 210558043L));
        Assert.assertNotNull(delegator.getOsmElement(Node.NAME, 2206392996L));
        Assert.assertNotNull(delegator.getOsmElement(Node.NAME, 2206392994L));
        Assert.assertNotNull(delegator.getOsmElement(Node.NAME, 2206392992L));
        Assert.assertNotNull(delegator.getOsmElement(Node.NAME, 2206392993L));
        Assert.assertNotNull(delegator.getOsmElement(Node.NAME, 2206392996L));
        Way w = (Way) delegator.getOsmElement(Way.NAME, 210558045L);
        Assert.assertNotNull(w);
        Assert.assertEquals(OsmElement.STATE_UNCHANGED, w.getState());
        Assert.assertTrue(w.hasTag("addr:housenumber", "4"));
        Node n = (Node) delegator.getOsmElement(Node.NAME, 416426220L);
        Assert.assertNotNull(n);
        Assert.assertEquals(OsmElement.STATE_UNCHANGED, n.getState());
        System.out.println("Lat " + n.getLat()); 
        Assert.assertEquals(47.3898033D, n.getLat() / 1E7D, 0.00000001);
        Assert.assertEquals(8.3888382D, n.getLon() / 1E7D, 0.00000001);
        Relation r = (Relation) delegator.getOsmElement(Relation.NAME, 1638705L);
        Assert.assertEquals(OsmElement.STATE_UNCHANGED, r.getState());
        Assert.assertNotNull(r.getMember(Way.NAME, 119104094L));
        Way w2 = (Way) delegator.getOsmElement(Way.NAME, 119104094L);
        Assert.assertNotNull(w2);
        Assert.assertTrue(w2.getParentRelations().contains(r));
    }
public static void checkInitialState ( @ NonNull StorageDelegator delegator ) { Assert . assertNotNull ( delegator . getOsmElement ( Way . NAME , 210558043L ) ) ; Assert . assertNotNull ( delegator . getOsmElement ( Node . NAME , 2206392996L ) ) ; Assert . assertNotNull ( delegator . getOsmElement ( Node . NAME , 2206392994L ) ) ; Assert . assertNotNull ( delegator . getOsmElement ( Node . NAME , 2206392992L ) ) ; Assert . assertNotNull ( delegator . getOsmElement ( Node . NAME , 2206392993L ) ) ; Assert . assertNotNull ( delegator . getOsmElement ( Node . NAME , 2206392996L ) ) ; Way w = ( Way ) delegator . getOsmElement ( Way . NAME , 210558045L ) ; Assert . assertNotNull ( w ) ; Assert . assertEquals ( OsmElement . STATE_UNCHANGED , w . getState ( ) ) ; Assert . assertTrue ( w . hasTag ( "addr:housenumber" , "4" ) ) ; Node n = ( Node ) delegator . getOsmElement ( Node . NAME , 416426220L ) ; Assert . assertNotNull ( n ) ; Assert . assertEquals ( OsmElement . STATE_UNCHANGED , n . getState ( ) ) ; System . out . println ( "Lat " + n . getLat ( ) ) ; Assert . assertEquals ( 47.3898033D , n . getLat ( ) / 1E7D , 0.00000001 ) ; Assert . assertEquals ( 8.3888382D , n . getLon ( ) / 1E7D , 0.00000001 ) ; Relation r = ( Relation ) delegator . getOsmElement ( Relation . NAME , 1638705L ) ; Assert . assertEquals ( OsmElement . STATE_UNCHANGED , r . getState ( ) ) ; Assert . assertNotNull ( r . getMember ( Way . NAME , 119104094L ) ) ; Way w2 = ( Way ) delegator . getOsmElement ( Way . NAME , 119104094L ) ; Assert . assertNotNull ( w2 ) ; Assert . assertTrue ( w2 . getParentRelations ( ) . contains ( r ) ) ; }
Check that the data is in the state we think it should be
Check that the data is in the state we think it should be
// check initial data state // NOSONAR