diff --git a/src/sbt-test/web/jsp/project/build.properties b/src/sbt-test/web/jsp/project/build.properties new file mode 100644 index 000000000..421dd95d3 --- /dev/null +++ b/src/sbt-test/web/jsp/project/build.properties @@ -0,0 +1,2 @@ +project.name=JSP Test +project.version=a \ No newline at end of file diff --git a/src/sbt-test/web/jsp/project/build/JSP.scala b/src/sbt-test/web/jsp/project/build/JSP.scala new file mode 100644 index 000000000..48aa9c5fd --- /dev/null +++ b/src/sbt-test/web/jsp/project/build/JSP.scala @@ -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() } + } +} \ No newline at end of file diff --git a/src/sbt-test/web/jsp/src/main/webapp/index.jsp b/src/sbt-test/web/jsp/src/main/webapp/index.jsp new file mode 100644 index 000000000..2a7d1f317 --- /dev/null +++ b/src/sbt-test/web/jsp/src/main/webapp/index.jsp @@ -0,0 +1,5 @@ + + + <% out.println(" Hello World!"); %> + + \ No newline at end of file diff --git a/src/sbt-test/web/jsp/test b/src/sbt-test/web/jsp/test new file mode 100644 index 000000000..f18db92d3 --- /dev/null +++ b/src/sbt-test/web/jsp/test @@ -0,0 +1,11 @@ +> update +[success] + +> jetty-run +[success] + +> check-page +[success] + +> jetty-stop +[success] \ No newline at end of file