diff --git a/build.gradle b/build.gradle index aea99de4ca..2cc1c8a674 100644 --- a/build.gradle +++ b/build.gradle @@ -65,7 +65,7 @@ subprojects { archiveClassifier = 'javadoc' } test { - //exclude '**/CypherProceduresClusterTest.class'//, '**/AtomicTest.class' + include '**/GeocodeTest.class'//, '**/AtomicTest.class' // neo4jDockerImage system property is used in TestContainerUtil systemProperties 'user.language' : 'en' , diff --git a/core/src/test/java/apoc/spatial/GeocodeTest.java b/core/src/test/java/apoc/spatial/GeocodeTest.java index 715df80432..b044e1386e 100755 --- a/core/src/test/java/apoc/spatial/GeocodeTest.java +++ b/core/src/test/java/apoc/spatial/GeocodeTest.java @@ -64,11 +64,15 @@ public void initDb() throws Exception { // -- with config map @Test public void testWrongUrlButViaOtherProvider() throws Exception { + for (int i = 0; i < 20; i++) { + System.out.println("i = " + i); // wrong url but doesn't fail because provider is osm, not opencage - testGeocodeWithThrottling("osm", false, + testGeocodeWithThrottling("osm", false, map("url", "https://api.opencagedata.com/geocode/v1/json?q=PLACE&key=KEY111")); + + } } - + @Test(expected = QueryExecutionException.class) public void testWrongUrlWithOpenCage() throws Exception { // overwrite ApocConfig provider @@ -108,7 +112,7 @@ public void testGeocodeWithBlockedAddressWithApocConf() { assertGeocodeAllowedUrl(true); }); } - + @Test public void testGeocodeWithBlockedAddressWithConfigMap() { Stream.of("https", "http", "ftp").forEach(protocol -> { @@ -176,7 +180,10 @@ private void assertGeocodeFails(boolean reverseGeocode, String expectedMsgError, @Test public void testGeocodeOSM() throws Exception { + for (int i = 0; i < 20; i++) { testGeocodeWithThrottling("osm", false); + + } } @Test @@ -189,7 +196,9 @@ private void testGeocodeWithThrottling(String supplier, Boolean reverseGeocode) } private void testGeocodeWithThrottling(String supplier, Boolean reverseGeocode, Map config) throws Exception { + System.out.println("GeocodeTest.testGeocodeWithThrottling"); long fast = testGeocode(supplier, 100, reverseGeocode, config); + System.out.println("fast done..."); long slow = testGeocode(supplier, 2000, reverseGeocode, config); assertTrue("Fast " + supplier + " took " + fast + "ms and slow took " + slow + "ms, but expected slow to be at least twice as long", (1.0 * slow / fast) > 1.2); } @@ -339,7 +348,9 @@ private void waitForServerResponseOK(String query, Map params, A return null; }); - time.addAndGet( System.currentTimeMillis() - start ); + long delta = System.currentTimeMillis() - start; + System.out.println("delta = " + delta); + time.set(delta); return true; } catch (Exception e) { String msg = e.getMessage();