[logback-dev] svn commit: r703 - logback/trunk/logback-access/src/test/java/ch/qos/logback/access/jetty

noreply.seb at qos.ch noreply.seb at qos.ch
Tue Oct 17 16:44:25 CEST 2006


Author: seb
Date: Tue Oct 17 16:44:25 2006
New Revision: 703

Modified:
   logback/trunk/logback-access/src/test/java/ch/qos/logback/access/jetty/JettyBasicTest.java
   logback/trunk/logback-access/src/test/java/ch/qos/logback/access/jetty/JettyTestSetup.java

Log:
using port 8088 for jetty test setup

Modified: logback/trunk/logback-access/src/test/java/ch/qos/logback/access/jetty/JettyBasicTest.java
==============================================================================
--- logback/trunk/logback-access/src/test/java/ch/qos/logback/access/jetty/JettyBasicTest.java	(original)
+++ logback/trunk/logback-access/src/test/java/ch/qos/logback/access/jetty/JettyBasicTest.java	Tue Oct 17 16:44:25 2006
@@ -22,7 +22,7 @@
   }
 
   public void testGetRequest() throws Exception {
-    URL url = new URL("http://localhost:8080/");
+    URL url = new URL("http://localhost:"+ JettyTestSetup.PORT + "/");
     HttpURLConnection connection = (HttpURLConnection) url.openConnection();
     connection.setDoInput(true);
 
@@ -35,7 +35,7 @@
   }
 
   public void testEventGoesToAppenders() throws Exception {
-    URL url = new URL("http://localhost:8080/");
+    URL url = new URL("http://localhost:"+ JettyTestSetup.PORT + "/");
     HttpURLConnection connection = (HttpURLConnection) url.openConnection();
     connection.setDoInput(true);
 

Modified: logback/trunk/logback-access/src/test/java/ch/qos/logback/access/jetty/JettyTestSetup.java
==============================================================================
--- logback/trunk/logback-access/src/test/java/ch/qos/logback/access/jetty/JettyTestSetup.java	(original)
+++ logback/trunk/logback-access/src/test/java/ch/qos/logback/access/jetty/JettyTestSetup.java	Tue Oct 17 16:44:25 2006
@@ -26,28 +26,29 @@
 import ch.qos.logback.core.appender.ListAppender;
 
 public class JettyTestSetup extends TestSetup {
-
   RequestLogImpl requestLogImpl;
 
+  public static final int PORT = 8088;
+  
   public JettyTestSetup(Test suite, RequestLogImpl impl) {
     super(suite);
     requestLogImpl = impl;
   }
-  
+
   public String getName() {
     return "Jetty Test Setup";
   }
 
   Server server;
-  String url = "http://localhost:8080/";
+  String url = "http://localhost:" + PORT + "/";
 
   public void setUp() throws Exception {
-    //System.out.println("into setUp");
+    // System.out.println("into setUp");
     super.setUp();
 
     server = new Server();
     Connector connector = new SelectChannelConnector();
-    connector.setPort(8080);
+    connector.setPort(PORT);
     server.setConnectors(new Connector[] { connector });
 
     ContextHandler context = new ContextHandler();
@@ -68,7 +69,7 @@
   }
 
   public void tearDown() throws Exception {
-    //System.out.println("into tearDown");
+    // System.out.println("into tearDown");
     super.tearDown();
     server.stop();
     Thread.sleep(1000);
@@ -88,7 +89,7 @@
     console.setName("console");
     PatternLayout layout = new PatternLayout();
     layout.setContext(requestLogImpl);
-    layout.setPattern("%date %server %clientHost %post");
+    layout.setPattern("%date %server %clientHost");
     console.setLayout(layout);
     layout.start();
     console.start();



More information about the logback-dev mailing list