Vincent Massol wrote:
I'd like to propose a change of implementation for Cactus 1.6. I'd like
to serialize test case classes on the client side and pass them to the
server side, instead of recreating the test case class on the server
side.

Benefits? This will allow several new use cases, such as parametrized
tests. Imagine the follow test case:

public class MyTest extends TestCase
{
  private int someData;

  MyTest(int data)
  {
    super("testParamData");
    this.someData = data;
  }

  public static Test suite()
  {
    TestSuite suite = new TestSuite();
    suite.addTest(new MyTest(10));
    suite.addTest(new MyTest(20));
    return ServletTestSuite(suite);
  }
}

This will not work with the current Cactus.

What do you think?

This looks like a good idea IMHO. We would also no longer need to explicitly pass the test class and method names if using serialization, right?


However, the test cases will need to implement Serializable, so the whole thing is not totally transparent. We can mark the ServletTestCase, FilterTestCase and JspTestCase as serializable, but user provided normal JUnit test cases that are executed in the context of a ServletTestSuite would need to be made serializable by the user (i.e., the above example is lacking the "implements Serializable"). It might be good to keep the current behaviour as a fallback if the test case is not serializable.

In addition, this would require JUnit 3.8, because previous versions do not provide a parameter-less constructor for the TestCase class. But I'm +1 to require JUnit 3.8+ in Cactus 1.6.

--
Christopher Lenz
/=/ cmlenz at gmx.de


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to