Dynamic Junit Test
As part of my study final project I have to make a J2EE application that allows users to run JUnit tests(without any experience what they have to do is to click and see the result), obviously开发者_如何学Go it must be some way to modify tests and create new ones (upload new test files ...) could you point me to the right technology which allows me to load and run tests on the fly?? thank you in advance for your help
you can take a look at implementation (sources) of Pax Exam OSGi testing tool (1). This tool generates OSGi bundles from JUnit tests on the fly and runs them inside test OSGi container. You can implement the same approach for J2EE.
Hope it helps you to analyze and make an estimate your project bounds.
Cheers, Dmytro
(1): http://wiki.ops4j.org/display/paxexam/Pax+Exam
You could create your own implementation of a JUnit test runner that has an option for dynamically loading test JARs and dependency JARs during runtime. Take a look at the JUnitCore
class and related classes in the JUnit APIs such as Result
. Also look into dynamic JAR loading.
JUnitCore:
http://kentbeck.github.com/junit/javadoc/latest/
Dynamic JAR loading:
How should I load Jars dynamically at runtime?
http://sourceforge.net/projects/jcloader/
精彩评论