From 43a240b8234d9244063d19357c90ff5e419678f8 Mon Sep 17 00:00:00 2001 From: GoldenGnu Date: Sun, 27 Oct 2024 02:37:16 +0200 Subject: [PATCH] Code: Minor changes to tests --- .../io/online/PriceDataGetterOnlineTest.java | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/test/java/net/nikr/eve/jeveasset/io/online/PriceDataGetterOnlineTest.java b/src/test/java/net/nikr/eve/jeveasset/io/online/PriceDataGetterOnlineTest.java index 46f2c51e0..9d6b3c7ce 100644 --- a/src/test/java/net/nikr/eve/jeveasset/io/online/PriceDataGetterOnlineTest.java +++ b/src/test/java/net/nikr/eve/jeveasset/io/online/PriceDataGetterOnlineTest.java @@ -61,7 +61,7 @@ public class PriceDataGetterOnlineTest extends TestUtil { private static final long REGION_THE_FORGE = 10000002L; //The Forge (Jita region) private static final long SYSTEM_JITA = 30000142L; //Jita private static final long STATION_JITA_4_4 = 60003760L; //Jita 4 - 4 - private static final long MAX_RUNS = 5000; + private static final long MAX_RUNS = 500; private final PriceGetter getter = new PriceGetter(); private final Set typeIDs = new HashSet<>(); @@ -131,33 +131,33 @@ private void test(PriceSource source) { private void test(PriceSource source, LocationType locationType, NamedPriceLocation location) { TestPricingOptions options = new TestPricingOptions(locationType, location); - System.out.println(source.toString() + String msg = source.toString() + " (" + options.getLocationType().name().toLowerCase() + " - " + location.getLocation() - + " - " + typeIDs.size() + " IDs)" - ); + + " - " + typeIDs.size() + " IDs)"; + System.out.println(msg); if (source == PriceSource.JANICE && JANICE_KEY != null) { options.addHeader("X-ApiKey", JANICE_KEY); } long start = System.currentTimeMillis(); Map process = getter.process(options, typeIDs, source); long end = System.currentTimeMillis(); - assertNotNull(process); + assertNotNull(msg, process); Set failed = new TreeSet<>(typeIDs); failed.removeAll(process.keySet()); Set empty = new TreeSet<>(); for (Map.Entry entry : process.entrySet()) { - assertNotNull(entry.getValue()); + assertNotNull(msg, entry.getValue()); if (entry.getValue().isEmpty()) { empty.add(entry.getKey()); } } System.out.println(" " + process.size() + " of " + typeIDs.size() + " done - " + empty.size() + " empty - " + failed.size() + " failed - completed in: " + Formatter.milliseconds(end - start)); - assertTrue(failed.isEmpty()); - assertTrue(process.size() >= typeIDs.size()); + assertTrue(msg, failed.isEmpty()); + assertTrue(msg, process.size() >= typeIDs.size()); } private static class PriceGetter extends PriceDataGetter { @@ -214,7 +214,7 @@ public Proxy getProxy() { @Override public int getAttemptCount() { - return 2; + return 1; } @Override @@ -224,7 +224,7 @@ public boolean getUseBinaryErrorSearch() { @Override public int getTimeout() { - return 20000; + return 2000; } @Override