Re: [PROPOSAL] Automate itests for WAR packaging

2008-02-10 Thread Luciano Resende
I have added automation support for the Websphere platform. The
automation uses some python scripts to integrate with WAS admin tools
and can start the server, deploy the iTest web application, undeploy
the application and stop the server. There are still two issues that
needs to be addressed :

1) Executing the unit tests are not working yet, and are throwing exceptions :
- Error 500:
com.ibm.ws.wswebcontainer.extension.DefaultExtensionProcessor
incompatible with com.ibm.wsspi.webcontainer.servlet.IServletWrapper

2) There are issues trying to run the automation from a folder other
then the iTest folder, as the ant scripts reference the ant scripts
and python scripts as relative paths, and when running from a
different folder, they can't be found.

To run, execute the following maven command from the iTest folder :

mvn -Pwebapp,websphere clean install

Note: for websphere, you should have WAS_HOME env variable set properly.







On Feb 5, 2008 5:40 PM, Luciano Resende <[EMAIL PROTECTED]> wrote:
> We now have the iTest pom handling all the configuration for running
> the execution of the iTests in a web-container. At the moment, we have
> enabled selected iTests (services and componentType) and you can
> execute the tests in Geronimo and/or Jetty. Adding new iTests should
> be as simple as adding it to the module list of the webApp profile,
> but we might find issues when experimenting with ws and other bindings
> (port issues for example). To execute the tests, use the webApp
> profile + the web-container you want to test on (Geronimo or Jetty)
> under the iTest folder.
>
> mvn -Pwebapp,geronimo clean install
>
> Note : for geronimo, you should have GERONIMO_HOME env variable set
> properly. I now looking into getting the same integration with
> Websphere App Server.
>
>
> On Feb 5, 2008 3:35 AM, Simon Nash <[EMAIL PROTECTED]> wrote:
> > ant elder wrote:
> > > Could you say a bit more about why it needs to be a runtime module not 
> > > just
> > > somewhere like maven-web-junit, and what the issue is in point 3? (as you
> > > can guess my preference is for this to not be in the core runtime :))
> > >
> > >...ant
> > >
> > I agree that we should keep this out of the core runtime if possible.
> > The "get it working now, refactor later" approach sounds attractive
> > but in practice it's hard to prioritize refactoring something that
> > already works when we have so many other things that also need to
> > be done.
> >
> >Simon
> >
> >
> > > On Feb 4, 2008 9:57 PM, Raymond Feng <[EMAIL PROTECTED]> wrote:
> > >
> > >> Hi,
> > >>
> > >> I don't have a strong preference. Let's try to get the basic function
> > >> working well first. A few points to think about before we refactor it.
> > >>
> > >> 1) maven-web-junit is a maven plugin under tools. We need to add another
> > >> runtime project under modules folder.
> > >> 2) host-webapp adds the junit as a runtime dependency which is not great
> > >> but
> > >> not too bad.
> > >> 3) Configuring two servlet filters conditionally is a bit complex :-). We
> > >> can also disable the /junit unit with an init-parameter "junit.enabled"
> > >> set
> > >> to false.
> > >>
> > >> Thanks,
> > >> Raymond
> > >>
> > >> - Original Message -
> > >> From: "ant elder" <[EMAIL PROTECTED]>
> > >> To: 
> > >> Sent: Monday, February 04, 2008 7:14 AM
> > >> Subject: Re: [PROPOSAL] Automate itests for WAR packaging
> > >>
> > >>
> > >>> If this is just for itests then to keep runtime cleaner how about moving
> > >>> it
> > >>> all out of the main runtime code into the maven-web-junit module? So
> > >> move
> > >>> WebTestRunner, XMLFormatter, add a new ITestTuscanyServletFilter that
> > >>> extends the TuscanyServletFilter to add the /junit hook and revert
> > >>> host-webapp, and the web.xml in the itest/services module can refer to
> > >> the
> > >>> new  ITestTuscanyServletFilter?
> > >>>
> > >>>   ...ant
> > >>>
> >
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
>
> --
> Luciano Resende
> Apache Tuscany Committer
> http://people.apache.org/~lresende
> http://lresende.blogspot.com/
>



-- 
Luciano Resende
Apache Tuscany Committer
http://people.apache.org/~lresende
http://lresende.blogspot.com/

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



Re: [PROPOSAL] Automate itests for WAR packaging

2008-02-05 Thread Luciano Resende
We now have the iTest pom handling all the configuration for running
the execution of the iTests in a web-container. At the moment, we have
enabled selected iTests (services and componentType) and you can
execute the tests in Geronimo and/or Jetty. Adding new iTests should
be as simple as adding it to the module list of the webApp profile,
but we might find issues when experimenting with ws and other bindings
(port issues for example). To execute the tests, use the webApp
profile + the web-container you want to test on (Geronimo or Jetty)
under the iTest folder.

mvn -Pwebapp,geronimo clean install

Note : for geronimo, you should have GERONIMO_HOME env variable set
properly. I now looking into getting the same integration with
Websphere App Server.

On Feb 5, 2008 3:35 AM, Simon Nash <[EMAIL PROTECTED]> wrote:
> ant elder wrote:
> > Could you say a bit more about why it needs to be a runtime module not just
> > somewhere like maven-web-junit, and what the issue is in point 3? (as you
> > can guess my preference is for this to not be in the core runtime :))
> >
> >...ant
> >
> I agree that we should keep this out of the core runtime if possible.
> The "get it working now, refactor later" approach sounds attractive
> but in practice it's hard to prioritize refactoring something that
> already works when we have so many other things that also need to
> be done.
>
>Simon
>
>
> > On Feb 4, 2008 9:57 PM, Raymond Feng <[EMAIL PROTECTED]> wrote:
> >
> >> Hi,
> >>
> >> I don't have a strong preference. Let's try to get the basic function
> >> working well first. A few points to think about before we refactor it.
> >>
> >> 1) maven-web-junit is a maven plugin under tools. We need to add another
> >> runtime project under modules folder.
> >> 2) host-webapp adds the junit as a runtime dependency which is not great
> >> but
> >> not too bad.
> >> 3) Configuring two servlet filters conditionally is a bit complex :-). We
> >> can also disable the /junit unit with an init-parameter "junit.enabled"
> >> set
> >> to false.
> >>
> >> Thanks,
> >> Raymond
> >>
> >> - Original Message -
> >> From: "ant elder" <[EMAIL PROTECTED]>
> >> To: 
> >> Sent: Monday, February 04, 2008 7:14 AM
> >> Subject: Re: [PROPOSAL] Automate itests for WAR packaging
> >>
> >>
> >>> If this is just for itests then to keep runtime cleaner how about moving
> >>> it
> >>> all out of the main runtime code into the maven-web-junit module? So
> >> move
> >>> WebTestRunner, XMLFormatter, add a new ITestTuscanyServletFilter that
> >>> extends the TuscanyServletFilter to add the /junit hook and revert
> >>> host-webapp, and the web.xml in the itest/services module can refer to
> >> the
> >>> new  ITestTuscanyServletFilter?
> >>>
> >>>   ...ant
> >>>
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>



-- 
Luciano Resende
Apache Tuscany Committer
http://people.apache.org/~lresende
http://lresende.blogspot.com/

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



Re: [PROPOSAL] Automate itests for WAR packaging

2008-02-05 Thread Simon Nash

ant elder wrote:

Could you say a bit more about why it needs to be a runtime module not just
somewhere like maven-web-junit, and what the issue is in point 3? (as you
can guess my preference is for this to not be in the core runtime :))

   ...ant


I agree that we should keep this out of the core runtime if possible.
The "get it working now, refactor later" approach sounds attractive
but in practice it's hard to prioritize refactoring something that
already works when we have so many other things that also need to
be done.

  Simon


On Feb 4, 2008 9:57 PM, Raymond Feng <[EMAIL PROTECTED]> wrote:


Hi,

I don't have a strong preference. Let's try to get the basic function
working well first. A few points to think about before we refactor it.

1) maven-web-junit is a maven plugin under tools. We need to add another
runtime project under modules folder.
2) host-webapp adds the junit as a runtime dependency which is not great
but
not too bad.
3) Configuring two servlet filters conditionally is a bit complex :-). We
can also disable the /junit unit with an init-parameter "junit.enabled"
set
to false.

Thanks,
Raymond

- Original Message -
From: "ant elder" <[EMAIL PROTECTED]>
To: 
Sent: Monday, February 04, 2008 7:14 AM
Subject: Re: [PROPOSAL] Automate itests for WAR packaging



If this is just for itests then to keep runtime cleaner how about moving
it
all out of the main runtime code into the maven-web-junit module? So

move

WebTestRunner, XMLFormatter, add a new ITestTuscanyServletFilter that
extends the TuscanyServletFilter to add the /junit hook and revert
host-webapp, and the web.xml in the itest/services module can refer to

the

new  ITestTuscanyServletFilter?

  ...ant



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



Re: [PROPOSAL] Automate itests for WAR packaging

2008-02-04 Thread ant elder
Could you say a bit more about why it needs to be a runtime module not just
somewhere like maven-web-junit, and what the issue is in point 3? (as you
can guess my preference is for this to not be in the core runtime :))

   ...ant

On Feb 4, 2008 9:57 PM, Raymond Feng <[EMAIL PROTECTED]> wrote:

> Hi,
>
> I don't have a strong preference. Let's try to get the basic function
> working well first. A few points to think about before we refactor it.
>
> 1) maven-web-junit is a maven plugin under tools. We need to add another
> runtime project under modules folder.
> 2) host-webapp adds the junit as a runtime dependency which is not great
> but
> not too bad.
> 3) Configuring two servlet filters conditionally is a bit complex :-). We
> can also disable the /junit unit with an init-parameter "junit.enabled"
> set
> to false.
>
> Thanks,
> Raymond
>
> - Original Message -
> From: "ant elder" <[EMAIL PROTECTED]>
> To: 
> Sent: Monday, February 04, 2008 7:14 AM
> Subject: Re: [PROPOSAL] Automate itests for WAR packaging
>
>
> > If this is just for itests then to keep runtime cleaner how about moving
> > it
> > all out of the main runtime code into the maven-web-junit module? So
> move
> > WebTestRunner, XMLFormatter, add a new ITestTuscanyServletFilter that
> > extends the TuscanyServletFilter to add the /junit hook and revert
> > host-webapp, and the web.xml in the itest/services module can refer to
> the
> > new  ITestTuscanyServletFilter?
> >
> >   ...ant
> >
> > On Feb 4, 2008 2:53 PM, ant elder <[EMAIL PROTECTED]> wrote:
> >
> >> Fine sorry i'd misunderstood before, the bit about adjusting the
> >> sample-calculator-webapp to use this had me thinking the intention was
> to
> >> add this in to all the samples.
> >>
> >>...ant
> >>
> >>
> >> On Feb 4, 2008 5:09 AM, Raymond Feng <[EMAIL PROTECTED]> wrote:
> >>
> >> > Hi,
> >> >
> >> > There are two objectives here:
> >> >
> >> > 1) Reuse our itests in the webapp packaging scheme with little
> efforts
> >> > to
> >> > convert. Automate the itests in web containers and report the results
> >> > at
> >> > the
> >> > client side.
> >> >
> >> > 2) Automate the start/deploy/undeploy/stop of the web applications
> >> > against
> >> > various web containers (such as Tomcat, Jetty, Geronimo and
> WebSphere,
> >> > WebLogic).
> >> >
> >> > Most of the changes I made is to support 1). I also put some
> >> > declarations
> >> > (including cargo and geronimo-maven-plugin) in the pom.xml to support
> >> > 2).
> >> >
> >> > With this, we can reuse most of our itests to run under the web
> >> > environment
> >> > without little efforts to convert. The test cases stay as regular
> Junit
> >> > test
> >> > cases. The client side doesn't have to write HtmlUnit to deal with
> the
> >> > HTTP
> >> > conversation.
> >> >
> >> > Thanks,
> >> > Raymond
> >> >
> >> > - Original Message -
> >> > From: "Luciano Resende" <[EMAIL PROTECTED]>
> >> > To: 
> >> > Sent: Sunday, February 03, 2008 4:04 PM
> >> > Subject: Re: [PROPOSAL] Automate itests for WAR packaging
> >> >
> >> >
> >> > > By going with this approach, we can reutilize a lot of existing
> tests
> >> > > (our iTests for example), instead of having to create/migrate new
> >> > > tests using htmlUnit. As for cargo, it does not support all the
> >> > > hosting platforms we are supporting, right ?
> >> > >
> >> > > On Feb 3, 2008 2:42 AM, ant elder <[EMAIL PROTECTED]> wrote:
> >> > >>
> >> > >> On Feb 1, 2008 5:41 PM, Raymond Feng <[EMAIL PROTECTED]> wrote:
> >> > >>
> >> > >> > Hi,
> >> > >> >
> >> > >> > (Sorry for the long text, I make it availabe on our WIKI too:
> >> > >> >
> >> > >> >
> >> >
> http://cwiki.apache.org/confluence/display/TUSCANYWIKI/Automation+of+itests+in+web+applications
> >> > >> > ).
> >> > >> >
> >> > >> > In our WAR packaging scheme, we package SCA artifacts with
> 

Re: [PROPOSAL] Automate itests for WAR packaging

2008-02-04 Thread Raymond Feng

Hi,

I don't have a strong preference. Let's try to get the basic function 
working well first. A few points to think about before we refactor it.


1) maven-web-junit is a maven plugin under tools. We need to add another 
runtime project under modules folder.
2) host-webapp adds the junit as a runtime dependency which is not great but 
not too bad.
3) Configuring two servlet filters conditionally is a bit complex :-). We 
can also disable the /junit unit with an init-parameter "junit.enabled" set 
to false.


Thanks,
Raymond

- Original Message - 
From: "ant elder" <[EMAIL PROTECTED]>

To: 
Sent: Monday, February 04, 2008 7:14 AM
Subject: Re: [PROPOSAL] Automate itests for WAR packaging


If this is just for itests then to keep runtime cleaner how about moving 
it

all out of the main runtime code into the maven-web-junit module? So move
WebTestRunner, XMLFormatter, add a new ITestTuscanyServletFilter that
extends the TuscanyServletFilter to add the /junit hook and revert
host-webapp, and the web.xml in the itest/services module can refer to the
new  ITestTuscanyServletFilter?

  ...ant

On Feb 4, 2008 2:53 PM, ant elder <[EMAIL PROTECTED]> wrote:


Fine sorry i'd misunderstood before, the bit about adjusting the
sample-calculator-webapp to use this had me thinking the intention was to
add this in to all the samples.

   ...ant


On Feb 4, 2008 5:09 AM, Raymond Feng <[EMAIL PROTECTED]> wrote:

> Hi,
>
> There are two objectives here:
>
> 1) Reuse our itests in the webapp packaging scheme with little efforts
> to
> convert. Automate the itests in web containers and report the results 
> at

> the
> client side.
>
> 2) Automate the start/deploy/undeploy/stop of the web applications
> against
> various web containers (such as Tomcat, Jetty, Geronimo and WebSphere,
> WebLogic).
>
> Most of the changes I made is to support 1). I also put some
> declarations
> (including cargo and geronimo-maven-plugin) in the pom.xml to support
> 2).
>
> With this, we can reuse most of our itests to run under the web
> environment
> without little efforts to convert. The test cases stay as regular Junit
> test
> cases. The client side doesn't have to write HtmlUnit to deal with the
> HTTP
> conversation.
>
> Thanks,
> Raymond
>
> ----- Original Message -----
> From: "Luciano Resende" <[EMAIL PROTECTED]>
> To: 
> Sent: Sunday, February 03, 2008 4:04 PM
> Subject: Re: [PROPOSAL] Automate itests for WAR packaging
>
>
> > By going with this approach, we can reutilize a lot of existing tests
> > (our iTests for example), instead of having to create/migrate new
> > tests using htmlUnit. As for cargo, it does not support all the
> > hosting platforms we are supporting, right ?
> >
> > On Feb 3, 2008 2:42 AM, ant elder <[EMAIL PROTECTED]> wrote:
> >>
> >> On Feb 1, 2008 5:41 PM, Raymond Feng <[EMAIL PROTECTED]> wrote:
> >>
> >> > Hi,
> >> >
> >> > (Sorry for the long text, I make it availabe on our WIKI too:
> >> >
> >> >
> 
http://cwiki.apache.org/confluence/display/TUSCANYWIKI/Automation+of+itests+in+web+applications
> >> > ).
> >> >
> >> > In our WAR packaging scheme, we package SCA artifacts with Tuscany
> >> > runtime
> >> > jars in a WAR so that it can be deployed to a web container such 
> >> > as

> >> > Tomcat,
> >> > Jetty or Geronimo. In release 1.1, we already have 5-6 samples as
> web
> >> > applications.
> >> >
> >> > 1) Most of the validation of web applications is done manully
> before a
> >> > release. This is time-consuming and error prone.
> >> > 2) Our integration tests are not performed in the WAR packaging
> scheme.
> >> > Trying samples is a smoke test. If we can run the itests in a web
> >> > application, we'll get much more coverage.
> >> >
> >> > To address the above issues, I propose that we add the following
> >> > capabilities:
> >> >
> >> > 1) Provide an option to wrap itests into web applications with
> little
> >> > effort
> >> > to convert the test cases
> >> > 2) Automate the steps to start/stop a web container and deploy web
> >> > applications to the container
> >> > 3) Automate the testing of our JUnit-based test cases in the web
> >> > application
> >> >
> >> > I did some prototyping and here is what I have achieved so far:
> >> >
> >> > 1) Add some code to
> >> > "org.apache.

Re: [PROPOSAL] Automate itests for WAR packaging

2008-02-04 Thread ant elder
If this is just for itests then to keep runtime cleaner how about moving it
all out of the main runtime code into the maven-web-junit module? So move
WebTestRunner, XMLFormatter, add a new ITestTuscanyServletFilter that
extends the TuscanyServletFilter to add the /junit hook and revert
host-webapp, and the web.xml in the itest/services module can refer to the
new  ITestTuscanyServletFilter?

   ...ant

On Feb 4, 2008 2:53 PM, ant elder <[EMAIL PROTECTED]> wrote:

> Fine sorry i'd misunderstood before, the bit about adjusting the
> sample-calculator-webapp to use this had me thinking the intention was to
> add this in to all the samples.
>
>...ant
>
>
> On Feb 4, 2008 5:09 AM, Raymond Feng <[EMAIL PROTECTED]> wrote:
>
> > Hi,
> >
> > There are two objectives here:
> >
> > 1) Reuse our itests in the webapp packaging scheme with little efforts
> > to
> > convert. Automate the itests in web containers and report the results at
> > the
> > client side.
> >
> > 2) Automate the start/deploy/undeploy/stop of the web applications
> > against
> > various web containers (such as Tomcat, Jetty, Geronimo and WebSphere,
> > WebLogic).
> >
> > Most of the changes I made is to support 1). I also put some
> > declarations
> > (including cargo and geronimo-maven-plugin) in the pom.xml to support
> > 2).
> >
> > With this, we can reuse most of our itests to run under the web
> > environment
> > without little efforts to convert. The test cases stay as regular Junit
> > test
> > cases. The client side doesn't have to write HtmlUnit to deal with the
> > HTTP
> > conversation.
> >
> > Thanks,
> > Raymond
> >
> > - Original Message -
> > From: "Luciano Resende" <[EMAIL PROTECTED]>
> > To: 
> > Sent: Sunday, February 03, 2008 4:04 PM
> > Subject: Re: [PROPOSAL] Automate itests for WAR packaging
> >
> >
> > > By going with this approach, we can reutilize a lot of existing tests
> > > (our iTests for example), instead of having to create/migrate new
> > > tests using htmlUnit. As for cargo, it does not support all the
> > > hosting platforms we are supporting, right ?
> > >
> > > On Feb 3, 2008 2:42 AM, ant elder <[EMAIL PROTECTED]> wrote:
> > >>
> > >> On Feb 1, 2008 5:41 PM, Raymond Feng <[EMAIL PROTECTED]> wrote:
> > >>
> > >> > Hi,
> > >> >
> > >> > (Sorry for the long text, I make it availabe on our WIKI too:
> > >> >
> > >> >
> > http://cwiki.apache.org/confluence/display/TUSCANYWIKI/Automation+of+itests+in+web+applications
> > >> > ).
> > >> >
> > >> > In our WAR packaging scheme, we package SCA artifacts with Tuscany
> > >> > runtime
> > >> > jars in a WAR so that it can be deployed to a web container such as
> > >> > Tomcat,
> > >> > Jetty or Geronimo. In release 1.1, we already have 5-6 samples as
> > web
> > >> > applications.
> > >> >
> > >> > 1) Most of the validation of web applications is done manully
> > before a
> > >> > release. This is time-consuming and error prone.
> > >> > 2) Our integration tests are not performed in the WAR packaging
> > scheme.
> > >> > Trying samples is a smoke test. If we can run the itests in a web
> > >> > application, we'll get much more coverage.
> > >> >
> > >> > To address the above issues, I propose that we add the following
> > >> > capabilities:
> > >> >
> > >> > 1) Provide an option to wrap itests into web applications with
> > little
> > >> > effort
> > >> > to convert the test cases
> > >> > 2) Automate the steps to start/stop a web container and deploy web
> > >> > applications to the container
> > >> > 3) Automate the testing of our JUnit-based test cases in the web
> > >> > application
> > >> >
> > >> > I did some prototyping and here is what I have achieved so far:
> > >> >
> > >> > 1) Add some code to
> > >> > "org.apache.tuscany.sca.host.webapp.TuscanyServletFilter"
> > >> > (tuscany-host-webapp) to intercept the HTTP requests to a special
> > path
> > >> > "/junit". The control is then delegated to a new class
> > WebTestRunner
> > >> > that
&

Re: [PROPOSAL] Automate itests for WAR packaging

2008-02-04 Thread ant elder
Fine sorry i'd misunderstood before, the bit about adjusting the
sample-calculator-webapp to use this had me thinking the intention was to
add this in to all the samples.

   ...ant

On Feb 4, 2008 5:09 AM, Raymond Feng <[EMAIL PROTECTED]> wrote:

> Hi,
>
> There are two objectives here:
>
> 1) Reuse our itests in the webapp packaging scheme with little efforts to
> convert. Automate the itests in web containers and report the results at
> the
> client side.
>
> 2) Automate the start/deploy/undeploy/stop of the web applications against
> various web containers (such as Tomcat, Jetty, Geronimo and WebSphere,
> WebLogic).
>
> Most of the changes I made is to support 1). I also put some declarations
> (including cargo and geronimo-maven-plugin) in the pom.xml to support 2).
>
> With this, we can reuse most of our itests to run under the web
> environment
> without little efforts to convert. The test cases stay as regular Junit
> test
> cases. The client side doesn't have to write HtmlUnit to deal with the
> HTTP
> conversation.
>
> Thanks,
> Raymond
>
> - Original Message -
> From: "Luciano Resende" <[EMAIL PROTECTED]>
> To: 
> Sent: Sunday, February 03, 2008 4:04 PM
> Subject: Re: [PROPOSAL] Automate itests for WAR packaging
>
>
> > By going with this approach, we can reutilize a lot of existing tests
> > (our iTests for example), instead of having to create/migrate new
> > tests using htmlUnit. As for cargo, it does not support all the
> > hosting platforms we are supporting, right ?
> >
> > On Feb 3, 2008 2:42 AM, ant elder <[EMAIL PROTECTED]> wrote:
> >>
> >> On Feb 1, 2008 5:41 PM, Raymond Feng <[EMAIL PROTECTED]> wrote:
> >>
> >> > Hi,
> >> >
> >> > (Sorry for the long text, I make it availabe on our WIKI too:
> >> >
> >> >
> http://cwiki.apache.org/confluence/display/TUSCANYWIKI/Automation+of+itests+in+web+applications
> >> > ).
> >> >
> >> > In our WAR packaging scheme, we package SCA artifacts with Tuscany
> >> > runtime
> >> > jars in a WAR so that it can be deployed to a web container such as
> >> > Tomcat,
> >> > Jetty or Geronimo. In release 1.1, we already have 5-6 samples as web
> >> > applications.
> >> >
> >> > 1) Most of the validation of web applications is done manully before
> a
> >> > release. This is time-consuming and error prone.
> >> > 2) Our integration tests are not performed in the WAR packaging
> scheme.
> >> > Trying samples is a smoke test. If we can run the itests in a web
> >> > application, we'll get much more coverage.
> >> >
> >> > To address the above issues, I propose that we add the following
> >> > capabilities:
> >> >
> >> > 1) Provide an option to wrap itests into web applications with little
> >> > effort
> >> > to convert the test cases
> >> > 2) Automate the steps to start/stop a web container and deploy web
> >> > applications to the container
> >> > 3) Automate the testing of our JUnit-based test cases in the web
> >> > application
> >> >
> >> > I did some prototyping and here is what I have achieved so far:
> >> >
> >> > 1) Add some code to
> >> > "org.apache.tuscany.sca.host.webapp.TuscanyServletFilter"
> >> > (tuscany-host-webapp) to intercept the HTTP requests to a special
> path
> >> > "/junit". The control is then delegated to a new class WebTestRunner
> >> > that
> >> > knows how to find and run the JUNIT test cases and produce the
> results
> >> > of
> >> > the test (for example, number of runs, failures and errors, similar
> >> > with
> >> > what maven surefire plugin does). The report is sent back to the web
> >> > client.
> >> >
> >> > With this, we can run the plain JUNIT test cases in the web
> application
> >> > by
> >> > connecting to a URL like http://localhost:8080//junit.
> >> >
> >> > 2) Adjust the sample-calculator-webapp to validate the idea
> >> > * Add a test case calculator.CalculatorTestCase
> >> > * Configure the maven-war-plugin in the pom.xml to include the test
> >> > classes
> >> > as a jar into the WAR (WEB-INF/test-lib/)
> >> > * Change the junit dependency from test to runtime so it will be
> >> > package

Re: [PROPOSAL] Automate itests for WAR packaging

2008-02-03 Thread Raymond Feng

Hi,

There are two objectives here:

1) Reuse our itests in the webapp packaging scheme with little efforts to 
convert. Automate the itests in web containers and report the results at the 
client side.


2) Automate the start/deploy/undeploy/stop of the web applications against 
various web containers (such as Tomcat, Jetty, Geronimo and WebSphere, 
WebLogic).


Most of the changes I made is to support 1). I also put some declarations 
(including cargo and geronimo-maven-plugin) in the pom.xml to support 2).


With this, we can reuse most of our itests to run under the web environment 
without little efforts to convert. The test cases stay as regular Junit test 
cases. The client side doesn't have to write HtmlUnit to deal with the HTTP 
conversation.


Thanks,
Raymond

- Original Message - 
From: "Luciano Resende" <[EMAIL PROTECTED]>

To: 
Sent: Sunday, February 03, 2008 4:04 PM
Subject: Re: [PROPOSAL] Automate itests for WAR packaging



By going with this approach, we can reutilize a lot of existing tests
(our iTests for example), instead of having to create/migrate new
tests using htmlUnit. As for cargo, it does not support all the
hosting platforms we are supporting, right ?

On Feb 3, 2008 2:42 AM, ant elder <[EMAIL PROTECTED]> wrote:


On Feb 1, 2008 5:41 PM, Raymond Feng <[EMAIL PROTECTED]> wrote:

> Hi,
>
> (Sorry for the long text, I make it availabe on our WIKI too:
>
> 
http://cwiki.apache.org/confluence/display/TUSCANYWIKI/Automation+of+itests+in+web+applications
> ).
>
> In our WAR packaging scheme, we package SCA artifacts with Tuscany 
> runtime

> jars in a WAR so that it can be deployed to a web container such as
> Tomcat,
> Jetty or Geronimo. In release 1.1, we already have 5-6 samples as web
> applications.
>
> 1) Most of the validation of web applications is done manully before a
> release. This is time-consuming and error prone.
> 2) Our integration tests are not performed in the WAR packaging scheme.
> Trying samples is a smoke test. If we can run the itests in a web
> application, we'll get much more coverage.
>
> To address the above issues, I propose that we add the following
> capabilities:
>
> 1) Provide an option to wrap itests into web applications with little
> effort
> to convert the test cases
> 2) Automate the steps to start/stop a web container and deploy web
> applications to the container
> 3) Automate the testing of our JUnit-based test cases in the web
> application
>
> I did some prototyping and here is what I have achieved so far:
>
> 1) Add some code to
> "org.apache.tuscany.sca.host.webapp.TuscanyServletFilter"
> (tuscany-host-webapp) to intercept the HTTP requests to a special path
> "/junit". The control is then delegated to a new class WebTestRunner 
> that
> knows how to find and run the JUNIT test cases and produce the results 
> of
> the test (for example, number of runs, failures and errors, similar 
> with

> what maven surefire plugin does). The report is sent back to the web
> client.
>
> With this, we can run the plain JUNIT test cases in the web application 
> by

> connecting to a URL like http://localhost:8080//junit.
>
> 2) Adjust the sample-calculator-webapp to validate the idea
> * Add a test case calculator.CalculatorTestCase
> * Configure the maven-war-plugin in the pom.xml to include the test
> classes
> as a jar into the WAR (WEB-INF/test-lib/)
> * Change the junit dependency from test to runtime so it will be 
> packaged

> into the WAR
>
> 3) Run the maven build as ususal, produce a WAR, deploy to Tomcat, 
> browse

> to
> http://localhost:8080/sample-calculator-webapp/junit, and see the test
> results in the browser. To run a selected list of test cases,
> http://localhost:8080/sample-calculator-webapp/junit?test1,test2.
>
> This seems to be non-invasive as we already configure the servlet 
> filter

> for
> web applications. The regular URLs to JSPs or web services stay the 
> same.

> We
> don't have to change the test case code too much.
>
> I also went a bit further:
>
> 1) Developed a maven plugin to trigger the web-based junit tests and
> analyze
> the results
> 2) Configure the pom.xml with cargo plugin to start an embedded Jetty
> server, deploy the WAR, trigger the web-based junit tests, and stop the
> server.
>
> Now I have a complete automation. To avoid repeating the pom 
> configuration

> for each itest, we can add a profile in the parent pom to support this
> scheme.
>
> For Tuscany itests, we also have to figure out a way to avoid the
> conflicting bootstrap in the J2SE and web.
>
> Your feedback is welcome.
>
> Thanks,
> Raymond
>

+1 to automated testing of the samples,

Re: [PROPOSAL] Automate itests for WAR packaging

2008-02-03 Thread Raymond Feng
Hi, 


What problem did you with maven 2.0.5? I'm running maven 2.0.8 now.

Thanks,
Raymond

- Original Message - 
From: "Jean-Sebastien Delfino" <[EMAIL PROTECTED]>

To: 
Sent: Sunday, February 03, 2008 2:29 PM
Subject: Re: [PROPOSAL] Automate itests for WAR packaging



Raymond Feng wrote:

Hi,

I have checked in my changes.


Your changes break the build for me as they require Maven 2.0.6. Our 1.1 
release worked with Maven 2.0.5.


I'm installing the latest Maven (2.0.8) now but what do people prefer?
- continue to work with 2.0.5 and later
- 2.0.6 and later?
- 2.0.7 and later?
- 2.0.8?

Thanks.
--
Jean-Sebastien

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



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



Re: [PROPOSAL] Automate itests for WAR packaging

2008-02-03 Thread Luciano Resende
My personal opinion

> - 2.0.7 and later?


On Feb 3, 2008 2:29 PM, Jean-Sebastien Delfino <[EMAIL PROTECTED]> wrote:
> Raymond Feng wrote:
> > Hi,
> >
> > I have checked in my changes.
>
> Your changes break the build for me as they require Maven 2.0.6. Our 1.1
> release worked with Maven 2.0.5.
>
> I'm installing the latest Maven (2.0.8) now but what do people prefer?
> - continue to work with 2.0.5 and later
> - 2.0.6 and later?
> - 2.0.7 and later?
> - 2.0.8?
>
>
> Thanks.
> --
> Jean-Sebastien
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>



-- 
Luciano Resende
Apache Tuscany Committer
http://people.apache.org/~lresende
http://lresende.blogspot.com/

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



Re: [PROPOSAL] Automate itests for WAR packaging

2008-02-03 Thread Luciano Resende
By going with this approach, we can reutilize a lot of existing tests
(our iTests for example), instead of having to create/migrate new
tests using htmlUnit. As for cargo, it does not support all the
hosting platforms we are supporting, right ?

On Feb 3, 2008 2:42 AM, ant elder <[EMAIL PROTECTED]> wrote:
>
> On Feb 1, 2008 5:41 PM, Raymond Feng <[EMAIL PROTECTED]> wrote:
>
> > Hi,
> >
> > (Sorry for the long text, I make it availabe on our WIKI too:
> >
> > http://cwiki.apache.org/confluence/display/TUSCANYWIKI/Automation+of+itests+in+web+applications
> > ).
> >
> > In our WAR packaging scheme, we package SCA artifacts with Tuscany runtime
> > jars in a WAR so that it can be deployed to a web container such as
> > Tomcat,
> > Jetty or Geronimo. In release 1.1, we already have 5-6 samples as web
> > applications.
> >
> > 1) Most of the validation of web applications is done manully before a
> > release. This is time-consuming and error prone.
> > 2) Our integration tests are not performed in the WAR packaging scheme.
> > Trying samples is a smoke test. If we can run the itests in a web
> > application, we'll get much more coverage.
> >
> > To address the above issues, I propose that we add the following
> > capabilities:
> >
> > 1) Provide an option to wrap itests into web applications with little
> > effort
> > to convert the test cases
> > 2) Automate the steps to start/stop a web container and deploy web
> > applications to the container
> > 3) Automate the testing of our JUnit-based test cases in the web
> > application
> >
> > I did some prototyping and here is what I have achieved so far:
> >
> > 1) Add some code to
> > "org.apache.tuscany.sca.host.webapp.TuscanyServletFilter"
> > (tuscany-host-webapp) to intercept the HTTP requests to a special path
> > "/junit". The control is then delegated to a new class WebTestRunner that
> > knows how to find and run the JUNIT test cases and produce the results of
> > the test (for example, number of runs, failures and errors, similar with
> > what maven surefire plugin does). The report is sent back to the web
> > client.
> >
> > With this, we can run the plain JUNIT test cases in the web application by
> > connecting to a URL like http://localhost:8080//junit.
> >
> > 2) Adjust the sample-calculator-webapp to validate the idea
> > * Add a test case calculator.CalculatorTestCase
> > * Configure the maven-war-plugin in the pom.xml to include the test
> > classes
> > as a jar into the WAR (WEB-INF/test-lib/)
> > * Change the junit dependency from test to runtime so it will be packaged
> > into the WAR
> >
> > 3) Run the maven build as ususal, produce a WAR, deploy to Tomcat, browse
> > to
> > http://localhost:8080/sample-calculator-webapp/junit, and see the test
> > results in the browser. To run a selected list of test cases,
> > http://localhost:8080/sample-calculator-webapp/junit?test1,test2.
> >
> > This seems to be non-invasive as we already configure the servlet filter
> > for
> > web applications. The regular URLs to JSPs or web services stay the same.
> > We
> > don't have to change the test case code too much.
> >
> > I also went a bit further:
> >
> > 1) Developed a maven plugin to trigger the web-based junit tests and
> > analyze
> > the results
> > 2) Configure the pom.xml with cargo plugin to start an embedded Jetty
> > server, deploy the WAR, trigger the web-based junit tests, and stop the
> > server.
> >
> > Now I have a complete automation. To avoid repeating the pom configuration
> > for each itest, we can add a profile in the parent pom to support this
> > scheme.
> >
> > For Tuscany itests, we also have to figure out a way to avoid the
> > conflicting bootstrap in the J2SE and web.
> >
> > Your feedback is welcome.
> >
> > Thanks,
> > Raymond
> >
>
> +1 to automated testing of the samples, demos and tutorials.
>
> Sounds like you've already done a lot of work on this, but i don't
> understand why this really complicated custom framework is necessary, what
> does it give that we need which the standard cargo and htmlunit testing wont
> provide?
>
>...ant
>



-- 
Luciano Resende
Apache Tuscany Committer
http://people.apache.org/~lresende
http://lresende.blogspot.com/

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



Re: [PROPOSAL] Automate itests for WAR packaging

2008-02-03 Thread Jean-Sebastien Delfino

Raymond Feng wrote:

Hi,

I have checked in my changes.


Your changes break the build for me as they require Maven 2.0.6. Our 1.1 
release worked with Maven 2.0.5.


I'm installing the latest Maven (2.0.8) now but what do people prefer?
- continue to work with 2.0.5 and later
- 2.0.6 and later?
- 2.0.7 and later?
- 2.0.8?

Thanks.
--
Jean-Sebastien

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



Re: [PROPOSAL] Automate itests for WAR packaging

2008-02-03 Thread ant elder
On Feb 1, 2008 5:41 PM, Raymond Feng <[EMAIL PROTECTED]> wrote:

> Hi,
>
> (Sorry for the long text, I make it availabe on our WIKI too:
>
> http://cwiki.apache.org/confluence/display/TUSCANYWIKI/Automation+of+itests+in+web+applications
> ).
>
> In our WAR packaging scheme, we package SCA artifacts with Tuscany runtime
> jars in a WAR so that it can be deployed to a web container such as
> Tomcat,
> Jetty or Geronimo. In release 1.1, we already have 5-6 samples as web
> applications.
>
> 1) Most of the validation of web applications is done manully before a
> release. This is time-consuming and error prone.
> 2) Our integration tests are not performed in the WAR packaging scheme.
> Trying samples is a smoke test. If we can run the itests in a web
> application, we'll get much more coverage.
>
> To address the above issues, I propose that we add the following
> capabilities:
>
> 1) Provide an option to wrap itests into web applications with little
> effort
> to convert the test cases
> 2) Automate the steps to start/stop a web container and deploy web
> applications to the container
> 3) Automate the testing of our JUnit-based test cases in the web
> application
>
> I did some prototyping and here is what I have achieved so far:
>
> 1) Add some code to
> "org.apache.tuscany.sca.host.webapp.TuscanyServletFilter"
> (tuscany-host-webapp) to intercept the HTTP requests to a special path
> "/junit". The control is then delegated to a new class WebTestRunner that
> knows how to find and run the JUNIT test cases and produce the results of
> the test (for example, number of runs, failures and errors, similar with
> what maven surefire plugin does). The report is sent back to the web
> client.
>
> With this, we can run the plain JUNIT test cases in the web application by
> connecting to a URL like http://localhost:8080//junit.
>
> 2) Adjust the sample-calculator-webapp to validate the idea
> * Add a test case calculator.CalculatorTestCase
> * Configure the maven-war-plugin in the pom.xml to include the test
> classes
> as a jar into the WAR (WEB-INF/test-lib/)
> * Change the junit dependency from test to runtime so it will be packaged
> into the WAR
>
> 3) Run the maven build as ususal, produce a WAR, deploy to Tomcat, browse
> to
> http://localhost:8080/sample-calculator-webapp/junit, and see the test
> results in the browser. To run a selected list of test cases,
> http://localhost:8080/sample-calculator-webapp/junit?test1,test2.
>
> This seems to be non-invasive as we already configure the servlet filter
> for
> web applications. The regular URLs to JSPs or web services stay the same.
> We
> don't have to change the test case code too much.
>
> I also went a bit further:
>
> 1) Developed a maven plugin to trigger the web-based junit tests and
> analyze
> the results
> 2) Configure the pom.xml with cargo plugin to start an embedded Jetty
> server, deploy the WAR, trigger the web-based junit tests, and stop the
> server.
>
> Now I have a complete automation. To avoid repeating the pom configuration
> for each itest, we can add a profile in the parent pom to support this
> scheme.
>
> For Tuscany itests, we also have to figure out a way to avoid the
> conflicting bootstrap in the J2SE and web.
>
> Your feedback is welcome.
>
> Thanks,
> Raymond
>

+1 to automated testing of the samples, demos and tutorials.

Sounds like you've already done a lot of work on this, but i don't
understand why this really complicated custom framework is necessary, what
does it give that we need which the standard cargo and htmlunit testing wont
provide?

   ...ant


Re: [PROPOSAL] Automate itests for WAR packaging

2008-02-02 Thread Raymond Feng

Hi,

I have checked in my changes. For geronimo, I found this page helpful:

http://cwiki.apache.org/GMOxDEV/integration-testing.html

But it seems to target testing web apps with Geronimo, not running JUnit 
tests in the web container.


Thanks,
Raymond

- Original Message - 
From: "Jean-Sebastien Delfino" <[EMAIL PROTECTED]>

To: 
Sent: Saturday, February 02, 2008 1:41 PM
Subject: Re: [PROPOSAL] Automate itests for WAR packaging



Raymond Feng wrote:
A quick update: I managed to get the automation working with Geronimo 
2.0.2 too using the geronimo-maven-plugin. The new pom.xml has been 
updated at the wiki page.


Thanks,
Raymond

- Original Message - From: "Raymond Feng" <[EMAIL PROTECTED]>
To: 
Sent: Friday, February 01, 2008 9:41 AM
Subject: [PROPOSAL] Automate itests for WAR packaging



Hi,

(Sorry for the long text, I make it availabe on our WIKI too: 
http://cwiki.apache.org/confluence/display/TUSCANYWIKI/Automation+of+itests+in+web+applications).


In our WAR packaging scheme, we package SCA artifacts with Tuscany 
runtime jars in a WAR so that it can be deployed to a web container such 
as Tomcat, Jetty or Geronimo. In release 1.1, we already have 5-6 
samples as web applications.


1) Most of the validation of web applications is done manully before a 
release. This is time-consuming and error prone.
2) Our integration tests are not performed in the WAR packaging scheme. 
Trying samples is a smoke test. If we can run the itests in a web 
application, we'll get much more coverage.


To address the above issues, I propose that we add the following 
capabilities:


1) Provide an option to wrap itests into web applications with little 
effort to convert the test cases
2) Automate the steps to start/stop a web container and deploy web 
applications to the container
3) Automate the testing of our JUnit-based test cases in the web 
application


I did some prototyping and here is what I have achieved so far:

1) Add some code to 
"org.apache.tuscany.sca.host.webapp.TuscanyServletFilter" 
(tuscany-host-webapp) to intercept the HTTP requests to a special path 
"/junit". The control is then delegated to a new class WebTestRunner 
that knows how to find and run the JUNIT test cases and produce the 
results of the test (for example, number of runs, failures and errors, 
similar with what maven surefire plugin does). The report is sent back 
to the web client.


With this, we can run the plain JUNIT test cases in the web application 
by connecting to a URL like http://localhost:8080//junit.


2) Adjust the sample-calculator-webapp to validate the idea
* Add a test case calculator.CalculatorTestCase
* Configure the maven-war-plugin in the pom.xml to include the test 
classes as a jar into the WAR (WEB-INF/test-lib/)
* Change the junit dependency from test to runtime so it will be 
packaged into the WAR


3) Run the maven build as ususal, produce a WAR, deploy to Tomcat, 
browse to http://localhost:8080/sample-calculator-webapp/junit, and see 
the test results in the browser. To run a selected list of test cases, 
http://localhost:8080/sample-calculator-webapp/junit?test1,test2.


This seems to be non-invasive as we already configure the servlet filter 
for web applications. The regular URLs to JSPs or web services stay the 
same. We don't have to change the test case code too much.


I also went a bit further:

1) Developed a maven plugin to trigger the web-based junit tests and 
analyze the results
2) Configure the pom.xml with cargo plugin to start an embedded Jetty 
server, deploy the WAR, trigger the web-based junit tests, and stop the 
server.


Now I have a complete automation. To avoid repeating the pom 
configuration for each itest, we can add a profile in the parent pom to 
support this scheme.


For Tuscany itests, we also have to figure out a way to avoid the 
conflicting bootstrap in the J2SE and web.


Your feedback is welcome.

Thanks,
Raymond


This overall sounds good but can you make this available in SVN for people 
to see and try?


Do you know what the Geronimo folks are doing in the Geronimo project to 
run that kind of tests?


Thanks.
--
Jean-Sebastien

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




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



Re: [PROPOSAL] Automate itests for WAR packaging

2008-02-02 Thread Raymond Feng

Hi,

I committed what I have under r617959, 617960 and 617961. There are three 
key changes:


1) Add some logic to TuscanyServletFilter to run the test cases in the web 
env
2) Add a maven plugin to trigger the junit tests on the web server and 
analyze the results

3) Convert itest-services to use the web-based unit testing

For 3), you can run "mvn clean install". The build will generate a WAR (in 
addition to the jar), start an embedded Jetty, deploy the WAR, connect to 
the web app to run test cases and produce the results, and then shutdown the 
Jetty.


You can also run "mvn -Pgeronimo,webapp" to test it against an existing 
Geronimo server. Change geronimo.home property in the pom.xml to set it to 
your geronimo root.


Thanks,
Raymond

- Original Message - 
From: "Luciano Resende" <[EMAIL PROTECTED]>

To: 
Sent: Saturday, February 02, 2008 3:42 PM
Subject: Re: [PROPOSAL] Automate itests for WAR packaging



Great Raymond,

  I very interested in using this approach to automate the execution
of our iTests in a web app container. I playing a little with some
iTests to try to make them ready to use this. From my initial
investigations, I couldn't really change the packaging schema for a
given project based on a maven profile, so, I decided to create a new
webapp project, that then includes the original iTests as
dependencies, other then this, most of the configuration can be
centralized on a parent pom. I still trying to see the best way to
include the test cases, that was generated in a separate jar (a second
artifact from a given module), into the web app

BTW, Would you mind committing it so I can start playing with a
end-to-end scenario for the iTests too ?

On Feb 1, 2008 9:41 AM, Raymond Feng <[EMAIL PROTECTED]> wrote:

Hi,

(Sorry for the long text, I make it availabe on our WIKI too:
http://cwiki.apache.org/confluence/display/TUSCANYWIKI/Automation+of+itests+in+web+applications).

In our WAR packaging scheme, we package SCA artifacts with Tuscany 
runtime
jars in a WAR so that it can be deployed to a web container such as 
Tomcat,

Jetty or Geronimo. In release 1.1, we already have 5-6 samples as web
applications.

1) Most of the validation of web applications is done manully before a
release. This is time-consuming and error prone.
2) Our integration tests are not performed in the WAR packaging scheme.
Trying samples is a smoke test. If we can run the itests in a web
application, we'll get much more coverage.

To address the above issues, I propose that we add the following
capabilities:

1) Provide an option to wrap itests into web applications with little 
effort

to convert the test cases
2) Automate the steps to start/stop a web container and deploy web
applications to the container
3) Automate the testing of our JUnit-based test cases in the web 
application


I did some prototyping and here is what I have achieved so far:

1) Add some code to
"org.apache.tuscany.sca.host.webapp.TuscanyServletFilter"
(tuscany-host-webapp) to intercept the HTTP requests to a special path
"/junit". The control is then delegated to a new class WebTestRunner that
knows how to find and run the JUNIT test cases and produce the results of
the test (for example, number of runs, failures and errors, similar with
what maven surefire plugin does). The report is sent back to the web 
client.


With this, we can run the plain JUNIT test cases in the web application 
by

connecting to a URL like http://localhost:8080//junit.

2) Adjust the sample-calculator-webapp to validate the idea
* Add a test case calculator.CalculatorTestCase
* Configure the maven-war-plugin in the pom.xml to include the test 
classes

as a jar into the WAR (WEB-INF/test-lib/)
* Change the junit dependency from test to runtime so it will be packaged
into the WAR

3) Run the maven build as ususal, produce a WAR, deploy to Tomcat, browse 
to

http://localhost:8080/sample-calculator-webapp/junit, and see the test
results in the browser. To run a selected list of test cases,
http://localhost:8080/sample-calculator-webapp/junit?test1,test2.

This seems to be non-invasive as we already configure the servlet filter 
for
web applications. The regular URLs to JSPs or web services stay the same. 
We

don't have to change the test case code too much.

I also went a bit further:

1) Developed a maven plugin to trigger the web-based junit tests and 
analyze

the results
2) Configure the pom.xml with cargo plugin to start an embedded Jetty
server, deploy the WAR, trigger the web-based junit tests, and stop the
server.

Now I have a complete automation. To avoid repeating the pom 
configuration

for each itest, we can add a profile in the parent pom to support this
scheme.

For Tuscany itests, we also have to figure out a way to avoid the
conflicting bootstrap in the J2SE and web.

Your feedback is welcome.

Thanks,
Raymond


--

Re: [PROPOSAL] Automate itests for WAR packaging

2008-02-02 Thread Luciano Resende
Great Raymond,

   I very interested in using this approach to automate the execution
of our iTests in a web app container. I playing a little with some
iTests to try to make them ready to use this. From my initial
investigations, I couldn't really change the packaging schema for a
given project based on a maven profile, so, I decided to create a new
webapp project, that then includes the original iTests as
dependencies, other then this, most of the configuration can be
centralized on a parent pom. I still trying to see the best way to
include the test cases, that was generated in a separate jar (a second
artifact from a given module), into the web app

BTW, Would you mind committing it so I can start playing with a
end-to-end scenario for the iTests too ?

On Feb 1, 2008 9:41 AM, Raymond Feng <[EMAIL PROTECTED]> wrote:
> Hi,
>
> (Sorry for the long text, I make it availabe on our WIKI too:
> http://cwiki.apache.org/confluence/display/TUSCANYWIKI/Automation+of+itests+in+web+applications).
>
> In our WAR packaging scheme, we package SCA artifacts with Tuscany runtime
> jars in a WAR so that it can be deployed to a web container such as Tomcat,
> Jetty or Geronimo. In release 1.1, we already have 5-6 samples as web
> applications.
>
> 1) Most of the validation of web applications is done manully before a
> release. This is time-consuming and error prone.
> 2) Our integration tests are not performed in the WAR packaging scheme.
> Trying samples is a smoke test. If we can run the itests in a web
> application, we'll get much more coverage.
>
> To address the above issues, I propose that we add the following
> capabilities:
>
> 1) Provide an option to wrap itests into web applications with little effort
> to convert the test cases
> 2) Automate the steps to start/stop a web container and deploy web
> applications to the container
> 3) Automate the testing of our JUnit-based test cases in the web application
>
> I did some prototyping and here is what I have achieved so far:
>
> 1) Add some code to
> "org.apache.tuscany.sca.host.webapp.TuscanyServletFilter"
> (tuscany-host-webapp) to intercept the HTTP requests to a special path
> "/junit". The control is then delegated to a new class WebTestRunner that
> knows how to find and run the JUNIT test cases and produce the results of
> the test (for example, number of runs, failures and errors, similar with
> what maven surefire plugin does). The report is sent back to the web client.
>
> With this, we can run the plain JUNIT test cases in the web application by
> connecting to a URL like http://localhost:8080//junit.
>
> 2) Adjust the sample-calculator-webapp to validate the idea
> * Add a test case calculator.CalculatorTestCase
> * Configure the maven-war-plugin in the pom.xml to include the test classes
> as a jar into the WAR (WEB-INF/test-lib/)
> * Change the junit dependency from test to runtime so it will be packaged
> into the WAR
>
> 3) Run the maven build as ususal, produce a WAR, deploy to Tomcat, browse to
> http://localhost:8080/sample-calculator-webapp/junit, and see the test
> results in the browser. To run a selected list of test cases,
> http://localhost:8080/sample-calculator-webapp/junit?test1,test2.
>
> This seems to be non-invasive as we already configure the servlet filter for
> web applications. The regular URLs to JSPs or web services stay the same. We
> don't have to change the test case code too much.
>
> I also went a bit further:
>
> 1) Developed a maven plugin to trigger the web-based junit tests and analyze
> the results
> 2) Configure the pom.xml with cargo plugin to start an embedded Jetty
> server, deploy the WAR, trigger the web-based junit tests, and stop the
> server.
>
> Now I have a complete automation. To avoid repeating the pom configuration
> for each itest, we can add a profile in the parent pom to support this
> scheme.
>
> For Tuscany itests, we also have to figure out a way to avoid the
> conflicting bootstrap in the J2SE and web.
>
> Your feedback is welcome.
>
> Thanks,
> Raymond
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>



-- 
Luciano Resende
Apache Tuscany Committer
http://people.apache.org/~lresende
http://lresende.blogspot.com/

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



Re: [PROPOSAL] Automate itests for WAR packaging

2008-02-02 Thread Jean-Sebastien Delfino

Raymond Feng wrote:
A quick update: I managed to get the automation working with Geronimo 
2.0.2 too using the geronimo-maven-plugin. The new pom.xml has been 
updated at the wiki page.


Thanks,
Raymond

- Original Message - From: "Raymond Feng" <[EMAIL PROTECTED]>
To: 
Sent: Friday, February 01, 2008 9:41 AM
Subject: [PROPOSAL] Automate itests for WAR packaging



Hi,

(Sorry for the long text, I make it availabe on our WIKI too: 
http://cwiki.apache.org/confluence/display/TUSCANYWIKI/Automation+of+itests+in+web+applications). 



In our WAR packaging scheme, we package SCA artifacts with Tuscany 
runtime jars in a WAR so that it can be deployed to a web container 
such as Tomcat, Jetty or Geronimo. In release 1.1, we already have 5-6 
samples as web applications.


1) Most of the validation of web applications is done manully before a 
release. This is time-consuming and error prone.
2) Our integration tests are not performed in the WAR packaging 
scheme. Trying samples is a smoke test. If we can run the itests in a 
web application, we'll get much more coverage.


To address the above issues, I propose that we add the following 
capabilities:


1) Provide an option to wrap itests into web applications with little 
effort to convert the test cases
2) Automate the steps to start/stop a web container and deploy web 
applications to the container
3) Automate the testing of our JUnit-based test cases in the web 
application


I did some prototyping and here is what I have achieved so far:

1) Add some code to 
"org.apache.tuscany.sca.host.webapp.TuscanyServletFilter" 
(tuscany-host-webapp) to intercept the HTTP requests to a special path 
"/junit". The control is then delegated to a new class WebTestRunner 
that knows how to find and run the JUNIT test cases and produce the 
results of the test (for example, number of runs, failures and errors, 
similar with what maven surefire plugin does). The report is sent back 
to the web client.


With this, we can run the plain JUNIT test cases in the web 
application by connecting to a URL like 
http://localhost:8080//junit.


2) Adjust the sample-calculator-webapp to validate the idea
* Add a test case calculator.CalculatorTestCase
* Configure the maven-war-plugin in the pom.xml to include the test 
classes as a jar into the WAR (WEB-INF/test-lib/)
* Change the junit dependency from test to runtime so it will be 
packaged into the WAR


3) Run the maven build as ususal, produce a WAR, deploy to Tomcat, 
browse to http://localhost:8080/sample-calculator-webapp/junit, and 
see the test results in the browser. To run a selected list of test 
cases, http://localhost:8080/sample-calculator-webapp/junit?test1,test2.


This seems to be non-invasive as we already configure the servlet 
filter for web applications. The regular URLs to JSPs or web services 
stay the same. We don't have to change the test case code too much.


I also went a bit further:

1) Developed a maven plugin to trigger the web-based junit tests and 
analyze the results
2) Configure the pom.xml with cargo plugin to start an embedded Jetty 
server, deploy the WAR, trigger the web-based junit tests, and stop 
the server.


Now I have a complete automation. To avoid repeating the pom 
configuration for each itest, we can add a profile in the parent pom 
to support this scheme.


For Tuscany itests, we also have to figure out a way to avoid the 
conflicting bootstrap in the J2SE and web.


Your feedback is welcome.

Thanks,
Raymond 


This overall sounds good but can you make this available in SVN for 
people to see and try?


Do you know what the Geronimo folks are doing in the Geronimo project to 
run that kind of tests?


Thanks.
--
Jean-Sebastien

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



Re: [PROPOSAL] Automate itests for WAR packaging

2008-02-01 Thread Raymond Feng
A quick update: I managed to get the automation working with Geronimo 2.0.2 
too using the geronimo-maven-plugin. The new pom.xml has been updated at the 
wiki page.


Thanks,
Raymond

- Original Message - 
From: "Raymond Feng" <[EMAIL PROTECTED]>

To: 
Sent: Friday, February 01, 2008 9:41 AM
Subject: [PROPOSAL] Automate itests for WAR packaging



Hi,

(Sorry for the long text, I make it availabe on our WIKI too: 
http://cwiki.apache.org/confluence/display/TUSCANYWIKI/Automation+of+itests+in+web+applications).


In our WAR packaging scheme, we package SCA artifacts with Tuscany runtime 
jars in a WAR so that it can be deployed to a web container such as 
Tomcat, Jetty or Geronimo. In release 1.1, we already have 5-6 samples as 
web applications.


1) Most of the validation of web applications is done manully before a 
release. This is time-consuming and error prone.
2) Our integration tests are not performed in the WAR packaging scheme. 
Trying samples is a smoke test. If we can run the itests in a web 
application, we'll get much more coverage.


To address the above issues, I propose that we add the following 
capabilities:


1) Provide an option to wrap itests into web applications with little 
effort to convert the test cases
2) Automate the steps to start/stop a web container and deploy web 
applications to the container
3) Automate the testing of our JUnit-based test cases in the web 
application


I did some prototyping and here is what I have achieved so far:

1) Add some code to 
"org.apache.tuscany.sca.host.webapp.TuscanyServletFilter" 
(tuscany-host-webapp) to intercept the HTTP requests to a special path 
"/junit". The control is then delegated to a new class WebTestRunner that 
knows how to find and run the JUNIT test cases and produce the results of 
the test (for example, number of runs, failures and errors, similar with 
what maven surefire plugin does). The report is sent back to the web 
client.


With this, we can run the plain JUNIT test cases in the web application by 
connecting to a URL like http://localhost:8080//junit.


2) Adjust the sample-calculator-webapp to validate the idea
* Add a test case calculator.CalculatorTestCase
* Configure the maven-war-plugin in the pom.xml to include the test 
classes as a jar into the WAR (WEB-INF/test-lib/)
* Change the junit dependency from test to runtime so it will be packaged 
into the WAR


3) Run the maven build as ususal, produce a WAR, deploy to Tomcat, browse 
to http://localhost:8080/sample-calculator-webapp/junit, and see the test 
results in the browser. To run a selected list of test cases, 
http://localhost:8080/sample-calculator-webapp/junit?test1,test2.


This seems to be non-invasive as we already configure the servlet filter 
for web applications. The regular URLs to JSPs or web services stay the 
same. We don't have to change the test case code too much.


I also went a bit further:

1) Developed a maven plugin to trigger the web-based junit tests and 
analyze the results
2) Configure the pom.xml with cargo plugin to start an embedded Jetty 
server, deploy the WAR, trigger the web-based junit tests, and stop the 
server.


Now I have a complete automation. To avoid repeating the pom configuration 
for each itest, we can add a profile in the parent pom to support this 
scheme.


For Tuscany itests, we also have to figure out a way to avoid the 
conflicting bootstrap in the J2SE and web.


Your feedback is welcome.

Thanks,
Raymond 



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



[PROPOSAL] Automate itests for WAR packaging

2008-02-01 Thread Raymond Feng

Hi,

(Sorry for the long text, I make it availabe on our WIKI too: 
http://cwiki.apache.org/confluence/display/TUSCANYWIKI/Automation+of+itests+in+web+applications).


In our WAR packaging scheme, we package SCA artifacts with Tuscany runtime 
jars in a WAR so that it can be deployed to a web container such as Tomcat, 
Jetty or Geronimo. In release 1.1, we already have 5-6 samples as web 
applications.


1) Most of the validation of web applications is done manully before a 
release. This is time-consuming and error prone.
2) Our integration tests are not performed in the WAR packaging scheme. 
Trying samples is a smoke test. If we can run the itests in a web 
application, we'll get much more coverage.


To address the above issues, I propose that we add the following 
capabilities:


1) Provide an option to wrap itests into web applications with little effort 
to convert the test cases
2) Automate the steps to start/stop a web container and deploy web 
applications to the container

3) Automate the testing of our JUnit-based test cases in the web application

I did some prototyping and here is what I have achieved so far:

1) Add some code to 
"org.apache.tuscany.sca.host.webapp.TuscanyServletFilter" 
(tuscany-host-webapp) to intercept the HTTP requests to a special path 
"/junit". The control is then delegated to a new class WebTestRunner that 
knows how to find and run the JUNIT test cases and produce the results of 
the test (for example, number of runs, failures and errors, similar with 
what maven surefire plugin does). The report is sent back to the web client.


With this, we can run the plain JUNIT test cases in the web application by 
connecting to a URL like http://localhost:8080//junit.


2) Adjust the sample-calculator-webapp to validate the idea
* Add a test case calculator.CalculatorTestCase
* Configure the maven-war-plugin in the pom.xml to include the test classes 
as a jar into the WAR (WEB-INF/test-lib/)
* Change the junit dependency from test to runtime so it will be packaged 
into the WAR


3) Run the maven build as ususal, produce a WAR, deploy to Tomcat, browse to 
http://localhost:8080/sample-calculator-webapp/junit, and see the test 
results in the browser. To run a selected list of test cases, 
http://localhost:8080/sample-calculator-webapp/junit?test1,test2.


This seems to be non-invasive as we already configure the servlet filter for 
web applications. The regular URLs to JSPs or web services stay the same. We 
don't have to change the test case code too much.


I also went a bit further:

1) Developed a maven plugin to trigger the web-based junit tests and analyze 
the results
2) Configure the pom.xml with cargo plugin to start an embedded Jetty 
server, deploy the WAR, trigger the web-based junit tests, and stop the 
server.


Now I have a complete automation. To avoid repeating the pom configuration 
for each itest, we can add a profile in the parent pom to support this 
scheme.


For Tuscany itests, we also have to figure out a way to avoid the 
conflicting bootstrap in the J2SE and web.


Your feedback is welcome.

Thanks,
Raymond 



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