You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cactus-user@jakarta.apache.org by Vincent Massol <vm...@pivolis.com> on 2003/08/09 21:52:20 UTC

RE: Cactus / StrutsTestCase / Ant client / Weblogic

Hi Scott,

> -----Original Message-----
> From: Scott Barber [mailto:Scott.Barber@benefitfocus.com]
> Sent: 27 July 2003 17:30
> To: cactus-user@jakarta.apache.org
> Subject: Cactus / StrutsTestCase / Ant client / Weblogic
> 
> 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
> 

It seems you're unjarring the cactified war to add some stuff to it.
There's a better way to do it. The cactifywar task actually inherits
from the Ant war task so you can use all feature of the war task. For
example

<cactifywar [...]

  <lib dir="...">
    <include name="..."/>
  </lib>
  <classes dir="...">
    <include name="..."/>
  </classes>
</cactifywar>

That will win you several seconds (no need to unjar and rejar).

> 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]

haha... it seems the answer is below in the stack trace...

[snip]

>    [cactus] org.apache.cactus.client.ParsingException: Not a valid
> response [302 Moved Temporarily]

So the server is answering by a 302... That's strange. An authentication
issue would have given a 4xxx error code...

Maybe, as Martin has suggested it is simply because the deployment has
not finished. Are you performing hot deployment (i.e. is the server
running when you copy the war file to
C:\bea\wlserver6.1\config\mydomain\applications)?

[snip]

-Vincent