jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Roberto Nucera <nuc...@gmail.com>
Subject Re: JettyTestSetup does not work when I set the "cactus.jetty.resourceDir"
Date Sun, 28 Nov 2004 18:36:44 GMT
Vincent,

Thanks a lot for your reply.

I was trying to test Jsp pages and I thought I needed a Web
Application. The documentation says

"The method setResourceDir(File) or the system property
cactus.jetty.resourceDir sets the directory containing the
web-application resources (expanded WAR). If you omit this step,
you'll only be able to use the Servlet Redirector."

so it seems I need it. 

I am not sure why you say an absolute path would help. I have an
Eclipse project, and the application runs in the project directory,
say ServletProjects. Underneath there I have my packages and classes.
I also have the following:

ServletProjects
    webapp
          test
              WEB-INF

I added a fake web.xml. No effect.

There is a snippet from JettyTestServlet that says

    private Object createContext(Object theServer,
        Configuration theConfiguration) throws Exception
    {
        // Add a web application. This creates a WebApplicationContext.
        // Note: We do not put any WEB-INF/, lib/ nor classes/ directory
        // in the webapp.
        URL contextURL = new URL(theConfiguration.getContextURL());
....

I am not sure what the comments mean..

Thanks again for your help

Roberto

On Sun, 28 Nov 2004 14:15:09 +0100, Vincent Massol <vmassol@pivolis.com> wrote:
> 
> 
> Hi Roberto,
> 
> What are you expecting to "see" by defining the cactus.jetty.resourceDir
> property? It simply adds it as a webapplication context to the Jetty config.
> 
> How do you know your working dir is the test/ directory? Is that from where
> you start your build? I would really recommend using an absolute file path
> to the webapps dir. Also you in the config you wrote: "./webapp" but then
> later on in your description, you mention having a "/test/WEB-INF"
> directory. The two doesn't seem to match...
> 
> Also, you may need a web.xml (I don't know how lenient Jetty is but a web
> application do require a web.xml).
> 
> Thanks
> -Vincent
> 
> PS: If you wish to add logging you'll need to provide your own Jetty config
> file (using the cactus.jetty.config property).
> 
> > -----Original Message-----
> > From: Roberto Nucera [mailto:nucera@gmail.com]
> > Sent: dimanche 28 novembre 2004 06:59
> > To: cactus-user@jakarta.apache.org
> > Subject: JettyTestSetup does not work when I set the
> > "cactus.jetty.resourceDir"
> >
> > Please help!,
> >
> > I have a JUnit Cactus test as follows:
> >
> > public static Test suite() {
> >     System.setProperty("cactus.contextURL","http://localhost:9090/test");
> >     //System.setProperty("cactus.jetty.resourceDir", "./webapp");
> >     TestSuite suite = new TestSuite("Run Tests with Jetty");
> >     suite.addTestSuite(TestDisplayPlayersServlet.class);
> >     return new JettyTestSetup(suite);
> > }
> >
> > I workd fine if I  comment the second line (resourceDir). If it is
> > uncommented then it does nothing. I see no exception anywhere but that
> > is what seems it happened.
> >
> > By the way the /.webapp directory is just under the test
> > (working)directory, and it is emtpy. Just a /test/WEB-INF directory
> > structure but no files (no web.xml as well).
> >
> > Thanks in advance
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: cactus-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: cactus-user-help@jakarta.apache.org
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cactus-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: cactus-user-help@jakarta.apache.org
> 
>

Mime
View raw message