Hi Petar,

Oops I only answered half your question.
Should get a coffee before I start work in the morning ;)

What I am doing is using the cactify war task to create a cactified war.
This is what my build.xml ant target for that looks like:

        <target name="test.prepare" depends="war, compile.cactus">
          <cactifywar srcfile="${project.build.dir}/${projectname}.war" 
destfile="${project.build.dir}/test.war">
            <servletredirector/>
            <classes dir="${project.build.dir}/test/"/>
          </cactifywar>
        </target>

The "<servletredirector/>" part I understand puts in the servlet redirector 
stuff into my web.xml like:

    <servlet>
        <servlet-name>ServletRedirector</servlet-name>
        
<servlet-class>org.apache.cactus.server.ServletTestRedirector</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>ServletRedirector</servlet-name>
        <url-pattern>/ServletRedirector</url-pattern>
    </servlet-mapping>

I got all this from:
http://jakarta.apache.org/cactus/writing/howto_security.html
under "Step 2: Securing the Cactus Redirector"

Step 1 talks about having to manually authenticate in the code but then Step 2 
says:

"If you're using the Cactus Ant tasks to execute your Cactus tests, please 
check the Cactifywar task page as the configuration below is only required for 
manual configuration and is handled automatically by the Cactifywar task."

(also ... note my cactify war ant task in my build.xml did not put the 
"ServletRedirectorSecure" stuff in my web.xml. Not sure how to do this even 
though I tried to replace:
<servletredirector/>

With:
<servletredirector name="ServletRedirectorSecure" 
mapping="/ServletRedirectorSecure" roles="myRole"/>

I also tried putting this manually into the web.xml in the cactified war but 
this still gave me the same error)

I keep thinking that I shouldn't need to authenticate, but then I keep getting 
the error:
"java.lang.IllegalStateException: No valid security context for the caller 
identity"

?


-----Original Message-----
From: Nicole Luneburg [mailto:[email protected]]
Sent: Tuesday, 6 January 2009 10:12 AM
To: Cactus Users List
Subject: RE: cactus junit authentication required?

Hi Petar,

Thanks for your reply.
Sorry I thought I did say what exception I was getting ...

"
I'm running the test from my web browser like: 
http://localhost:8080/myapp/ServletTestRunner?suite= 
myapp.tests.MyTestSuite&Cactus_Service=RUN_TEST

Doing this keeps giving me the following error:

java.lang.IllegalStateException: No valid security context for the caller 
identity
"

Thanks!
Nicole

-----Original Message-----
From: Petar Tahchiev [mailto:[email protected]]
Sent: Monday, 5 January 2009 7:27 PM
To: Cactus Users List
Subject: Re: cactus junit authentication required?

Hi Nicole,

I would be really interested in you test-case and
also the exact exception you get.

Cheers, Petar.


The contents of this email are confidential and may be subject to legal or 
professional privilege and copyright. No representation is made that this email 
is free of viruses or other defects. If you have received this communication in 
error, you may not copy or distribute any part of it or otherwise disclose its 
contents to anyone. Please advise the sender of your incorrect receipt of this 
correspondence.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]


The contents of this email are confidential and may be subject to legal or 
professional privilege and copyright. No representation is made that this email 
is free of viruses or other defects. If you have received this communication in 
error, you may not copy or distribute any part of it or otherwise disclose its 
contents to anyone. Please advise the sender of your incorrect receipt of this 
correspondence.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to