Changeset 14092 in josm for trunk/test/unit/org/openstreetmap/josm/data/osm
- Timestamp:
- 2018-08-05T20:53:19+02:00 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/data/osm/QuadBucketsTest.java
r13765 r14092 1 1 // License: GPL. For details, see LICENSE file. 2 2 package org.openstreetmap.josm.data.osm; 3 4 import static org.openstreetmap.josm.TestUtils.getPrivateField; 3 5 4 6 import java.io.FileInputStream; … … 12 14 import java.util.Random; 13 15 14 import org.fest.reflect.core.Reflection;15 import org.fest.reflect.reference.TypeRef;16 16 import org.junit.Assert; 17 17 import org.junit.Rule; … … 38 38 public JOSMTestRules test = new JOSMTestRules(); 39 39 40 private void removeAllTest(DataSet ds) { 40 @SuppressWarnings("unchecked") 41 private void removeAllTest(DataSet ds) throws ReflectiveOperationException { 41 42 List<Node> allNodes = new ArrayList<>(ds.getNodes()); 42 43 List<Way> allWays = new ArrayList<>(ds.getWays()); 43 44 List<Relation> allRelations = new ArrayList<>(ds.getRelations()); 44 45 45 QuadBucketPrimitiveStore<Node, Way, Relation> s = Reflection.field("store").ofType( 46 new TypeRef<QuadBucketPrimitiveStore<Node, Way, Relation>>() {}).in(ds).get(); 47 QuadBuckets<Node> nodes = Reflection.field("nodes").ofType(new TypeRef<QuadBuckets<Node>>() {}).in(s).get(); 48 QuadBuckets<Way> ways = Reflection.field("ways").ofType(new TypeRef<QuadBuckets<Way>>() {}).in(s).get(); 49 Collection<Relation> relations = Reflection.field("relations").ofType(new TypeRef<Collection<Relation>>() {}).in(s).get(); 46 QuadBucketPrimitiveStore<Node, Way, Relation> s = (QuadBucketPrimitiveStore<Node, Way, Relation>) getPrivateField(ds, "store"); 47 QuadBuckets<Node> nodes = (QuadBuckets<Node>) getPrivateField(s, "nodes"); 48 QuadBuckets<Way> ways = (QuadBuckets<Way>) getPrivateField(s, "ways"); 49 Collection<Relation> relations = (Collection<Relation>) getPrivateField(s, "relations"); 50 50 51 51 int expectedCount = allNodes.size(); … … 77 77 } 78 78 79 /** 80 * Test that all primitives can be removed from the Quad Buckets. 81 * @throws Exception never 82 */ 79 83 @Test 80 84 public void testRemove() throws Exception { … … 86 90 } 87 91 92 /** 93 * Test that all primitives can be removed from the Quad Buckets, even if moved before. 94 * @throws Exception never 95 */ 88 96 @Test 89 97 public void testMove() throws Exception {
Note:
See TracChangeset
for help on using the changeset viewer.