minor cleanups and temp fixes
git-svn-id: svn+ssh://dev.eclipse.org/svnroot/rt/org.eclipse.jetty/jetty/trunk@480 7e9141cc-0065-0410-87d8-b60c137991c4
This commit is contained in:
parent
abf43385f3
commit
69dcb996ae
|
@ -33,7 +33,7 @@ public class LikeJettyXml
|
|||
public static void main(String[] args)
|
||||
throws Exception
|
||||
{
|
||||
String jetty_home = System.getProperty("jetty.home",".");
|
||||
String jetty_home = System.getProperty("jetty.home","../jetty-distribution/target/distribution");
|
||||
|
||||
Server server = new Server();
|
||||
|
||||
|
|
|
@ -23,8 +23,7 @@ public class OneWebApp
|
|||
public static void main(String[] args)
|
||||
throws Exception
|
||||
{
|
||||
String jetty_default=new java.io.File("./start.jar").exists()?".":"../..";;
|
||||
String jetty_home = System.getProperty("jetty.home",jetty_default);
|
||||
String jetty_home = System.getProperty("jetty.home","..");
|
||||
|
||||
Server server = new Server();
|
||||
|
||||
|
@ -32,10 +31,14 @@ public class OneWebApp
|
|||
connector.setPort(Integer.getInteger("jetty.port",8080).intValue());
|
||||
server.setConnectors(new Connector[]{connector});
|
||||
|
||||
String war=args.length>0?args[0]:jetty_home+"/test-jetty-webapp/target/test-jetty-webapp-"+Server.getVersion();
|
||||
String path=args.length>1?args[1]:"/";
|
||||
|
||||
System.err.println(war+" "+path);
|
||||
|
||||
WebAppContext webapp = new WebAppContext();
|
||||
webapp.setContextPath("/");
|
||||
webapp.setWar(jetty_home+"/webapps/test");
|
||||
webapp.setDefaultsDescriptor(jetty_home+"/etc/webdefault.xml");
|
||||
webapp.setContextPath(path);
|
||||
webapp.setWar(war);
|
||||
|
||||
server.setHandler(webapp);
|
||||
|
||||
|
|
|
@ -12,6 +12,7 @@ package org.eclipse.jetty.policy;
|
|||
//You may elect to redistribute this code under either of these licenses.
|
||||
//========================================================================
|
||||
|
||||
/*
|
||||
import java.io.File;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
|
@ -21,12 +22,16 @@ import java.security.AccessControlException;
|
|||
import java.security.Policy;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
*/
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
public class TestJettyPolicyRuntime extends TestCase
|
||||
{
|
||||
|
||||
public void testNothing()
|
||||
{
|
||||
}
|
||||
/*
|
||||
HashMap evaluator = new HashMap();
|
||||
|
||||
@Override
|
||||
|
@ -289,4 +294,5 @@ public class TestJettyPolicyRuntime extends TestCase
|
|||
}
|
||||
return cwd;
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
|
|
@ -13,10 +13,12 @@
|
|||
|
||||
package org.eclipse.jetty.server;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.net.URLClassLoader;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Arrays;
|
||||
import java.util.Enumeration;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
@ -42,6 +44,7 @@ import org.eclipse.jetty.util.URIUtil;
|
|||
import org.eclipse.jetty.util.component.Container;
|
||||
import org.eclipse.jetty.util.component.LifeCycle;
|
||||
import org.eclipse.jetty.util.log.Log;
|
||||
import org.eclipse.jetty.util.resource.Resource;
|
||||
import org.eclipse.jetty.util.thread.QueuedThreadPool;
|
||||
import org.eclipse.jetty.util.thread.ThreadPool;
|
||||
|
||||
|
@ -57,10 +60,14 @@ import org.eclipse.jetty.util.thread.ThreadPool;
|
|||
public class Server extends HandlerWrapper implements Attributes
|
||||
{
|
||||
private static final ShutdownHookThread hookThread = new ShutdownHookThread();
|
||||
private static final String _version = (Server.class.getPackage()!=null && Server.class.getPackage().getImplementationVersion()!=null)
|
||||
?Server.class.getPackage().getImplementationVersion()
|
||||
:"7.0.y.z-SNAPSHOT";
|
||||
|
||||
private static final String _version;
|
||||
static
|
||||
{
|
||||
if (Server.class.getPackage()!=null && Server.class.getPackage().getImplementationVersion()!=null)
|
||||
_version=Server.class.getPackage().getImplementationVersion();
|
||||
else
|
||||
_version=System.getProperty("jetty.version","7.0.y.z-SNAPSHOT");
|
||||
}
|
||||
private final Container _container=new Container();
|
||||
private final AttributesMap _attributes = new AttributesMap();
|
||||
private final List<Object> _dependentBeans=new ArrayList<Object>();
|
||||
|
@ -708,4 +715,10 @@ public class Server extends HandlerWrapper implements Attributes
|
|||
{
|
||||
public void setShutdown(boolean shutdown);
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
public static void main(String[] args)
|
||||
{
|
||||
System.err.println(getVersion());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,21 +22,19 @@ public class HttpTesterTest extends TestCase
|
|||
{
|
||||
HttpTester tester = new HttpTester();
|
||||
tester.parse(
|
||||
"POST /uri© HTTP/1.1\r\n"+
|
||||
"POST /uri\uA74A HTTP/1.1\r\n"+
|
||||
"Host: fakehost\r\n"+
|
||||
"Content-Length: 11\r\n" +
|
||||
"Content-Length: 12\r\n" +
|
||||
"Content-Type: text/plain; charset=utf-8\r\n" +
|
||||
"\r\n" +
|
||||
"123456789©");
|
||||
System.err.println(tester.getMethod());
|
||||
System.err.println(tester.getURI());
|
||||
System.err.println(tester.getVersion());
|
||||
System.err.println(tester.getHeader("Host"));
|
||||
System.err.println(tester.getContentType());
|
||||
System.err.println(tester.getCharacterEncoding());
|
||||
System.err.println(tester.getContent());
|
||||
assertEquals(tester.getContent(), "123456789©");
|
||||
System.err.println(tester.generate());
|
||||
"123456789\uA74A");
|
||||
assertEquals("POST",tester.getMethod());
|
||||
assertEquals("/uri\uA74A",tester.getURI());
|
||||
assertEquals("HTTP/1.1",tester.getVersion());
|
||||
assertEquals("fakehost",tester.getHeader("Host"));
|
||||
assertEquals("text/plain; charset=utf-8",tester.getContentType());
|
||||
assertEquals("utf-8",tester.getCharacterEncoding());
|
||||
assertEquals("123456789\uA74A",tester.getContent());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -40,8 +40,8 @@ Other demonstration contexts, some of which may need manual deployment
|
|||
(check the README.txt file for details):
|
||||
</p>
|
||||
<ul>
|
||||
<li>a <a href="/cometd/">AJAX Cometd Chat with Bayeux</a></li>
|
||||
<li>a <a href="chat/demo">AJAX Comet Chat with AsyncContext</a></li>
|
||||
<li>a <a href="chat/demo">AJAX Comet Chat with com.acme.ChatServlet demo</a></li>
|
||||
<li>a <a href="/cometd/">AJAX Cometd Chat with cometd Bayeux</a></li>
|
||||
<li> the <a href="/javadoc/">javadoc</a> </li>
|
||||
<li> a demo of the <a href="/test-jndi">JNDI features</a></li>
|
||||
<li> a demo of the <a href="/test-annotations">Annotation features</a></li>
|
||||
|
|
Loading…
Reference in New Issue