Petals Junit Framework

Improve the test development

Details

  • Type: Improvement Request Improvement Request
  • Status: New New
  • Resolution: Unresolved
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Security Level: Public
  • Description:
    Hide

    Currently, the integration environement works as follows:

    • There are some configurations on OW2's forge.
    • There are other ones in the integration project.
    • Requests are defined in a custom XML file, in a distinct project.
    • Requests are all mixed together, and can target any service.

    This mechanism is interesting, but remains quite heavy.
    I think with few updates, we could make it easier to use.
    That would develop the reflex: one component feature <=> write the tests.

    Here is what I would suggest:

    • Do not use the OW2 configurations anymore (plus, with the wiki, they will be useless soon).
    • SU projects should have a specific test directory.
      • src/main/test for the usual Java unit tests.
      • src/main/petals-test to put requests to send to this SU.

    Basically, this last directory would contain XML files that would contain requests, attachment references, message properties, invocation way (simple or parallel), etc. to invoke this SU.
    It would also contain conditions about the response (fault/status/payload and possibly XPath assertions).

    Conventions:
    A set of request = 1 XML file.
    1 request / file = simple invocation, several ones = parallel invocations.
    1 file name = 1 test name. (That's for the copy-paste)

    This would require two additional things:

    • An editor in the studio, to easily write these requests. Automatically select the provides to invoke, generate a message skeleton (SoapUI-like), use pre-defined lists to make your choice...
    • An upgrade of the Petals Maven plug-in. Add a goal jbi-test that takes a configuration file (which Petals, which host...), deploys the SA and goes through all the requests and sends them to this SU.

    The algorithm to run the tests would be the following one:

    1. For each SA:
      1. Deploy the SA.
      2. For each SU:
        • For each test request :
          • Send the request.
          • Check the post-conditions.
      3. Undeploy the SA

    The integration project would then only contain the SA and SU projects, and maybe one configuration file to replace the launcher project.
    The biggest part is the Maven plug-in upgrade.
    About the test editor, I'm quite confident about it. It could be done by the first week of October.
    And this could be announced as a new feature for the end of the year, something that clients and customers could use as well.
    That's not the ultimate testing framework, but that would be a beginning for the grand public.

    And I have no doubt that will be very useful for the development first, and the support then (people could transmit their SU and SA projects for tests, used with mocks...). Once again, it's a first step that will have to be followed by others.

    Show
    Currently, the integration environement works as follows:
    • There are some configurations on OW2's forge.
    • There are other ones in the integration project.
    • Requests are defined in a custom XML file, in a distinct project.
    • Requests are all mixed together, and can target any service.
    This mechanism is interesting, but remains quite heavy. I think with few updates, we could make it easier to use. That would develop the reflex: one component feature <=> write the tests. Here is what I would suggest:
    • Do not use the OW2 configurations anymore (plus, with the wiki, they will be useless soon).
    • SU projects should have a specific test directory.
      • src/main/test for the usual Java unit tests.
      • src/main/petals-test to put requests to send to this SU.
    Basically, this last directory would contain XML files that would contain requests, attachment references, message properties, invocation way (simple or parallel), etc. to invoke this SU. It would also contain conditions about the response (fault/status/payload and possibly XPath assertions). Conventions: A set of request = 1 XML file. 1 request / file = simple invocation, several ones = parallel invocations. 1 file name = 1 test name. (That's for the copy-paste) This would require two additional things:
    • An editor in the studio, to easily write these requests. Automatically select the provides to invoke, generate a message skeleton (SoapUI-like), use pre-defined lists to make your choice...
    • An upgrade of the Petals Maven plug-in. Add a goal jbi-test that takes a configuration file (which Petals, which host...), deploys the SA and goes through all the requests and sends them to this SU.
    The algorithm to run the tests would be the following one:
    1. For each SA:
      1. Deploy the SA.
      2. For each SU:
        • For each test request :
          • Send the request.
          • Check the post-conditions.
      3. Undeploy the SA
    The integration project would then only contain the SA and SU projects, and maybe one configuration file to replace the launcher project. The biggest part is the Maven plug-in upgrade. About the test editor, I'm quite confident about it. It could be done by the first week of October. And this could be announced as a new feature for the end of the year, something that clients and customers could use as well. That's not the ultimate testing framework, but that would be a beginning for the grand public. And I have no doubt that will be very useful for the development first, and the support then (people could transmit their SU and SA projects for tests, used with mocks...). Once again, it's a first step that will have to be followed by others.
  • Environment:
    -

Activity

Hide
Roland Naudin added a comment - Thu, 23 Sep 2010 - 16:18:36 +0200

Hi,

Not bad ideas, but this is more a 2011 subject.

Around the subject integration, the deployment tool, the micro-kernel...

What you describe is to use the unexisting deployement tool at the integration phase of the maven build, with the Petals maven plugin.
The container used for these tests would be an unexisting 'inMemory' one, based on the unexisting 'micro-kernel'.

After thinking about that, this more a subject for 20xx!

Show
Roland Naudin added a comment - Thu, 23 Sep 2010 - 16:18:36 +0200 Hi, Not bad ideas, but this is more a 2011 subject. Around the subject integration, the deployment tool, the micro-kernel... What you describe is to use the unexisting deployement tool at the integration phase of the maven build, with the Petals maven plugin. The container used for these tests would be an unexisting 'inMemory' one, based on the unexisting 'micro-kernel'. After thinking about that, this more a subject for 20xx!
Hide
Vincent Zurczak added a comment - Thu, 23 Sep 2010 - 16:29:30 +0200

At least, there would be an easy first step: split the big XML file that contains all the requests.

  • Create an additional directory in SU projects (src/test/jbi).
  • Define a new kind of XML file (described by an XML schema).
  • Create an editor to edit these files.
  • Update the build mechanism to read these XML files instead of the big one.

Three of these 4 points would be for me.
And they could be done by the first week of October.
What about the last part?

The goal is definitely to ease the writing of tests for Petals components.
We'll keep the micro-kernel, the Maven plug-in upgrade, the definition of advanced scenarios, etc. for other iterations.

Show
Vincent Zurczak added a comment - Thu, 23 Sep 2010 - 16:29:30 +0200 At least, there would be an easy first step: split the big XML file that contains all the requests.
  • Create an additional directory in SU projects (src/test/jbi).
  • Define a new kind of XML file (described by an XML schema).
  • Create an editor to edit these files.
  • Update the build mechanism to read these XML files instead of the big one.
Three of these 4 points would be for me. And they could be done by the first week of October. What about the last part? The goal is definitely to ease the writing of tests for Petals components. We'll keep the micro-kernel, the Maven plug-in upgrade, the definition of advanced scenarios, etc. for other iterations.
Hide
Roland Naudin added a comment - Thu, 23 Sep 2010 - 16:43:24 +0200

What kind of XML file you want do define?
What structure?

Show
Roland Naudin added a comment - Thu, 23 Sep 2010 - 16:43:24 +0200 What kind of XML file you want do define? What structure?
Hide
Vincent Zurczak added a comment - Thu, 23 Sep 2010 - 16:53:13 +0200 - edited

Somehow, it would be very similar to the one used for the big XML file.
Except there would be only one request per file.

  • 1 file = 1 request
  • file name = test name
  • 1 description (to ease the maintenance by others)
  • Defines the service target, the payload, input attachments, synchronous/asynchronous invocation, the invocation MEP, the invoked operation, exchange properties, potentially the status to return then (InOut).
  • Defines the kind of response (fault, message, status), XPath conditions to check, or an exact XML message, validate the response against the WSDL of the service.

The XML schema by itself is quite simple.
What we would need then is something that allows us to write it in 2 minutes.
Then, use copy/paste and change minor things to test the component's limits.

All the tests within a SU project would target one of the provides of this SU project.

Show
Vincent Zurczak added a comment - Thu, 23 Sep 2010 - 16:53:13 +0200 - edited Somehow, it would be very similar to the one used for the big XML file. Except there would be only one request per file.
  • 1 file = 1 request
  • file name = test name
  • 1 description (to ease the maintenance by others)
  • Defines the service target, the payload, input attachments, synchronous/asynchronous invocation, the invocation MEP, the invoked operation, exchange properties, potentially the status to return then (InOut).
  • Defines the kind of response (fault, message, status), XPath conditions to check, or an exact XML message, validate the response against the WSDL of the service.
The XML schema by itself is quite simple. What we would need then is something that allows us to write it in 2 minutes. Then, use copy/paste and change minor things to test the component's limits. All the tests within a SU project would target one of the provides of this SU project.
Hide
Christophe DENEUX added a comment - Thu, 23 Sep 2010 - 17:33:17 +0200

I don't agree with the goal 'jbi-test', I think it's should be better to create a JUnit extension to run such testcases. So integrations with dev tools (Eclipse and Maven) are easier

Show
Christophe DENEUX added a comment - Thu, 23 Sep 2010 - 17:33:17 +0200 I don't agree with the goal 'jbi-test', I think it's should be better to create a JUnit extension to run such testcases. So integrations with dev tools (Eclipse and Maven) are easier
Hide
Vincent Zurczak added a comment - Thu, 23 Sep 2010 - 17:48:49 +0200

OK.

Show
Vincent Zurczak added a comment - Thu, 23 Sep 2010 - 17:48:49 +0200 OK.

People

Dates

  • Created:
    Fri, 17 Sep 2010 - 16:53:32 +0200
    Updated:
    Thu, 8 Oct 2015 - 16:37:59 +0200