FormAuthentication and Error Code 500

2004-11-18 Thread Setanta Mathews
Hi All,
 
I've just started using cactus and I am having a problem getting the
FormAuthentication working properly. I searched the web and mailing lists
already and couldn't find a solution.
 
My begin method for my test method A looks like:
 
public void beginA(WebRequest theRequest)
{
theRequest.setRedirectorName(ServletRedirectorSecure);
FormAuthentication fa = new FormAuthentication(0,
qUqP5cyxm6YcTAhz05Hph5gvu9M=);
theRequest.setAuthentication(fa);
}
 
I can confirm that the ServletRedirectorSecure is configured as a secure
resource in my web.xml.
 
The problem I'm having is that I'm getting the following exception on the
client side when I try to run the test with the Cactus ant task (this is
pulled from the XML log generated by the task):
 
org.apache.commons.httpclient.HttpRecoverableException:
org.apache.commons.httpclient.HttpRecoverableException: Error in parsing the
status  line from the response: unable to find line starting with
quot;HTTPquot;
at
org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.jav
a:1892)
 
 
The HTTP traffic is
 
1 - Cactus Request
 
GET /ServletRedirectorSecure? HTTP/1.1
Content-type: application/x-www-form-urlencoded
User-Agent: Jakarta Commons-HttpClient/2.0rc1
Host: localhost:8889
 
2 - OC4J Response
 
HTTP/1.1 200 OK
Date: Thu, 18 Nov 2004 10:43:46 GMT
Server: Oracle9iAS (9.0.3.0.0) Containers for J2EE
Content-Location:
http://localhost:8889/jsp/html/portlet/my_account/j_login.jsp
Set-Cookie: JSESSIONID=b3eabbf09d734b998c79d15602741b8c; Path=/
Connection: Close
Content-Type: text/html;charset=ISO-8859-1
Cache-Control: no-cache
Transfer-Encoding: chunked
 
3 - Cactus Request
 
POST /j_security_check? HTTP/1.1
Content-type: application/x-www-form-urlencoded
User-Agent: Jakarta Commons-HttpClient/2.0rc1
Host: localhost:8889
Cookie: $Version=0; JSESSIONID=b3eabbf09d734b998c79d15602741b8c
Content-Length: 54
 
j_username=0j_password=qUqP5cyxm6YcTAhz05Hph5gvu9M%3D
 
4 - OC4J Response
 
HTTP/1.1 100 Continue
Server: Oracle9iAS (9.0.3.0.0) Containers for J2EE
Date: Thu, 18 Nov 2004 10:43:47 GMT
 
 
The HTTP traffic would suggest that the authentication has been successful
but cactus doesn't get a response that it expects.
 
Any help would be greatly appreciated,
 
Thanks,
 
Setanta Mathews.
 
 
 
P.S. The full stack trace of the exception is:
 
org.apache.cactus.util.ChainedRuntimeException: Failed to authenticate the
principal
at
org.apache.cactus.client.authentication.FormAuthentication.authenticate_arou
ndBody10(FormAuthentication.java:383)
at
org.apache.cactus.client.authentication.FormAuthentication.authenticate_arou
ndBody11$advice(FormAuthentication.java:117)
at
org.apache.cactus.client.authentication.FormAuthentication.authenticate(Form
Authentication.java)
at
org.apache.cactus.client.authentication.FormAuthentication.configure_aroundB
ody0(FormAuthentication.java:105)
at
org.apache.cactus.client.authentication.FormAuthentication.configure_aroundB
ody1$advice(FormAuthentication.java:117)
at
org.apache.cactus.client.authentication.FormAuthentication.configure(FormAut
hentication.java)
at
org.apache.cactus.internal.client.connector.http.HttpClientConnectionHelper.
connect_aroundBody0(HttpClientConnectionHelper.java:103)
at
org.apache.cactus.internal.client.connector.http.HttpClientConnectionHelper.
connect_aroundBody1$advice(HttpClientConnectionHelper.java:188)
at
org.apache.cactus.internal.client.connector.http.HttpClientConnectionHelper.
connect(HttpClientConnectionHelper.java)
at
org.apache.cactus.internal.client.connector.http.DefaultHttpClient.callRunTe
st(DefaultHttpClient.java:162)
at
org.apache.cactus.internal.client.connector.http.DefaultHttpClient.doTest_ar
oundBody0(DefaultHttpClient.java:80)
at
org.apache.cactus.internal.client.connector.http.DefaultHttpClient.doTest_ar
oundBody1$advice(DefaultHttpClient.java:188)
at
org.apache.cactus.internal.client.connector.http.DefaultHttpClient.doTest(De
faultHttpClient.java)
at
org.apache.cactus.internal.client.connector.http.HttpProtocolHandler.runWebT
est(HttpProtocolHandler.java:159)
at
org.apache.cactus.internal.client.connector.http.HttpProtocolHandler.runTest
_aroundBody0(HttpProtocolHandler.java:80)
at
org.apache.cactus.internal.client.connector.http.HttpProtocolHandler.runTest
_aroundBody1$advice(HttpProtocolHandler.java:188)
at
org.apache.cactus.internal.client.connector.http.HttpProtocolHandler.runTest
(HttpProtocolHandler.java)
at
org.apache.cactus.internal.client.ClientTestCaseCaller.runTest(ClientTestCas
eCaller.java:144)
at
org.apache.cactus.internal.AbstractCactusTestCase.runBareClient(AbstractCact
usTestCase.java:215)
at
org.apache.cactus.internal.AbstractCactusTestCase.runBare(AbstractCactusTest

Re: FormAuthentication and Error Code 500

2004-11-18 Thread Kazuhito SUGURI
Hi Setanta,

In article [EMAIL PROTECTED],
Thu, 18 Nov 2004 11:03:53 -,
Setanta Mathews [EMAIL PROTECTED] wrote: 
smathews public void beginA(WebRequest theRequest)
smathews {
smathews theRequest.setRedirectorName(ServletRedirectorSecure);
smathews FormAuthentication fa = new FormAuthentication(0,
smathews qUqP5cyxm6YcTAhz05Hph5gvu9M=);
smathews theRequest.setAuthentication(fa);
smathews }

Is the password qUqP5cyxm6YcTAhz05Hph5gvu9M= base-64 encoded?
Your system may stores passwords with encrypted and base-64 encoded form,
however, you should give a password with plain text form to the system.
So, you should pass a plain password to the constructor, I guess.


smathews The HTTP traffic is
smathews  
smathews 1 - Cactus Request
smathews  
smathews GET /ServletRedirectorSecure? HTTP/1.1
smathews Content-type: application/x-www-form-urlencoded
smathews User-Agent: Jakarta Commons-HttpClient/2.0rc1
smathews Host: localhost:8889
smathews  
smathews 2 - OC4J Response
smathews  
smathews HTTP/1.1 200 OK
smathews Date: Thu, 18 Nov 2004 10:43:46 GMT
smathews Server: Oracle9iAS (9.0.3.0.0) Containers for J2EE
smathews Content-Location:
smathews http://localhost:8889/jsp/html/portlet/my_account/j_login.jsp
smathews Set-Cookie: JSESSIONID=b3eabbf09d734b998c79d15602741b8c; Path=/
smathews Connection: Close
smathews Content-Type: text/html;charset=ISO-8859-1
smathews Cache-Control: no-cache
smathews Transfer-Encoding: chunked
smathews  
smathews 3 - Cactus Request
smathews  
smathews POST /j_security_check? HTTP/1.1
smathews Content-type: application/x-www-form-urlencoded
smathews User-Agent: Jakarta Commons-HttpClient/2.0rc1
smathews Host: localhost:8889
smathews Cookie: $Version=0; JSESSIONID=b3eabbf09d734b998c79d15602741b8c
smathews Content-Length: 54
smathews  
smathews j_username=0j_password=qUqP5cyxm6YcTAhz05Hph5gvu9M%3D
smathews  
smathews 4 - OC4J Response
smathews  
smathews HTTP/1.1 100 Continue
smathews Server: Oracle9iAS (9.0.3.0.0) Containers for J2EE
smathews Date: Thu, 18 Nov 2004 10:43:47 GMT

The last response means that the authentication is not completed.
I'm not sure why your container responses with status 100, however,
this may make your case, i.e. unable to find line starting with HTTP.

Regards,

Kazuhito SUGURI
mailto:[EMAIL PROTECTED]

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



RE: FormAuthentication and Error Code 500

2004-11-18 Thread Setanta Mathews
Hi,

Thanks for the reply.

I think the password is okay. If I change it to something else I get a 403
(forbidden) error response code:

java.lang.Exception: Received a status code [403] and was expecting a [302]

Now things get a little bit strange ... 

I think the HTTP sniffer I was using (HTTPLook) might have somehow been
interfering with HTTP traffic. After turning it off and running my test
again I got the following cactus error:

java.lang.Exception: Received a status code [500] and was expecting a [302]

And in my OC4J application.log you can see that the 500 Error was caused by
something I've seen in mailing list archives quite a bit:

javax.servlet.ServletException: Missing service name parameter
[Cactus_Service] in HTTP request. Received query string is [].

Now, if I change by begin method to expect a response code of 500 ...

public void beginA(WebRequest theRequest)
{
theRequest.setRedirectorName(ServletRedirectorSecure);
FormAuthentication fa = new FormAuthentication(0,
qUqP5cyxm6YcTAhz05Hph5gvu9M=);
fa.setExpectedAuthResponse(500);
theRequest.setAuthentication(fa);
}


... guess what? The test runs fine. I'm still getting the application error
but I'm guessing that's because something in the web-app (I've only just
started working on it and I'm not too familiar with it just yet) tries to
process the original request to the ServletRedirectorSecure and there was no
Cactus_Service request parameter.

Out of curiosity I set the redirector name to the following in my begin
method:

theRequest.setRedirectorName(ServletRedirectorSecure?Cactus_Service=GET_VER
SION);

But I still get the 500 error.

Anyway, if a call to setExpectedAuthResponse(500) gets my tests running then
I'm happy for the time being.

Thanks,

Setanta.


-Original Message-
From: Kazuhito SUGURI [mailto:[EMAIL PROTECTED] 
Sent: 18 November 2004 11:22
To: [EMAIL PROTECTED]
Subject: Re: FormAuthentication and Error Code 500

Hi Setanta,

In article [EMAIL PROTECTED],
Thu, 18 Nov 2004 11:03:53 -,
Setanta Mathews [EMAIL PROTECTED] wrote: 
smathews public void beginA(WebRequest theRequest)
smathews {
smathews
theRequest.setRedirectorName(ServletRedirectorSecure);
smathews FormAuthentication fa = new FormAuthentication(0,
smathews qUqP5cyxm6YcTAhz05Hph5gvu9M=);
smathews theRequest.setAuthentication(fa);
smathews }

Is the password qUqP5cyxm6YcTAhz05Hph5gvu9M= base-64 encoded?
Your system may stores passwords with encrypted and base-64 encoded form,
however, you should give a password with plain text form to the system.
So, you should pass a plain password to the constructor, I guess.


smathews The HTTP traffic is
smathews  
smathews 1 - Cactus Request
smathews  
smathews GET /ServletRedirectorSecure? HTTP/1.1
smathews Content-type: application/x-www-form-urlencoded
smathews User-Agent: Jakarta Commons-HttpClient/2.0rc1
smathews Host: localhost:8889
smathews  
smathews 2 - OC4J Response
smathews  
smathews HTTP/1.1 200 OK
smathews Date: Thu, 18 Nov 2004 10:43:46 GMT
smathews Server: Oracle9iAS (9.0.3.0.0) Containers for J2EE
smathews Content-Location:
smathews http://localhost:8889/jsp/html/portlet/my_account/j_login.jsp
smathews Set-Cookie: JSESSIONID=b3eabbf09d734b998c79d15602741b8c; Path=/
smathews Connection: Close
smathews Content-Type: text/html;charset=ISO-8859-1
smathews Cache-Control: no-cache
smathews Transfer-Encoding: chunked
smathews  
smathews 3 - Cactus Request
smathews  
smathews POST /j_security_check? HTTP/1.1
smathews Content-type: application/x-www-form-urlencoded
smathews User-Agent: Jakarta Commons-HttpClient/2.0rc1
smathews Host: localhost:8889
smathews Cookie: $Version=0; JSESSIONID=b3eabbf09d734b998c79d15602741b8c
smathews Content-Length: 54
smathews  
smathews j_username=0j_password=qUqP5cyxm6YcTAhz05Hph5gvu9M%3D
smathews  
smathews 4 - OC4J Response
smathews  
smathews HTTP/1.1 100 Continue
smathews Server: Oracle9iAS (9.0.3.0.0) Containers for J2EE
smathews Date: Thu, 18 Nov 2004 10:43:47 GMT

The last response means that the authentication is not completed.
I'm not sure why your container responses with status 100, however,
this may make your case, i.e. unable to find line starting with HTTP.

Regards,

Kazuhito SUGURI
mailto:[EMAIL PROTECTED]

-
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: FormAuthentication and Error Code 500

2004-11-18 Thread Kazuhito SUGURI
Hi Setanta,

In article [EMAIL PROTECTED],
Thu, 18 Nov 2004 11:56:27 -,
Setanta Mathews [EMAIL PROTECTED] wrote: 
smathews I think the password is okay. If I change it to something else I get 
a 403
smathews (forbidden) error response code:

Can you access to a secured resource from your browser
as a user account you are coded in beginA method?

First of all, we need to know an account (id and password)
which is available in the system.


smathews Now, if I change by begin method to expect a response code of 500 ...
smathews 
smathews public void beginA(WebRequest theRequest)
smathews {
smathews   theRequest.setRedirectorName(ServletRedirectorSecure);
smathews   FormAuthentication fa = new FormAuthentication(0,
smathews qUqP5cyxm6YcTAhz05Hph5gvu9M=);
smathews   fa.setExpectedAuthResponse(500);
smathews   theRequest.setAuthentication(fa);
smathews }

I strongly suggest, don't try this approach.
# need some protection logic in setExpectedAuthResponse()?

Regards,

Kazuhito SUGURI
mailto:[EMAIL PROTECTED]

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



RE: FormAuthentication and Error Code 500

2004-11-18 Thread Setanta Mathews
Hi,

The username and password are fine. I know they might look a bit odd but
they're valid. The user login page of the webapp takes in an e-mail address
and a password. It then posts to a struts action that gets the user id,
based on the email address, encrypts the password and then forwards on to a
page that automatically submits a form called j_security_check with
j_username and j_password set appropriately.

The authentication must be working. Part of the test in question calls an
EJB that does the following check:

principal = sessionContext.getCallerPrincipal();
name = principal.getName();
System.out.println(User Id:  + name);
if (name.equals(anonymous) || name.equals(guest))
throw new PrincipalException(Principal must be authenticated);

Without the begin method in my test the principal name is guest and a
PrincipalException will be thrown. With the begin method the principal name
is 0 (so authentication must have happened) and no exception is thrown.

If I get the time I'll trace through what exactly is going on in the server
and post back to this list. I agree that setting the expected response code
to 500 is dangerous but I can't spend too much more time trying to get my
tests running.

Thanks,

Setanta.



-Original Message-
From: Kazuhito SUGURI [mailto:[EMAIL PROTECTED] 
Sent: 18 November 2004 12:18
To: [EMAIL PROTECTED]
Subject: Re: FormAuthentication and Error Code 500

Hi Setanta,

In article [EMAIL PROTECTED],
Thu, 18 Nov 2004 11:56:27 -,
Setanta Mathews [EMAIL PROTECTED] wrote: 
smathews I think the password is okay. If I change it to something else I
get a 403
smathews (forbidden) error response code:

Can you access to a secured resource from your browser
as a user account you are coded in beginA method?

First of all, we need to know an account (id and password)
which is available in the system.


smathews Now, if I change by begin method to expect a response code of 500
...
smathews 
smathews public void beginA(WebRequest theRequest)
smathews {
smathews   theRequest.setRedirectorName(ServletRedirectorSecure);
smathews   FormAuthentication fa = new FormAuthentication(0,
smathews qUqP5cyxm6YcTAhz05Hph5gvu9M=);
smathews   fa.setExpectedAuthResponse(500);
smathews   theRequest.setAuthentication(fa);
smathews }

I strongly suggest, don't try this approach.
# need some protection logic in setExpectedAuthResponse()?

Regards,

Kazuhito SUGURI
mailto:[EMAIL PROTECTED]

-
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: Clovering Cactus tests with Maven

2004-11-18 Thread Darren Hartford
Hey all,
Trying to get Clover reports on some Cactus tests.  I caught the question about 
clover with test-ear, but I'm not that far (yet).

In just trying to follow some previous directions (below), I'm running 
Maven-1.0.1 release (which has the Clover-1.6 plugin) and cactus-1.7dev.

Following the directions, when I run maven clover:report, the clover plugin 
errors saying you need to run 'clover-setup' first. Well, that's a clover 
problem, but still a show-stopper for step-by-step execution.  

Moving foward, doing something like maven clover:on site to do it all at once 
with the clover-report-plugin in the maven POM goes through. The Cactus tests 
are run and I see the results, the cactus-report comes out fine, but a clover 
report is never created (I don't have any Junit tests, just Cactus).

snip
[cactus] Testcase: blah1 took 0.515 sec
[cactus] Testcase: blah2 took 0.031 sec
[cactus] Shutdown message has been posted to the server.
[cactus] Server shutdown may take a while - check logfiles for completion

.

[echo] Generating the Clover...
maven-clover-plugin:report:
clover:test:
[echo] No tests to run Clover on

clover:init:
Overriding previous definition of reference to clover.classpath

clover:report:
clover:html-report-internal:
[clover-report] Clover Version 1.3_01, built on July 09 2004
[clover-report] loaded from: C:\Documents and Settings\dhartford\.maven\repo
sitory\clover\jars\clover-ant-1.3_01.jar
[clover-report] No coverage data found for 'C:\projects\cpams\cpamsserver3\e
jb_session\target\clover\database\clover_coverage.db'.
[clover-report] No coverage recordings found. No report will be generated.
===end snip

My code is compiled/inspected with Clover, and I see all the classes in 
/target/clover/classes (minus the cactus-tests), so at least that part is 
working.  Beyond that, I'm not sure what next to check.

-D

 -Original Message-
 From: Vincent Massol [mailto:[EMAIL PROTECTED]
 Sent: Friday, July 16, 2004 7:18 AM
 To: 'Maven Users List'
 Cc: 'Cactus Users List'
 Subject: [Summary] Clovering Cactus tests with Maven
 
 
 Hi,
 
 Some of you asked how to run Clover on Cactus tests. I tried 
 to do it and
 found that indeed there were some issues. I've now modified 
 the Maven Clover
 plugin so that it is possible to Clover Cactus tests. 
 
 You'll need to do the following:
 
 1/ Use at least version 1.6 of the Maven Clover report. ATM, 
 it is not yet
 released so you'll have to build it from the source (CVS HEAD on
 maven-plugins module).
 
 2/ In the Maven project used to execute the Cactus tests, add 
 a dependency
 to Clover:
 
dependency
  groupIdclover/groupId
  artifactIdclover-ant/artifactId
  version1.3_01/version
  properties
cactus.bundletrue/cactus.bundle
  /properties
/dependency
 
 3/ Then type maven clean clover:on cactus. This instruments both the
 project's source code + its Cactus tests
 
 4/ Once it is finished, type maven clover:report to 
 generate the HTML
 Clover report. It will be located in target/docs/clover/index.html
 
 -Vincent
 
 

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



Réf. : RE: Clovering Cactus tests with Maven

2004-11-18 Thread Nicolas . CHALUMEAU
If my memory is good it was disgust before on the list.
I think you have to do something like for generating the clover report:
maven clover:on cactus clover:report

Nicolas





Darren Hartford [EMAIL PROTECTED]
18/11/2004 16:24
Veuillez répondre à Cactus Users List

 
Pour :  Cactus Users List [EMAIL PROTECTED]
cc : 
Objet : RE: Clovering Cactus tests with Maven


Hey all,
Trying to get Clover reports on some Cactus tests.  I caught the question 
about clover with test-ear, but I'm not that far (yet).

In just trying to follow some previous directions (below), I'm running 
Maven-1.0.1 release (which has the Clover-1.6 plugin) and cactus-1.7dev.

Following the directions, when I run maven clover:report, the clover 
plugin errors saying you need to run 'clover-setup' first. Well, that's a 
clover problem, but still a show-stopper for step-by-step execution. 

Moving foward, doing something like maven clover:on site to do it all at 
once with the clover-report-plugin in the maven POM goes through. The 
Cactus tests are run and I see the results, the cactus-report comes out 
fine, but a clover report is never created (I don't have any Junit tests, 
just Cactus).

snip
[cactus] Testcase: blah1 took 0.515 sec
[cactus] Testcase: blah2 took 0.031 sec
[cactus] Shutdown message has been posted to the server.
[cactus] Server shutdown may take a while - check logfiles for 
completion

.

[echo] Generating the Clover...
maven-clover-plugin:report:
clover:test:
[echo] No tests to run Clover on

clover:init:
Overriding previous definition of reference to clover.classpath

clover:report:
clover:html-report-internal:
[clover-report] Clover Version 1.3_01, built on July 09 2004
[clover-report] loaded from: C:\Documents and 
Settings\dhartford\.maven\repo
sitory\clover\jars\clover-ant-1.3_01.jar
[clover-report] No coverage data found for 
'C:\projects\cpams\cpamsserver3\e
jb_session\target\clover\database\clover_coverage.db'.
[clover-report] No coverage recordings found. No report will be 
generated.
===end snip

My code is compiled/inspected with Clover, and I see all the classes in 
/target/clover/classes (minus the cactus-tests), so at least that part is 
working.  Beyond that, I'm not sure what next to check.

-D

 -Original Message-
 From: Vincent Massol [mailto:[EMAIL PROTECTED]
 Sent: Friday, July 16, 2004 7:18 AM
 To: 'Maven Users List'
 Cc: 'Cactus Users List'
 Subject: [Summary] Clovering Cactus tests with Maven
 
 
 Hi,
 
 Some of you asked how to run Clover on Cactus tests. I tried 
 to do it and
 found that indeed there were some issues. I've now modified 
 the Maven Clover
 plugin so that it is possible to Clover Cactus tests. 
 
 You'll need to do the following:
 
 1/ Use at least version 1.6 of the Maven Clover report. ATM, 
 it is not yet
 released so you'll have to build it from the source (CVS HEAD on
 maven-plugins module).
 
 2/ In the Maven project used to execute the Cactus tests, add 
 a dependency
 to Clover:
 
dependency
  groupIdclover/groupId
  artifactIdclover-ant/artifactId
  version1.3_01/version
  properties
cactus.bundletrue/cactus.bundle
  /properties
/dependency
 
 3/ Then type maven clean clover:on cactus. This instruments both the
 project's source code + its Cactus tests
 
 4/ Once it is finished, type maven clover:report to 
 generate the HTML
 Clover report. It will be located in target/docs/clover/index.html
 
 -Vincent
 
 

-
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: Réf. : RE: Clovering Cactus tests with Maven

2004-11-18 Thread Vincent Massol
Yes, that's right. You need the clover:report part

-Vincent

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
 trelaze.com]
 Sent: jeudi 18 novembre 2004 16:31
 To: Cactus Users List
 Subject: Réf. : RE: Clovering Cactus tests with Maven
 
 If my memory is good it was disgust before on the list.
 I think you have to do something like for generating the clover report:
 maven clover:on cactus clover:report
 
 Nicolas
 
 
 
 
 
 Darren Hartford [EMAIL PROTECTED]
 18/11/2004 16:24
 Veuillez répondre à Cactus Users List
 
 
 Pour :  Cactus Users List [EMAIL PROTECTED]
 cc :
 Objet : RE: Clovering Cactus tests with Maven
 
 
 Hey all,
 Trying to get Clover reports on some Cactus tests.  I caught the question
 about clover with test-ear, but I'm not that far (yet).
 
 In just trying to follow some previous directions (below), I'm running
 Maven-1.0.1 release (which has the Clover-1.6 plugin) and cactus-1.7dev.
 
 Following the directions, when I run maven clover:report, the clover
 plugin errors saying you need to run 'clover-setup' first. Well, that's a
 clover problem, but still a show-stopper for step-by-step execution.
 
 Moving foward, doing something like maven clover:on site to do it all at
 once with the clover-report-plugin in the maven POM goes through. The
 Cactus tests are run and I see the results, the cactus-report comes out
 fine, but a clover report is never created (I don't have any Junit tests,
 just Cactus).
 
 snip
 [cactus] Testcase: blah1 took 0.515 sec
 [cactus] Testcase: blah2 took 0.031 sec
 [cactus] Shutdown message has been posted to the server.
 [cactus] Server shutdown may take a while - check logfiles for
 completion
 
 .
 
 [echo] Generating the Clover...
 maven-clover-plugin:report:
 clover:test:
 [echo] No tests to run Clover on
 
 clover:init:
 Overriding previous definition of reference to clover.classpath
 
 clover:report:
 clover:html-report-internal:
 [clover-report] Clover Version 1.3_01, built on July 09 2004
 [clover-report] loaded from: C:\Documents and
 Settings\dhartford\.maven\repo
 sitory\clover\jars\clover-ant-1.3_01.jar
 [clover-report] No coverage data found for
 'C:\projects\cpams\cpamsserver3\e
 jb_session\target\clover\database\clover_coverage.db'.
 [clover-report] No coverage recordings found. No report will be
 generated.
 ===end snip
 
 My code is compiled/inspected with Clover, and I see all the classes in
 /target/clover/classes (minus the cactus-tests), so at least that part is
 working.  Beyond that, I'm not sure what next to check.
 
 -D
 
  -Original Message-
  From: Vincent Massol [mailto:[EMAIL PROTECTED]
  Sent: Friday, July 16, 2004 7:18 AM
  To: 'Maven Users List'
  Cc: 'Cactus Users List'
  Subject: [Summary] Clovering Cactus tests with Maven
 
 
  Hi,
 
  Some of you asked how to run Clover on Cactus tests. I tried
  to do it and
  found that indeed there were some issues. I've now modified
  the Maven Clover
  plugin so that it is possible to Clover Cactus tests.
 
  You'll need to do the following:
 
  1/ Use at least version 1.6 of the Maven Clover report. ATM,
  it is not yet
  released so you'll have to build it from the source (CVS HEAD on
  maven-plugins module).
 
  2/ In the Maven project used to execute the Cactus tests, add
  a dependency
  to Clover:
 
 dependency
   groupIdclover/groupId
   artifactIdclover-ant/artifactId
   version1.3_01/version
   properties
 cactus.bundletrue/cactus.bundle
   /properties
 /dependency
 
  3/ Then type maven clean clover:on cactus. This instruments both the
  project's source code + its Cactus tests
 
  4/ Once it is finished, type maven clover:report to
  generate the HTML
  Clover report. It will be located in target/docs/clover/index.html
 
  -Vincent
 
 
 
 -
 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]



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



Infinite Recursion when using suite method in cactus

2004-11-18 Thread tanmay_ambre
Hi,
 
I have written a TestSuite which has a public static Test suite() method
in it. The method implementation is as follows:
 
public static Test suite()
{
ServletTestSuite suite = new ServletTestSuite();
suite.addTest(new TestCactusDelegate(testGetCustInfo));
return suite();
}
 
Whenever I try running this test case using Browser Integration or Ant
integration, the program goes in an infinite recursive loop. 
 
For running the unittests I use the following jars in the classpath. I
also use cactifywar to create a war file for unit testing. The app
server is Weblogic 8.1
 
aspectjrt-1.1.1.jar
cactus-1.6.1.jar
cactus-ant-1.6.1.jar
commons-httpclient-2.0.2.jar
commons-logging-1.0.3.jar
httpunit-1.5.4.jar
junit-3.8.1.jar
nekohtml-0.7.4.jar
 
 
Following is the trace from a log file. This trace gets repeated
infinitely.
 
 
[DEBUG][org.apache.cactus.internal.server.ServerTestCaseCaller]:
setDelegatedTest([testGetCustInfo(be.telenet.unittest.testcactus.testwe
bclient.testdelegate.TestCactusDelegate)])
[DEBUG][org.apache.cactus.internal.server.ServerTestCaseCaller]:
setDelegatedTest
[DEBUG][org.apache.cactus.internal.server.ServerTestCaseCaller]:
setWrappedTest([null])
[DEBUG][org.apache.cactus.internal.server.ServerTestCaseCaller]:
setWrappedTest
[DEBUG][org.apache.cactus.ServletTestSuite]:
addTest([testGetCustInfo(be.telenet.unittest.testcactus.testwebclient.t
estdelegate.TestCactusDelegate)])
[DEBUG][org.apache.cactus.ServletTestSuite]: addTest
 
[DEBUG][org.apache.cactus.internal.server.ServerTestCaseCaller]:
setDelegatedTest([testGetCustInfo(be.telenet.unittest.testcactus.testwe
bclient.testdelegate.TestCactusDelegate)])
[DEBUG][org.apache.cactus.internal.server.ServerTestCaseCaller]:
setDelegatedTest
[DEBUG][org.apache.cactus.internal.server.ServerTestCaseCaller]:
setWrappedTest([null])
[DEBUG][org.apache.cactus.internal.server.ServerTestCaseCaller]:
setWrappedTest
[DEBUG][org.apache.cactus.ServletTestSuite]:
addTest([testGetCustInfo(be.telenet.unittest.testcactus.testwebclient.t
estdelegate.TestCactusDelegate)])
[DEBUG][org.apache.cactus.ServletTestSuite]: addTest
 
[DEBUG][org.apache.cactus.internal.server.ServerTestCaseCaller]:
setDelegatedTest([testGetCustInfo(be.telenet.unittest.testcactus.testwe
bclient.testdelegate.TestCactusDelegate)])
[DEBUG][org.apache.cactus.internal.server.ServerTestCaseCaller]:
setDelegatedTest
[DEBUG][org.apache.cactus.internal.server.ServerTestCaseCaller]:
setWrappedTest([null])
[DEBUG][org.apache.cactus.internal.server.ServerTestCaseCaller]:
setWrappedTest
[DEBUG][org.apache.cactus.ServletTestSuite]:
addTest([testGetCustInfo(be.telenet.unittest.testcactus.testwebclient.t
estdelegate.TestCactusDelegate)])
[DEBUG][org.apache.cactus.ServletTestSuite]: addTest
 
Warm Regards,
 
tanmay ambre,
Infosys Technologies Ltd,
Pune, India.
 
(O) +91-20-22973681
(m) +91-9850414331