git-svn-id: https://simple-build-tool.googlecode.com/svn/trunk@940 d89573ee-9141-11dd-94d4-bdf5e562f29c
This commit is contained in:
dmharrah 2009-08-08 22:13:10 +00:00
parent 84e98aae1a
commit a3f1c671a6
4 changed files with 46 additions and 0 deletions

View File

@ -0,0 +1,2 @@
project.name=JSP Test
project.version=a

View File

@ -0,0 +1,28 @@
import sbt._
class JSP(info: ProjectInfo) extends DefaultWebProject(info)
{
val j6 = "org.mortbay.jetty" % "jetty" % "6.1.17" % "test->default"
val j = "org.mortbay.jetty" % "jsp-2.0" % "6.1.17" % "test->default"
def indexURL = new java.net.URL("http://localhost:8080")
def indexFile = new java.io.File("index.html")
import Process._
lazy val getPage = execTask { indexURL #> indexFile }
lazy val checkPage = task { checkHelloWorld() } dependsOn getPage
private def checkHelloWorld() =
{
try
{
FileUtilities.readString(indexFile, log) match
{
case Right(value) =>
if(value.contains("Hello World!")) None
else Some("index.html did not contain 'Hello World!' :\n" +value)
case Left(msg) => Some(msg)
}
}
finally { jettyInstance.stop() }
}
}

View File

@ -0,0 +1,5 @@
<html>
<body>
<% out.println(" Hello World!"); %>
</body>
</html>

11
src/sbt-test/web/jsp/test Normal file
View File

@ -0,0 +1,11 @@
> update
[success]
> jetty-run
[success]
> check-page
[success]
> jetty-stop
[success]