abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmsn...@apache.org
Subject svn commit: r1190103 - in /abdera/abdera2: activities/src/main/java/org/apache/abdera2/activities/protocol/ common/src/main/java/org/apache/abdera2/common/protocol/servlet/async/ test/src/main/java/org/apache/abdera2/test/ test/src/main/java/org/apache...
Date Fri, 28 Oct 2011 00:34:28 GMT
Author: jmsnell
Date: Fri Oct 28 00:34:28 2011
New Revision: 1190103

URL: http://svn.apache.org/viewvc?rev=1190103&view=rev
Log:
All tests passing again.. ok, time to move on to the next round of refactoring...

Modified:
    abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/protocol/AbstractActivitiesWorkspaceProvider.java
    abdera/abdera2/common/src/main/java/org/apache/abdera2/common/protocol/servlet/async/AbderaAsyncService.java
    abdera/abdera2/common/src/main/java/org/apache/abdera2/common/protocol/servlet/async/AsyncAbderaServlet.java
    abdera/abdera2/test/src/main/java/org/apache/abdera2/test/JettyUtil.java
    abdera/abdera2/test/src/main/java/org/apache/abdera2/test/server/JettyServer.java

Modified: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/protocol/AbstractActivitiesWorkspaceProvider.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/protocol/AbstractActivitiesWorkspaceProvider.java?rev=1190103&r1=1190102&r2=1190103&view=diff
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/protocol/AbstractActivitiesWorkspaceProvider.java
(original)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/protocol/AbstractActivitiesWorkspaceProvider.java
Fri Oct 28 00:34:28 2011
@@ -20,6 +20,8 @@ package org.apache.abdera2.activities.pr
 import java.util.HashSet;
 import java.util.Set;
 
+import javax.activation.MimeType;
+
 import org.apache.abdera2.activities.model.TypeAdapter;
 import org.apache.abdera2.common.mediatype.MimeTypeHelper;
 import org.apache.abdera2.common.protocol.AbstractWorkspaceProvider;
@@ -45,7 +47,9 @@ public abstract class AbstractActivities
   public static Predicate<RequestContext> isJson() {
     return new Predicate<RequestContext>() {
       public boolean apply(RequestContext input) {
-        return MimeTypeHelper.isJson(input.getContentType().toString());
+        MimeType ct = input.getContentType();
+        if (ct == null) return false;
+        return MimeTypeHelper.isJson(ct.toString());
       }
     };
   }

Modified: abdera/abdera2/common/src/main/java/org/apache/abdera2/common/protocol/servlet/async/AbderaAsyncService.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/common/src/main/java/org/apache/abdera2/common/protocol/servlet/async/AbderaAsyncService.java?rev=1190103&r1=1190102&r2=1190103&view=diff
==============================================================================
--- abdera/abdera2/common/src/main/java/org/apache/abdera2/common/protocol/servlet/async/AbderaAsyncService.java
(original)
+++ abdera/abdera2/common/src/main/java/org/apache/abdera2/common/protocol/servlet/async/AbderaAsyncService.java
Fri Oct 28 00:34:28 2011
@@ -137,8 +137,7 @@ public class AbderaAsyncService 
         createServiceManager(context);      
       checkState(
         manager != null, 
-        "Service Manager is null");
-      
+        "Service Manager is null"); 
       if (DEPLOY_ATOMPUB.apply(properties)) {
         log.debug("Initializing Abdera Atompub Service...");
         queue = manager.newProcessorQueue(properties);

Modified: abdera/abdera2/common/src/main/java/org/apache/abdera2/common/protocol/servlet/async/AsyncAbderaServlet.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/common/src/main/java/org/apache/abdera2/common/protocol/servlet/async/AsyncAbderaServlet.java?rev=1190103&r1=1190102&r2=1190103&view=diff
==============================================================================
--- abdera/abdera2/common/src/main/java/org/apache/abdera2/common/protocol/servlet/async/AsyncAbderaServlet.java
(original)
+++ abdera/abdera2/common/src/main/java/org/apache/abdera2/common/protocol/servlet/async/AsyncAbderaServlet.java
Fri Oct 28 00:34:28 2011
@@ -62,7 +62,7 @@ public class AsyncAbderaServlet 
       Processor proc = (Processor) sc.getAttribute(Processor.NAME);
       if (proc != null && !proc.isShutdown()) {
         final AsyncContext context = request.startAsync(request, response);
-        ServiceManager sm = (ServiceManager) sc.getAttribute(ServiceManager.class.getName());
+        ServiceManager sm = (ServiceManager) sc.getAttribute(AbderaAsyncService.SERVICEMANAGER);
         Provider provider = sm.newProvider(getProperties(getServletConfig()));
         ServletRequestContext reqcontext = new ServletRequestContext(provider, request, sc);
         long timeout = getTimeout(reqcontext);

Modified: abdera/abdera2/test/src/main/java/org/apache/abdera2/test/JettyUtil.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/test/src/main/java/org/apache/abdera2/test/JettyUtil.java?rev=1190103&r1=1190102&r2=1190103&view=diff
==============================================================================
--- abdera/abdera2/test/src/main/java/org/apache/abdera2/test/JettyUtil.java (original)
+++ abdera/abdera2/test/src/main/java/org/apache/abdera2/test/JettyUtil.java Fri Oct 28 00:34:28
2011
@@ -36,7 +36,7 @@ public class JettyUtil {
         return PORT;
     }
 
-    private static void initServer() throws Exception {
+    public static void initServer() throws Exception {
         server = new Server(getPort());      
         handler = 
           new ServletContextHandler(ServletContextHandler.SESSIONS);

Modified: abdera/abdera2/test/src/main/java/org/apache/abdera2/test/server/JettyServer.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/test/src/main/java/org/apache/abdera2/test/server/JettyServer.java?rev=1190103&r1=1190102&r2=1190103&view=diff
==============================================================================
--- abdera/abdera2/test/src/main/java/org/apache/abdera2/test/server/JettyServer.java (original)
+++ abdera/abdera2/test/src/main/java/org/apache/abdera2/test/server/JettyServer.java Fri
Oct 28 00:34:28 2011
@@ -42,8 +42,15 @@ public class JettyServer {
     public void startAsync(
         Class<? extends ServiceManager> _smclass, 
         AbderaChannelServlet acs) throws Exception {
+
+      JettyUtil.initServer();
+      JettyUtil.getSch().setInitParameter("AbderaAtompubService", "true");
+      JettyUtil.getSch().setInitParameter("AbderaChannelService", "true");
+      JettyUtil.getSch().setInitParameter(ServiceManager.class.getName(), _smclass.getName());
       
-      ServletHolder servletHolder = new ServletHolder(new AsyncAbderaServlet());
+      ServletHolder servletHolder = 
+        new ServletHolder(
+          new AsyncAbderaServlet());
       JettyUtil.addServlet(servletHolder, "/*");
       
       if (acs != null) {
@@ -55,9 +62,6 @@ public class JettyServer {
         new EventListener[] {
           new AbderaAsyncService()
       };
-      JettyUtil.getSch().setInitParameter("AbderaAtompubService", "true");
-      JettyUtil.getSch().setInitParameter("AbderaChannelService", "true");
-      JettyUtil.getSch().setInitParameter(ServiceManager.class.getName(), _smclass.getName());
       JettyUtil.getSch().setEventListeners(listeners);
       JettyUtil.start();
     }



Mime
View raw message