mercredi 8 novembre 2017

Java reflection run test from classes in directory

I have an assignment which is supposed to teach the basics in GUI + Reflection. The program is supposed to run a test for a class and output if it succeeded or failed (How that looks is irrelevant). I'm currently using this to get the Class using reflection:

this.testClass = Class.forName(testClassName);

The issue is that the classes has to be within the project for it to function. Therefore I have to re-compile the program each time I want to run some other type of class that tests. What I need is to find out how to get the class dynamically with it being in a compiled version (.class) in same directory as the JAR file.

Thanks





Aucun commentaire:

Enregistrer un commentaire