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

Method getTestFilesHelper

java/tests/src/main/java/tests/BaseTest.java:708–736  ·  view source on GitHub ↗
(Object properties, boolean ws)

Source from the content-addressed store, hash-verified

706
707
708 public static Map<String, Object> getTestFilesHelper(Object properties, boolean ws) {
709 // Accept either List<?> or any Collection<?>; otherwise treat as empty.
710 final List<String> keys = new ArrayList<>();
711
712 if (properties instanceof Collection<?> c) {
713 for (Object o : c) {
714 if (o != null) keys.add(String.valueOf(o));
715 }
716 }
717
718 keys.add("features");
719
720 final String basePackage = ws ? "tests.exchange.ws" : "tests.exchange";
721 final Map<String, Object> testClasses = new HashMap<>();
722
723 for (String key : keys) {
724 if (key == null || key.isBlank()) continue;
725
726 // "fetchTicker" -> "TestFetchTicker"
727 String className = basePackage + ".Test" + capitalizeFirst(key);
728
729 Class<?> clazz = tryLoadClass(className);
730 if (clazz != null) {
731 testClasses.put(key, clazz);
732 }
733 }
734
735 return testClasses;
736 }
737
738 private static String capitalizeFirst(String s) {
739 if (s == null || s.isEmpty()) return s;

Callers 1

getTestFilesMethod · 0.95

Calls 3

capitalizeFirstMethod · 0.95
tryLoadClassMethod · 0.95
addMethod · 0.45

Tested by

no test coverage detected