jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Scott Barber" <Scott.Bar...@benefitfocus.com>
Subject RE: Cactus / StrutsTestCase / Ant client / Weblogic
Date Sun, 27 Jul 2003 20:53:03 GMT
Martin,
	There is a 60 second delay between the deploy.cactus and test.cactus.  While playing with
it this afternoon, I have found some interesting stuff that i'm not sure how to resolve.

The request.getCallerPrincipal().getName() returns "system" when the test fails.  This is
not the user that I'm trying to authenicate as.
The CallerPrincipal is correctly set the user that i'm trying to authenticate as when the
test is successful.

I have also had the tests fail without redeploying the application WAR file.

Scott

-----Original Message-----
From: Leclerc Martin [mailto:martin_a_leclerc@yahoo.com]
Sent: Sunday, July 27, 2003 1:36 PM
To: Cactus Users List
Subject: Re: Cactus / StrutsTestCase / Ant client / Weblogic


Hi Scott, 

Is there any delay programmed between the
deploy.cactus and the test.cactus ?

WebLogic takes a few seconds to absorb a new war after
it is copied in the applications directory. I am 
guessing you are not giving enough time to webLogic.

Try cactus.deply, then watch the weblogic console to
give you the "completed" message before running the
test.cactus target...

Just my 2ยข

Martin
--- Scott Barber <Scott.Barber@benefitfocus.com>
wrote:
> I'm hoping someone can assist me with some unusual
> test results.  I have a TestCase which authenticates
> a user and asserts a couple of values.  The problem
> is the test case fails the first time it is run
> after redeploying the test WAR file.  If I run the
> test again after the failure without redeploying the
> WAR file the test now succeeds.  Any ideas would be
> appreciated.
> 
> Below is the client and server output.  This is
> happening with both the jakarta-cactus-1.5-beta1-src
> and jakarta-cactus-13-20030726 versions.
> 
> Thanks,
> Scott
> 
> <client output>
> $ ant -Dapp=hradmin build.cactus deploy.cactus
> test.cactus -DcompileJSP=false
> Buildfile: build.xml
> 
> build.cactus:
> [cactifywar] Analyzing war:
> C:\_projects\current\4x\jar\hradmin.war
> [cactifywar] Building war:
> C:\_projects\current\4x\jar\hradmintest.war
>     [unjar] Expanding:
> C:\_projects\current\4x\jar\hradmintest.war into
> C:\_projects\current\4x\jar\hradmintest
>      [copy] Copying 1 file to
>
C:\_projects\current\4x\jar\hradmintest\WEB-INF\classes
>      [copy] Copying 3 files to
> C:\_projects\current\4x\jar\hradmintest\WEB-INF\lib
>       [jar] Building jar:
> C:\_projects\current\4x\jar\hradmintest.war
>    [delete] Deleting directory
> C:\_projects\current\4x\jar\hradmintest
> 
> deploy.cactus:
>      [copy] Copying 1 file to
> C:\bea\wlserver6.1\config\mydomain\applications
> 
> test.cactus:
>    [cactus]
>
-----------------------------------------------------------------
>    [cactus] Running tests against localhost
>    [cactus]
>
-----------------------------------------------------------------
>    [cactus] Creating new ThreadManager
> Thread[main,5,main]
>    [cactus] Running
> bf.web.hradmin.action.SponsorAdminCactusTest
>    [cactus] Tests run: 1, Failures: 0, Errors: 1,
> Time elapsed: 2.814 sec
>    [cactus] Testsuite:
> bf.web.hradmin.action.SponsorAdminCactusTest
>    [cactus] Tests run: 1, Failures: 0, Errors: 1,
> Time elapsed: 2.814 sec
> 
>    [cactus] Testcase: testLogin took 2.804 sec
>    [cactus]     Caused an ERROR
>    [cactus] Failed to get the test results at
>
[http://localhost:7001/hradmintest/ServletRedirectorSecure]
>    [cactus]
> org.apache.cactus.util.ChainedRuntimeException:
> Failed to get the test results at
> [http://localhost:7001/hra
> dmintest/ServletRedirectorSecure]
>    [cactus]     at
>
org.apache.cactus.client.connector.http.DefaultHttpClient.doTest$ajcPostAround7(DefaultHttpClient.jav
> a;org/apache/cactus/util/log/LogAspect.aj(1k):131)
>    [cactus]     at
>
org.apache.cactus.client.connector.http.DefaultHttpClient.doTest(DefaultHttpClient.java;org/apache/ca
> ctus/util/log/LogAspect.aj(1k):1240)
>    [cactus]     at
>
org.apache.cactus.internal.client.WebClientTestCaseDelegate.runWebTest(WebClientTestCaseDelegate.java
> ;org/apache/cactus/util/log/LogAspect.aj(1k):334)
>    [cactus]     at
>
org.apache.cactus.internal.client.WebClientTestCaseDelegate.runGenericTest(WebClientTestCaseDelegate.
>
java;org/apache/cactus/util/log/LogAspect.aj(1k):282)
>    [cactus]     at
>
org.apache.cactus.internal.client.WebClientTestCaseDelegate.runTest(WebClientTestCaseDelegate.java;or
> g/apache/cactus/util/log/LogAspect.aj(1k):257)
>    [cactus]     at
>
org.apache.cactus.ServletTestCase.runTest(ServletTestCase.java:289)
>    [cactus]     at
>
org.apache.cactus.ServletTestCase.runBare(ServletTestCase.java:251)
>    [cactus]     at
>
org.apache.cactus.integration.ant.CactusTask.executeInContainer(CactusTask.java:412)
>    [cactus]     at
>
org.apache.cactus.integration.ant.CactusTask.execute(CactusTask.java:250)
>    [cactus]
> org.apache.cactus.client.ParsingException: Not a
> valid response [302 Moved Temporarily]
>    [cactus]     at
>
org.apache.cactus.client.connector.http.DefaultHttpClient.callGetResult(DefaultHttpClient.java;org/ap
> ache/cactus/util/log/LogAspect.aj(1k):249)
>    [cactus]     at
>
org.apache.cactus.client.connector.http.DefaultHttpClient.doTest$ajcPostAround7(DefaultHttpClient.jav
> a;org/apache/cactus/util/log/LogAspect.aj(1k):126)
>    [cactus]     at
>
org.apache.cactus.client.connector.http.DefaultHttpClient.doTest(DefaultHttpClient.java;org/apache/ca
> ctus/util/log/LogAspect.aj(1k):1240)
>    [cactus]     at
>
org.apache.cactus.internal.client.WebClientTestCaseDelegate.runWebTest(WebClientTestCaseDelegate.java
> ;org/apache/cactus/util/log/LogAspect.aj(1k):334)
>    [cactus]     at
>
org.apache.cactus.internal.client.WebClientTestCaseDelegate.runGenericTest(WebClientTestCaseDelegate.
>
java;org/apache/cactus/util/log/LogAspect.aj(1k):282)
>    [cactus]     at
>
org.apache.cactus.internal.client.WebClientTestCaseDelegate.runTest(WebClientTestCaseDelegate.java;or
> g/apache/cactus/util/log/LogAspect.aj(1k):257)
>    [cactus]     at
>
org.apache.cactus.ServletTestCase.runTest(ServletTestCase.java:289)
>    [cactus]     at
>
org.apache.cactus.ServletTestCase.runBare(ServletTestCase.java:251)
>    [cactus]     at
>
org.apache.cactus.integration.ant.CactusTask.executeInContainer(CactusTask.java:412)
>    [cactus]     at
>
org.apache.cactus.integration.ant.CactusTask.execute(CactusTask.java:250)
> 
>    [cactus] Testcase: testLogin
>    [cactus] TEST
> bf.web.hradmin.action.SponsorAdminCactusTest FAILED
> 
> BUILD FAILED
>
file:c:/_projects/current/4x/webapps/build/build.xml:482:
> No message
> 
> Total time: 2 minutes 49 seconds
> </client output>
> 
> <server output>
> 072703 11:23:53.264 [INFO ] [jsp.securityError.jsp]
> MDC[userid=, server=] JSESSION =
> 1juD7NmeSnf2MGwcYtkkGhIegH6C0uuW1Xp
>
mdgwZfJTv8CET6THE!-1986505555!-1062731369!7001!7002!1059319427725
> 072703 11:23:53.284 [WARN ] [bf.web.common.Session]
> MDC[userid=, server=] privateLabel object not in
> session, returning
> DefaultPrivateLabel
> 072703 11:24:00.555 [DEBUG]
> [org.apache.cactus.server.ServletTestRedirector]
> MDC[userid=, server=] <doGet([Http Request:
>  /hradmintest/ServletRedirectorSecure],
>
[weblogic.servlet.internal.ServletResponseImpl@397214])
> 072703 11:24:00.565 [DEBUG]
> [org.apache.cactus.server.ServletTestRedirector]
> MDC[userid=, server=] <doPost([Http Request
> : /hradmintest/ServletRedirectorSecure],
>
[weblogic.servlet.internal.ServletResponseImpl@397214])
> 072703 11:24:00.565 [DEBUG]
> [org.apache.cactus.server.ServletTestRedirector]
> MDC[userid=, server=] ------------- Start S
> ervlet service
> 072703 11:24:00.585 [DEBUG]
> [org.apache.cactus.server.ServletImplicitObjects]
> MDC[userid=, server=] <setHttpServletReque
> st([Http Request:
> /hradmintest/ServletRedirectorSecure])
> 072703 11:24:00.585 [DEBUG]
> [org.apache.cactus.server.ServletImplicitObjects]
> MDC[userid=, server=] >setHttpServletReque
> st
> 072703 11:24:00.585 [DEBUG]
> [org.apache.cactus.server.ServletImplicitObjects]
> MDC[userid=, server=] <setHttpServletRespo
>
nse([weblogic.servlet.internal.ServletResponseImpl@397214])
> 072703 11:24:00.585 [DEBUG]
> [org.apache.cactus.server.ServletImplicitObjects]
> MDC[userid=, server=] >setHttpServletRespo
> nse
> 072703 11:24:00.585 [DEBUG]
> [org.apache.cactus.server.ServletImplicitObjects]
> MDC[userid=, server=] <setServletContext([
>
WebAppServletContext(1961586,hradmintest,/hradmintest)])
> 072703 11:24:00.585 [DEBUG]
> [org.apache.cactus.server.ServletImplicitObjects]
> MDC[userid=, server=] >setServletContext
> 072703 11:24:00.595 [DEBUG]
> [org.apache.cactus.server.ServletImplicitObjects]
> MDC[userid=, server=] <setServletConfig([S
>
ervletStub(ServletRedirectorSecure,org.apache.cactus.server.ServletTestRedirector)])
> 072703 11:24:00.595 [DEBUG]
> [org.apache.cactus.server.ServletImplicitObjects]
> MDC[userid=, server=] >setServletConfig
> 072703 11:24:00.625 [DEBUG]
> [org.apache.cactus.server.ServletTestController]
> MDC[userid=, server=] <handleRequest([org.a
> pache.cactus.server.ServletImplicitObjects@7088e8])
> 072703 11:24:00.635 [DEBUG]
> [org.apache.cactus.server.ServletUtil] MDC[userid=,
> server=] <getQueryStringParameter([Cactu
>
s_TestMethod=testLogin&Cactus_TestClass=bf.web.hradmin.action.SponsorAdminCactusTest&Cactus_AutomaticSession=true&Cactus
> _Service=CALL_TEST], [Cactus_Service])
> 072703 11:24:00.635 [DEBUG]
> [org.apache.cactus.server.ServletUtil] MDC[userid=,
> server=] >getQueryStringParameter = [CAL
> L_TEST]
> 072703 11:24:00.635 [DEBUG]
> [org.apache.cactus.server.AbstractWebTestController]
> MDC[userid=, 
=== message truncated ===


=====
Martin Leclerc
Franc-Nord Informatique
martin@francnord.com
+1 (514) 572-0343

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: cactus-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: cactus-user-help@jakarta.apache.org


Mime
View raw message