Ok, I figured out that the context was being set to my 'artifactId-version/' and when I altered my URL, it worked. So how do I set the root context via Tomcat and Cargo?
On Fri, Mar 28, 2008 at 7:53 AM, Mick Knutson <[EMAIL PROTECTED]> wrote: > Ok, I am trying to run Selenium tests on my web app. > Now when I use this jetty plugin and start my webapp via jetty, I can see > my app running fine and my index.html (jsf) page displays fine: > > *<plugin> > <groupId>org.mortbay.jetty</groupId> > <artifactId>maven-jetty-plugin</artifactId> > <version>6.1.6</version> > <configuration> > <contextPath>/</contextPath> > <scanIntervalSeconds>3</scanIntervalSeconds> > <scanTargetPatterns> > <scanTargetPattern> > <directory>src/main/webapp/WEB-INF</directory> > <!-- unsure what this does --> > <excludes> > <exclude>**/*.jsp</exclude> > <exclude>**/*.xhtml</exclude> > </excludes> > <includes> > <include>**/*.properties</include> > <include>**/*.xml</include> > </includes> > </scanTargetPattern> > </scanTargetPatterns> > </configuration> > </plugin> > * > *This is just a small bit of the html source from jetty running manually > or through Selenium IDE: > http://localhost:8080/index.html > * > > <?xml version="1.0" encoding="utf-8"?> > <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" > > > <html xmlns="http://www.w3.org/1999/xhtml"> > <head> > > <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> > > <title>Main Index</title> > <link rel="shortcut icon" href="/favicon.ico" /> > > <link href="/view/stylesheet/theme.css" rel="stylesheet" type="text/css" > /> > > </head> > > <body id="mainPage"> > > <div id="document"> > <div id="header"> > > > > *Now, when I run mvn install to deploy to the following tomcat5 server, > all my tests show no html thus it appears that under tomcat5 via cargo, the > pages are not there or they are blank:* > *<plugin> > <groupId>org.codehaus.cargo</groupId> > <artifactId>cargo-maven2-plugin</artifactId> > <version>0.3.1</version> > <configuration> > <wait>${cargo.wait}</wait> > <container> > <containerId>${cargo.container > }</containerId> > <zipUrlInstaller> > <url>${cargo.container.url}</url> > <installDir>${installDir}</installDir> > </zipUrlInstaller> > </container> > <configuration> > <home>${project.build.directory}/${ > cargo.container}/container</home> > <properties> > <cargo.hostname>${cargo.host > }</cargo.hostname> > <cargo.servlet.port>${cargo.port > }</cargo.servlet.port> > </properties> > </configuration> > </configuration> > <executions> > <execution> > <id>start-container</id> > <phase>pre-integration-test</phase> > <goals> > <goal>start</goal> > </goals> > </execution> > <execution> > <id>stop-container</id> > <phase>post-integration-test</phase> > <goals> > <goal>stop</goal> > </goals> > </execution> > </executions> > </plugin> > ... > ** <cargo.container>tomcat5x</cargo.container>* > * <cargo.container.url>* > * > http://archive.apache.org/dist/tomcat/tomcat-5/v5.5.26/bin/apache-tomcat-5.5.26.zip > * > * </cargo.container.url>* > *** <cargo.host>localhost</cargo.host>* > * <cargo.port>8080</cargo.port>* > * <cargo.wait>false</cargo.wait>* > * > * > *Here is the selenium test:* > > *selenium.open("/index.html"); > log.debug > ("========================================================="); > log.debug("selenium.getTitle(): " + selenium.getTitle()); > log.debug("selenium.getLocation(): " + selenium.getLocation()); > log.debug > ("========================================================="); > log.debug("selenium.getHtmlSource(): " + selenium.getHtmlSource > ()); > log.debug > ("========================================================="); > //Assert.assertEquals(selenium.getTitle(), "Main Index", "'title' > should equal \"Main Index\""); > > > selenium.open(applicationAddress + "index.html"); > log.debug > ("========================================================="); > log.debug("selenium.getTitle(): " + selenium.getTitle()); > log.debug("selenium.getLocation(): " + selenium.getLocation()); > log.debug > ("========================================================="); > log.debug("selenium.getHtmlSource(): " + selenium.getHtmlSource > ()); > log.debug > ("========================================================="); > //Assert.assertEquals(selenium.getTitle(), "Main Index", "'title' > should equal \"Main Index\""); > > * > > *Here is the selenium stack trace I get.* > > *[myproject] INFO [main] LoginTest.init(34) | Starting Selenium client > [myproject] DEBUG [main] LoginTest.testSuccessfulLogin(62) | > ========================================================= > [myproject] DEBUG [main] LoginTest.testSuccessfulLogin(63) | > selenium.getTitle(): > [myproject] DEBUG [main] LoginTest.testSuccessfulLogin(64) | > selenium.getLocation(): http://localhost:8080/index.html > [myproject] DEBUG [main] LoginTest.testSuccessfulLogin(65) | > ========================================================= > [myproject] DEBUG [main] LoginTest.testSuccessfulLogin(66) | > selenium.getHtmlSource(): <head></head><body></body> > [myproject] DEBUG [main] LoginTest.testSuccessfulLogin(67) | > ========================================================= > [myproject] DEBUG [main] LoginTest.testSuccessfulLogin(72) | > ========================================================= > [myproject] DEBUG [main] LoginTest.testSuccessfulLogin(73) | > selenium.getTitle(): > [myproject] DEBUG [main] LoginTest.testSuccessfulLogin(74) | > selenium.getLocation(): http://localhost:8080/index.html > [myproject] DEBUG [main] LoginTest.testSuccessfulLogin(75) | > ========================================================= > [myproject] DEBUG [main] LoginTest.testSuccessfulLogin(76) | > selenium.getHtmlSource(): <head></head><body></body> > [myproject] DEBUG [main] LoginTest.testSuccessfulLogin(77) | > ========================================================= > * > > > > -- > Thanks, > Mick Knutson > > http://www.baselogic.com > http://www.blincmagazine.com > http://www.linkedin.com/in/mickknutson > http://www.djmick.com > http://www.myspace.com/mickknutson > http://www.myspace.com/BLiNCMagazine > http://tahoe.baselogic.com > --- -- Thanks, Mick Knutson http://www.baselogic.com http://www.blincmagazine.com http://www.linkedin.com/in/mickknutson http://www.djmick.com http://www.myspace.com/mickknutson http://www.myspace.com/BLiNCMagazine http://tahoe.baselogic.com ---
