This is the mail archive of the mailing list for the Mauve project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Discussing a helper class to migrate from JUnit

On Sunday 30 January 2005 16:58, Robert Schuster wrote:
> Hello Audrius,
> AFAIK a solution that allows JUnit tests being run as part of mauve is
> frequently discussed here but there was no result yet.
> Former discussions could IMHO not solve this problem:
> JUnit uses reflection and therefore depends on a stable support for this
> mechanism. Mauve as a framework for testing the basic functionality of a
> VM could therefore not depend on a working reflection API.
> Despite from that I like the idea of faking a JUnit environment to run
> such tests. However that environment should be created with only minimal
> dependency on the VM.
> My suggestion is that for each testcase TC you have to:
>        * scan the class file of TC with something like javap
>        * generate Java source code that calls the public methods of TC,
> call that an adapter class AC
>        * compile the AC
>        * run the mauve test via the AC

I had the same idea; let AC implement the right mauve-structures (the 
Testlet interface) and you will have a runnable test environment.
If javap is too big a dependency; then it is also possible to generate the 
AC class using reflection.  This means you have to write a class that gets 
a list of fully-qualified class-names and then uses reflection much like 
JUnit does.  Only instead of running the tests you write out a Testlet for 
that class.

This would fit nicely with a project I am (still) working on. I intend to 
create one jar file with all the mauve tests and anyone can then use that 
jar to execute each test on their own JVM.  This fits because I doubt we 
want the generated wrapper classes in CVS and I will surely compile/jar 
using the Sun JVM.

The biggest problem I see with this is that the mauve toolkit will only 
compile/run with JUnit in the classpath.  Perhaps some stubs can also be 
supplied to counter this problem.

As Robert said; many have stated that this is a good idea, but nobody really 
supplied any code to actually do it :)
Looking forward to any proof-of-concepts from you!!

Thomas Zander

Attachment: pgp00000.pgp
Description: PGP signature

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]