MCPcopy Index your code
hub / github.com/ccxt/ccxt / testProxies

Method testProxies

java/tests/src/main/java/tests/exchange/TestMain.java:958–996  ·  view source on GitHub ↗
(Exchange exchange)

Source from the content-addressed store, hash-verified

956 }
957
958 public java.util.concurrent.CompletableFuture<Object> testProxies(Exchange exchange)
959 {
960
961 return java.util.concurrent.CompletableFuture.supplyAsync(() -> {
962
963 // these tests should be synchronously executed, because of conflicting nature of proxy settings
964 Object proxyTestName = this.proxyTestFileName;
965 // todo: temporary skip for sync py
966 if (Helpers.isTrue(Helpers.isTrue(Helpers.isEqual(this.ext, "py")) && Helpers.isTrue(isSync())))
967 {
968 return true;
969 }
970 // try proxy several times
971 Object maxRetries = 3;
972 Object exception = null;
973 for (var j = 0; Helpers.isLessThan(j, maxRetries); j++)
974 {
975 try
976 {
977 (this.testMethod(proxyTestName, exchange, new java.util.ArrayList<Object>(java.util.Arrays.asList()), true)).join();
978 return true; // if successfull, then end the test
979 } catch(Exception e)
980 {
981 exception = e;
982 (exchange.sleep(Helpers.multiply(j, 1000))).join();
983 }
984 }
985 // if exception was set, then throw it
986 if (Helpers.isTrue(!Helpers.isEqual(exception, null)))
987 {
988 Object errorMessage = Helpers.add(Helpers.add(Helpers.add("[TEST_FAILURE] Failed ", proxyTestName), " : "), exceptionMessage(exception));
989 // temporary comment the below, because c# transpilation failure
990 // throw new Exchange Error (errorMessage.toString ());
991 dump(Helpers.add("[TEST_WARNING]", errorMessage));
992 }
993 return true;
994 });
995
996 }
997
998 public void checkConstructor(Exchange exchange)
999 {

Callers

nothing calls this directly

Calls 10

isTrueMethod · 0.95
isEqualMethod · 0.95
isLessThanMethod · 0.95
testMethodMethod · 0.95
multiplyMethod · 0.95
addMethod · 0.95
isSyncMethod · 0.80
sleepMethod · 0.45
exceptionMessageMethod · 0.45
dumpMethod · 0.45

Tested by

no test coverage detected