Package org.openstreetmap.josm.data

Examples of org.openstreetmap.josm.data.APIDataSet


        r2.setDeleted(true);
        r3.setDeleted(true);
        r4.setDeleted(true);


        APIDataSet apiDataSet = new APIDataSet();
        // add r1 first to test functionality of APIDataSet#adjustRelationUploadOrder()
        apiDataSet.getPrimitivesToDelete().add(r1);
        apiDataSet.getPrimitivesToDelete().add(r2);
        apiDataSet.getPrimitivesToDelete().add(r3);
        apiDataSet.getPrimitivesToDelete().add(r4);
        try {
            apiDataSet.adjustRelationUploadOrder();
        } catch(CyclicUploadDependencyException e) {
            fail("unexpected exception:" + e);
        }
        List<OsmPrimitive> toDelete = apiDataSet.getPrimitivesToDelete();

        assertEquals(4, toDelete.size());
        assertEquals(true, toDelete.indexOf(r2) < toDelete.indexOf(r1));
        assertEquals(true, toDelete.indexOf(r3) < toDelete.indexOf(r1));
    }
View Full Code Here


        r1.setDeleted(true);
        way.setDeleted(true);
        n1.setDeleted(true);
        n2.setDeleted(true);

        APIDataSet apiDataSet = new APIDataSet();
        apiDataSet.init(ds);
        try {
            apiDataSet.adjustRelationUploadOrder();
        } catch (CyclicUploadDependencyException e) {
            fail("unexpected exception:" + e);
        }
        List<OsmPrimitive> toDelete = apiDataSet.getPrimitivesToDelete();

        assertEquals(4, toDelete.size());
        assertEquals(true, toDelete.indexOf(way) < toDelete.indexOf(n1));
        assertEquals(true, toDelete.indexOf(way) < toDelete.indexOf(n2));
        assertEquals(true, toDelete.indexOf(r1) < toDelete.indexOf(way));
View Full Code Here

        r1.addMember(new RelationMember("", r2));
        r2.addMember(new RelationMember("", r3));
        r3.addMember(new RelationMember("", r1));

        APIDataSet apiDataSet = new APIDataSet();
        apiDataSet.init(ds);
        try {
            apiDataSet.adjustRelationUploadOrder();
            fail("expected cyclic upload dependency exception not thrown");
        } catch(CyclicUploadDependencyException e) {
            System.out.println(e);
        }
    }
View Full Code Here

TOP

Related Classes of org.openstreetmap.josm.data.APIDataSet

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.