Hi,

I just tried your example, and it works perfectly fine here. Did you use Maven to put dependencies in your classpath ?
Some new version of nekohtml have a problem with doctype, try to remove it...

++

Julien

----- Message d'origine ----
De : Slo Roboro <[EMAIL PROTECTED]>
À : [email protected]
Envoyé le : Lundi, 7 Août 2006, 6h02mn 19s
Objet : [Jwebunit-users] Simple test, annoying problem

Hello,

I'm sure this is going to turn out to be something annoyingly obvious but
here is the issue I'm running into...

I'm running the following test:

//

package com.test;

import net.sourceforge.jweunit.WebTestCase;

public class HelloWorld extends WebTestCase{
    private static finat String url = "">"http://localhost:9080/projectName/jsps/pages";;

    public void testHelloWorldWithWebTester(){
        getTestContext().setBaseUrl(url);
        beginAt("hello.jsp");
    }
}

//

JSP is as follows:

//
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<TITLE>Hello World</TITLE>
</HEAD>
<BODY>
Hello World
</BODY>
</HTML>
//

I get the following exception/failure trace in the jUnit console when I "run
-> jUnit test" (apologize for any spelling errors - I have to type it out as
I'm not allowed to post to mailing lists from my work computer)

//
org.apache.xerces.xni.XNIException
at org.cyberneko.html.HTMLScanner$ContentScanner.scan(HTMLScanner.java:1921)
at org.cyberneko.html.HTMLScanner.scanDocument(HTMLScanner.java:809)
at org.cyberneko.html.HTMLConfiguration.parse(HTMLConfiguration.java:478)
at org.cyberneko.html.HTMLConfiguration.parse(HTMLConfiguration.java:431)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at
com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.parse(HTMLParser.java:311)
at com.gargoylesoftware.htmlunit.html.HTMLParser.parse(HTMLParser.java:226)
at
com.gargoylesoftware.htmlunit.DefaultPageCreator.createHtmlPage(DefaultPageCreator.java:112)
at
com.gargoylesoftware.htmlunit.DefaultPageCreator.createPage(DefaultPageCreator.java:85)
at
com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:431)
at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:335)
at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:389)
at
net.sourceforge.jwebunit.htmlunit.HtmlUnitDialog.beginAt(HtmlUnitDialog.java:120)
at net.sourceforge.jwebunit.WebTester.beginAt(WebTester.java:152)
at net.sourceforge.jwebunit.WebTestCase.beginAt(WebTestCase.java:88)
at com.test.HelloWorld.testHomePageWithWebTester(HelloWorld.java:10)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:85)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:58)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:60)
at net.sourceforge.jwebunit.WebTestCase.runBare(WebTestCase.java:50)
//

I get the same error no matter what jsp I attempt to test against.  Funnily
enough, if I use the HTMLUnit base (1.9) and write a similar test that uses
the HTMLUnit methods, I can navigate to the page without any problems and
assert that the title is correct and find the text.

Please heckle me for missing the obvious if this is an easy fix...  Thanks a
lot for any and all replies,

Drew.

_________________________________________________________________
Play Q6 for your chance to WIN great prizes.  
http://q6trivia.imagine-live.com/enca/landing


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Jwebunit-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jwebunit-users

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Jwebunit-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jwebunit-users

Reply via email to