Get your CodeRanch badge!*
The moose likes Testing and the fly likes Cactus authentication Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Testing
Bookmark "Cactus authentication" Watch "Cactus authentication" New topic
Author

Cactus authentication

craig a chapman
Greenhorn

Joined: Jun 24, 2005
Posts: 27
I'm trying to run some server side tests using cactus. I am deploying the app to tomcat 5.5 and am using the Ant cactifywar and cactus tasks to do this. My web app uses basic authentication. When I run my tests, the URL

"http://localhost:8080/myapp/ServletRedirector?Cactus_service=RUN_TEST"

returns a 401 (unauthorized) response. If I open that URL in a browser, I am prompted for the username and password. Where do I set the username and password properties in order to run the tests?
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Hereyago:
Passing credentials in beginXXX()


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
craig a chapman
Greenhorn

Joined: Jun 24, 2005
Posts: 27
Thanks for that, however I have read that previously and still haven't conquered the problem.

When I run the ant script, the cactus task deploys the war file and doesn't even begin executing any of my tests, it repeatedly tries the URL in my first post and fails due to "connection refused". I've been at this for some time now and it's starting to frustrate me.

Any clues?
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
"Connection refused" would seem to imply that there's something wrong on a much lower level than authentication. What kind of a network infrastructure you have between the client machine and the web server?
craig a chapman
Greenhorn

Joined: Jun 24, 2005
Posts: 27
The web server is running on the client machine. I.e I'm developing on one machine.
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
I was wondering more along the lines of whether you have a web server fronting a backend application server, whether you have a proxy somewhere in between, etc.?
craig a chapman
Greenhorn

Joined: Jun 24, 2005
Posts: 27
No proxy. The same error occurs even when I take out the lan cable. I have just a simple tomcat 5.5 installation on my laptop. I'm going to try the runserverttests task instead to see if that makes any difference.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Cactus authentication
 
Similar Threads
SQL Server 2008r2 Connection Failed
Need help connecting to WSDL for first time
Studying HeadFirst book: cannot make authentification
JAAS- "No LoginModule found for ur jaas_configinfo!"
.htaccess