Closed farhan5248 closed 8 months ago
I don't think I need to load the class in this method, just get the list of them. If I'm not loading the class, I won't need the IOException
public Set<Class> findAllClassesUsingGoogleGuice(String packageName) throws IOException {
return ClassPath.from(ClassLoader.getSystemClassLoader()).getAllClasses().stream()
.filter(testObj-> testObj.getPackageName().equalsIgnoreCase(packageName)).map(testObj-> testObj.load())
.collect(Collectors.toSet());
}
Set<Class> classes = findAllClassesUsingGoogleGuice("org.farhan.tests.validating");
First make all the common GraphTestObject and GraphTestObjectFactory consistent across the 3 projects. Then given an interface name and package name, it should find the interface. Then it should find any class in the same package that implements that interface.