I use Javassist to create a class. And in a test suite, when a second test tries to create the same class, it fails at pool.makeClass( ... )
because the class is fr
I get the same problem, i solved it this way, may be cannot apply for your test case:
Make CtClass a private static variable of your Class.
Create a method that check's if CtClass is already built. If CtClass is not built, call the method that builds it, else, return that CtClass.
Make that all your test use the new method.
So, if you have N Test, just the first one will attempt to Built the CtClass, the rest of them will have the static CtClass Variable.