<target name="build-env">
<mkdir dir="build" />
<mkdir dir="build/bin" />
- <mkdir dir="build/test-bin" />
<mkdir dir="build/api" />
</target>
<zip destfile="build/jsvc-api.zip" basedir="build/api" />
</target>
- <target name="test-war" depends="build-env, jsvc-jar">
- <taskdef name="jsvc-war" classname="dolda.jsvc.j2ee.Archive$AntTask" classpath="build/jsvc.jar" />
- <copy todir="build/test-bin/dolda/jsvc/test">
- <fileset dir="src/dolda/jsvc/test">
- <include name="static/**" />
- </fileset>
- </copy>
- <copy tofile="build/test-bin/jsvc.properties" file="etc/test.jsvc.properties" />
- <jar destfile="build/jsvc-test.jar" basedir="build/test-bin" />
- <jsvc-war destfile="build/jsvc-test.war">
- <jars dir="build">
- <include name="jsvc.jar" />
- <include name="jsvc-test.jar" />
- </jars>
- </jsvc-war>
- </target>
-
<target name="clean">
<delete dir="build" />
</target>
+++ /dev/null
-jsvc.j2ee.appname = JSvc Test War
-jsvc.bootstrap = dolda.jsvc.test.Bootstrap
+++ /dev/null
-package dolda.jsvc.test;
-
-import dolda.jsvc.*;
-import dolda.jsvc.util.*;
-
-public class Bootstrap {
- public static Responder responder() {
- Multiplexer root = new Multiplexer();
- root.file("test", new TestResponder());
- root.file("", new StaticContent(Bootstrap.class, "static/index.html", false, "text/html"));
- root.file("css", new StaticContent(Bootstrap.class, "static/test.css", false, "text/css"));
- root.dir("foo", new StaticContent(Bootstrap.class, "static/foo", true, "text/plain; charset=utf-8"));
- return(Misc.stdroot(root));
- }
-}
+++ /dev/null
-package dolda.jsvc.test;
-
-import dolda.jsvc.*;
-import dolda.jsvc.util.*;
-import java.io.*;
-
-public class TestResponder extends SimpleWriter {
- public TestResponder() {
- super("plain");
- }
-
- public void respond(Request req, PrintWriter out) {
- out.println(req.url());
- out.println(req.path());
- out.println(req.inheaders());
- out.println(req.ctx().starttime());
- out.println(req.remoteaddr() + "<->" + req.localaddr());
- }
-}
+++ /dev/null
-<?xml version="1.0" encoding="US-ASCII"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
-<head>
-<title>Test</title>
-<link rel="stylesheet" title="Default style" type="text/css" href="css" />
-</head>
-<body>
-<h1>Hello world!</h1>
-<p>Test</p>
-</body>
-</html>
+++ /dev/null
-body {
- font-family: sans;
-}