Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lift-testkit - xml parsing error when processing HttpResponse #32

Closed
innovationgames opened this issue Jul 9, 2009 · 4 comments
Closed
Labels

Comments

@innovationgames
Copy link

I have a test case which issues http gets/posts to our server running the Innovation Games application. It is our 'stress test' for the Buy-A-Feature game. It currently works using an older variant of the lift-testkit library. When I run it with the current lift-testkit library I get the exception below.

I have isolated it down to the line in the library which is failing. Below I list both the working and non-working code.

TestFramework.scala: line 280 (non-working):
override lazy val xml = XML.load(new root.java.io.ByteArrayInputStream(body))

TestFramework.scala (working):
override lazy val xml = {
try3{
val s = new String(body, "UTF-8").replaceAll("""<!.*>""","")
XML.loadString(s)}

Stack Trace/Exception:

First test instance get headers: Map(Content-Length -> List(2711), Expires -> List(Wed, 8 Jul 2009 17:41:35 UTC), Set-Cookie -> List(JSESSIONID=1x0d2w2cmflwg;Path=/), Pragma -> List(no-cache), Server -> List(Jetty(6.1.16)), Content-Type -> List(text/html), X-Lift-Version -> List(1.1-SNAPSHOT), Cache-Control -> List(no-cache; private; no-store; must-revalidate; max-stale=0; post-check=0; pre-check=0; max-age=0))
Exception in thread "Thread-7" java.io.IOException: Server returned HTTP response code: 503 for URL: http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1290)
at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(XMLEntityManager.java:677)
at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startEntity(XMLEntityManager.java:1315)
at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startDTDEntity(XMLEntityManager.java:1282)
at com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl.setInputSource(XMLDTDScannerImpl.java:283)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$DTDDriver.dispatch(XMLDocumentScannerImpl.java:1192)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$DTDDriver.next(XMLDocumentScannerImpl.java:1089)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:1002)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:395)
at scala.xml.parsing.FactoryAdapter.loadXML(FactoryAdapter.scala:292)
at scala.xml.parsing.NoBindingFactoryAdapter.loadXML(NoBindingFactoryAdapter.scala:60)
at scala.xml.XML$.load(XML.scala:64)
at net.liftweb.http.testing.HttpResponse.xml(TestFramework.scala:280)
at com.enthiosys.buyafeature.stress_test.TestInstance.runWith(StressTest.scala:66)
at com.enthiosys.buyafeature.stress_test.StressTest$$anonfun$main$2$$anon$2.run(StressTest.scala:44)

@innovationgames
Copy link
Author

I have found another issue related TestHelpers.jsonFuncForCometName(). The pattern used to find the comet JSON func is using a capital 'F' in the pattern. This pattern no longer matches. Using a lower case 'f' enables the pattern match to work.

@dpp
Copy link
Member

dpp commented Jul 14, 2009

Updated testkit... closed by 63e746032ced85d49257898f16fc38b0f553f482

@github-importer
Copy link

Imported from GitHub: http://github.com/dpp/liftweb/issues/32/find

@github-importer
Copy link

Imported from Assembla: http://www.assembla.com/spaces/liftweb/tickets/32

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants