You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@abdera.apache.org by jm...@apache.org on 2008/02/12 20:29:33 UTC

svn commit: r627050 - /incubator/abdera/java/trunk/adapters/couchdb/src/test/java/org/apache/abdera/protocol/server/test/couchdb/CouchDbTest.java

Author: jmsnell
Date: Tue Feb 12 11:29:33 2008
New Revision: 627050

URL: http://svn.apache.org/viewvc?rev=627050&view=rev
Log:
decouple the test from the other server tests. makes it easier to build this independently of the other stuff

Modified:
    incubator/abdera/java/trunk/adapters/couchdb/src/test/java/org/apache/abdera/protocol/server/test/couchdb/CouchDbTest.java

Modified: incubator/abdera/java/trunk/adapters/couchdb/src/test/java/org/apache/abdera/protocol/server/test/couchdb/CouchDbTest.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/adapters/couchdb/src/test/java/org/apache/abdera/protocol/server/test/couchdb/CouchDbTest.java?rev=627050&r1=627049&r2=627050&view=diff
==============================================================================
--- incubator/abdera/java/trunk/adapters/couchdb/src/test/java/org/apache/abdera/protocol/server/test/couchdb/CouchDbTest.java (original)
+++ incubator/abdera/java/trunk/adapters/couchdb/src/test/java/org/apache/abdera/protocol/server/test/couchdb/CouchDbTest.java Tue Feb 12 11:29:33 2008
@@ -18,8 +18,9 @@
 import org.apache.abdera.protocol.client.AbderaClient;
 import org.apache.abdera.protocol.client.ClientResponse;
 import org.apache.abdera.protocol.client.RequestOptions;
+import org.apache.abdera.protocol.server.ServiceManager;
 import org.apache.abdera.protocol.server.provider.basic.BasicProvider;
-import org.apache.abdera.protocol.server.test.JettyServer;
+import org.apache.abdera.protocol.server.servlet.AbderaServlet;
 import org.apache.abdera.util.Constants;
 import org.apache.abdera.util.MimeTypeHelper;
 import org.apache.abdera.writer.Writer;
@@ -27,18 +28,25 @@
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
 import org.junit.Test;
+import org.mortbay.jetty.Server;
+import org.mortbay.jetty.servlet.Context;
+import org.mortbay.jetty.servlet.ServletHolder;
 
 public class CouchDbTest extends Assert {
 
-  private static JettyServer server;
+  private static Server server;
   private static Abdera abdera = Abdera.getInstance();
   private static AbderaClient client = new AbderaClient();
 
   @BeforeClass
   public static void setUp() throws Exception {
     if (server == null) {
-      server = new JettyServer();
-      server.start(BasicProvider.class);
+      server = new Server(9002);
+      Context context = new Context(server, "/", Context.SESSIONS);
+      ServletHolder servletHolder = new ServletHolder(new AbderaServlet());
+      servletHolder.setInitParameter(ServiceManager.PROVIDER, BasicProvider.class.getName());
+      context.addServlet(servletHolder, "/*");
+      server.start();
     }
   }