[jboss-dev-forums] [QA of JBoss Portal] - Re: Portlet Container test framework update

julien@jboss.com do-not-reply at jboss.com
Wed Nov 7 15:22:36 EST 2007


So finally I chosed an intermediary solution for now and I migrated all test cases to it. A test case looks like

@TestCase({Assertion.JSR168_ABC,Assertion.JSR168_XYZ})
  | public class MyTestCase
  | {
  |    public MyTestCase(PortletTest seq)
  |    {
  |       seq.addAction(0, MyPortlet.RENDER_JOINPOINT, new PortletRenderTestAction()
  |       {
  |          protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context)
  |          {
  |             // Code test case here
  |             return new EndTestResponse();
  |          }
  |       });
  |    }
  | }

So each test case is now in a single class and it reference (optionally) an Assertion which is an enum class containing all the test case meta data, here is an excerpt:

public enum Assertion
  | {
  | 
  |    JSR168_4(new TCK(4), "After the portlet object is instantiated, the portlet container must" +
  |       " initialize the portlet before invoking it to handle requests"),
  | 
  |    JSR168_31(new TCK(31), "", Status.jbossUntestable("why?")),
  | 
  |    JSR168_33(new TCK(33), "", Status.duplicate(JSR168_36, "")),
  | 
  |    JSR168_49(new TCK(49), "", Status.postponed("spec?")),
  | 
  | }

So each test case has a precise description in one single place which allow to easily make reporting and have a unified view.

I still need to do a couple of refactorings on it, basically cleaning up up the   joinpoint declaration mechanism.

Also finally I did not chose to have one method per joinpoint and I still use the same old model, but for now it seems enough as it can access the test case state.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4102673#4102673

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4102673



More information about the jboss-dev-forums mailing list