Cactus + jetty + connection refused during eclipse Testing

Source: Internet
Author: User

Http://www.manning-sandbox.com/thread.jspa? Messageid = 483

 

Gastonw

Posts: 1
Registered: 1/3/04

Using the eclipse plugin for cactus
Posted: Jan 4, 2004
  Reply
Hi,

First let me say I am really enjoying JUnit in action. it's been a great help to me in learning about JUnit and cactus. I bought JUnit in action mainly to learn about cactus, And I 've currently read the book, downloaded the source and done all the examples up to chapter 9. so far so good.

Since I do most of my development and unit testing in eclipse, I wanted to try running the examples from Chapter 9, using the eclipse plugin, instead maven of. Here are the steps I did:

1) from a clean workspace, imported the junitbook-Servlets, junitbook-container (as a reference) and junitbook-repository projects from the JUnit in Action source into eclipse.

2) downloaded and installed the last nightly builds for the two Eclipse plug-ins, jakarta-cactus-eclipse-webapp-20030909.zip and jakarta-cactus-eclipse-runner-13-1.6dev-20030907.zip. These were the latest builds I cocould find.

3) I added all the jars to the junitbook-servlets project as described in the cactus Eclipse plug-in configuration at http://jakarta.apache.org/cactus/integration/eclipse/index.html using the versions of the jars from the junitbook-repository project imported from the JUnit in Action source files.

Now for my question. What is the next step to run the cactus unit tests in eclipse with jetty?

I tried running the testadminservlet. java unit test by selecting it and selecting run-> Run as-> cactus test from the menu, I get the following error: java.net. connectexception: Connection refused: connect.

My guess is that this is because jetty did not start before the cactus unit test ran.

Do I need to configure the cactus plugin somehow to tell it to automatically start jetty for me before running the cactus tests? Do I need to set up something in cactus preferences or in a cactus properties file? I went to the prefences for cactus and the checkbox for Jetty is checked.

(I was able to create a testallwithjetty. java class and run the cactus tests for Chapter 9 that way, but I 'd like to learn how to use the eclipse plugin. I 've also searched through the book and the index, and although the plugin is mentioned several places, I haven't found a example on how to use it .)

I think I'm overlooking something simple, and I hope all I need is a push in the right direction.

Thanks much,
Gaston

Vmassol

Posts: 51
Registered: 12/7/03

Re: using the eclipse plugin for cactus
Posted: Jan 8, 2004 AM In response to: gastonw
  Reply
Hi Gaston,

I'm really gglad you like the book!

WRT the eclipse plugin for cactus, you have to know that it is very experimental (it's one of the reason I didn't expand on it in the book ). however I do believe it's working at least with jetty. let me try it and come back to you (I'll need a few days-say 3-4 days ).

I 'd also suggest we continue this discussion on the cactus mailing list as it may be useful to others and they may also provide feedback about their own experience about using the eclipse plugin.

Thanks
-Vincent

Vmassol

Posts: 51
Registered: 12/7/03

Re: using the eclipse plugin for cactus
Posted: Jan 11,200 4 AM In response to: gastonw
  Reply
Hi Gaston,

You appear to be doing everything right there t one little item.

I believe the reason for the "java.net. connectexception: Connection refused: connect "error is because you haven't provided a web. XML containing the cactus redirectors. you need to right click on your project and then select "properties ". then go to the "Web Applications" entry and set the path to your web. XML file (see http://jakarta.apache.org/cactus/integration/eclipse/webapp_plugin.html ).

Unfortunately, the eclipse plugin currently does not automatically add the cactus redirector so you'll need to add them manually in this file, as explained on http://jakarta.apache.org/cactus/integration/howto_config.html#serverside

Thanks
-Vincent

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.