Changeset 11324 in josm for trunk/test/functional
 Timestamp:
 20161127T05:16:30+01:00 (3 years ago)
 Location:
 trunk/test/functional/org/openstreetmap/josm/io
 Files:

 2 edited
Legend:
 Unmodified
 Added
 Removed

trunk/test/functional/org/openstreetmap/josm/io/MultiFetchServerObjectReaderTest.java
r10937 r11324 15 15 import java.io.PrintWriter; 16 16 import java.nio.charset.StandardCharsets; 17 import java.security.SecureRandom; 17 18 import java.text.MessageFormat; 18 19 import java.util.ArrayList; 19 20 import java.util.Locale; 21 import java.util.Random; 20 22 import java.util.logging.Logger; 21 23 … … 39 41 import org.openstreetmap.josm.gui.progress.NullProgressMonitor; 40 42 43 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; 44 41 45 /** 42 46 * Unit tests of {@link MultiFetchServerObjectReader}. 43 47 */ 48 @SuppressFBWarnings(value = "CRLF_INJECTION_LOGS") 44 49 public class MultiFetchServerObjectReaderTest { 45 50 private static Logger logger = Logger.getLogger(MultiFetchServerObjectReader.class.getName()); … … 59 64 DataSet ds = new DataSet(); 60 65 ds.setVersion("0.6"); 66 Random rand = new SecureRandom(); 61 67 62 68 int numNodes = 1000; … … 81 87 for (int i = 0; i < numWays; i++) { 82 88 Way w = new Way(); 83 int numNodesInWay = 2 + (int) Math.round( Math.random() * 5);84 int start = (int) Math.round( Math.random() * numNodes);89 int numNodesInWay = 2 + (int) Math.round(rand.nextDouble() * 5); 90 int start = (int) Math.round(rand.nextDouble() * numNodes); 85 91 for (int j = 0; j < numNodesInWay; j++) { 86 92 int idx = (start + j) % numNodes; … … 98 104 Relation r = new Relation(); 99 105 r.put("name", "relation" +i); 100 int numNodesInRelation = (int) Math.round( Math.random() * 10);101 int start = (int) Math.round( Math.random() * numNodes);106 int numNodesInRelation = (int) Math.round(rand.nextDouble() * 10); 107 int start = (int) Math.round(rand.nextDouble() * numNodes); 102 108 for (int j = 0; j < numNodesInRelation; j++) { 103 109 int idx = (start + j) % 500; … … 105 111 r.addMember(new RelationMember("role" + j, n)); 106 112 } 107 int numWaysInRelation = (int) Math.round( Math.random() * 10);108 start = (int) Math.round( Math.random() * numWays);113 int numWaysInRelation = (int) Math.round(rand.nextDouble() * 10); 114 start = (int) Math.round(rand.nextDouble() * numWays); 109 115 for (int j = 0; j < numWaysInRelation; j++) { 110 116 int idx = (start + j) % 500; 
trunk/test/functional/org/openstreetmap/josm/io/OsmServerBackreferenceReaderTest.java
r11060 r11324 44 44 import org.openstreetmap.josm.tools.Logging; 45 45 46 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; 47 46 48 /** 47 49 * Reads primitives referring to a particular primitive (ways including a node, relations referring to a relation) 48 50 * @since 1806 49 51 */ 52 @SuppressFBWarnings(value = "CRLF_INJECTION_LOGS") 50 53 public class OsmServerBackreferenceReaderTest { 51 54 private static final Logger logger = Logger.getLogger(OsmServerBackreferenceReader.class.getName());
Note: See TracChangeset
for help on using the changeset viewer.