Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3799686
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T13:46:26+00:00 2026-05-19T13:46:26+00:00

I have an ADF application which running on my server. I was trying to

  • 0

I have an ADF application which running on my server. I was trying to run some integration test cases on it. I used to use apache cactus framework to run testing on normal web applications. My test cases would extend CactusStrutsTestCase and will be run.
I tried to approach, ADF application with same concept. But I am getting connection refused error

java.net.ConnectException: Connection refused: connect
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
    at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)

So my question is that , is it possible to do testing in ADF application with a ServletTestcase which is part of Cactus framework ?

Thanks
Jijoy

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T13:46:27+00:00Added an answer on May 19, 2026 at 1:46 pm

    What you are doing is possible. I know, because I’ve done it.

    First off, ditch genuine Apache Cactus. It’s not being supported anymore. You want to download JSFUnit and use that instead. It makes use of Apache Cactus but is still being actively maintained.

    I suggest you create your own test case which extends ServletTestCase instead of using ServletTestCase directly.

    public class EJBTestCase extends ServletTestCase {
    protected InitialContext context;
    
    public static final String userId = "demouser";
    
    
    public EJBTestCase(String string) {
        super(string);
    }
    
    private InitialContext getInitialContext() throws NamingException {
      Hashtable env = new Hashtable();
    
      env.put(Context.SECURITY_PRINCIPAL, "username");
      env.put(Context.SECURITY_CREDENTIALS, "password");
    
    
         return new InitialContext(env);
    }
    
    public void setUp() throws Exception {
        super.setUp();
    
        context = getInitialContext();
    
    }
    
    public void tearDown() throws Exception {
        super.tearDown();
    
        context.close();
    }
    
    public EJBTestCase() {
        super();
    }
    }
    

    Next, you need to setup your web.xml file:

      <filter>
        <filter-name>JSFUnitFilter</filter-name>
        <filter-class>org.jboss.jsfunit.framework.JSFUnitFilter</filter-class>
      </filter>
    ...
    
        <filter-mapping>
            <filter-name>JSFUnitFilter</filter-name>
            <servlet-name>ServletTestRunner</servlet-name>
          </filter-mapping>
          <filter-mapping>
            <filter-name>JSFUnitFilter</filter-name>
            <servlet-name>ServletRedirector</servlet-name>
          </filter-mapping>
    
    ...
    
      <servlet>
        <servlet-name>ServletRedirector</servlet-name>
        <servlet-class>org.jboss.jsfunit.framework.JSFUnitServletRedirector</servlet-class>
      </servlet>
      <servlet>
        <servlet-name>ServletTestRunner</servlet-name>
        <servlet-class>org.apache.cactus.server.runner.ServletTestRunner</servlet-class>
      </servlet>
    
    ...
    
      <servlet-mapping>
        <servlet-name>ServletRedirector</servlet-name>
        <url-pattern>/ServletRedirector</url-pattern>
      </servlet-mapping>
      <servlet-mapping>
        <servlet-name>ServletTestRunner</servlet-name>
        <url-pattern>/ServletTestRunner</url-pattern>
      </servlet-mapping>
    

    Finally, when you run your test cases you must pass in the cactus.contextURL parameter.

    -Dcactus.contextURL=http://127.0.0.1:7101/MyApp
    

    I assume you are using JDeveloper. You can then set this under Project Properties > Run/Debug/Profile -> Edit > Launch Settings -> Java Options.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Have you used VS.NET Architect Edition's Application and System diagrams to start designing a
I have a customer who created an Oracle ADF/JSF 1.1 application. On one of
I am evaluating Rich Internet application solutions to use in next project. I have
i have a input tag which is non editable, but some times i need
Have a slight problem. Trying to post XML to a server. To do this,
I do have some ADF BC components deployed in an ear . I want
Have you ever seen any of there error messages? -- SQL Server 2000 Could
Have just started using Visual Studio Professional's built-in unit testing features, which as I
Have a n-tire web application and search often times out after 30 secs. How
I am having issues with JSF/ADF/PPR on refreshing the page incorrectly. I have a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.