abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmsn...@apache.org
Subject svn commit: r617529 - in /incubator/abdera/java/trunk/server/src: main/java/org/apache/abdera/protocol/server/provider/basic/BasicProvider.java test/java/org/apache/abdera/protocol/server/test/basic/BasicTest.java
Date Fri, 01 Feb 2008 15:58:39 GMT
Author: jmsnell
Date: Fri Feb  1 07:58:37 2008
New Revision: 617529

URL: http://svn.apache.org/viewvc?rev=617529&view=rev
Log:
Change the BasicProvider to use RouteManager

Modified:
    incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/provider/basic/BasicProvider.java
    incubator/abdera/java/trunk/server/src/test/java/org/apache/abdera/protocol/server/test/basic/BasicTest.java

Modified: incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/provider/basic/BasicProvider.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/provider/basic/BasicProvider.java?rev=617529&r1=617528&r2=617529&view=diff
==============================================================================
--- incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/provider/basic/BasicProvider.java
(original)
+++ incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/provider/basic/BasicProvider.java
Fri Feb  1 07:58:37 2008
@@ -23,8 +23,7 @@
 import org.apache.abdera.protocol.server.TargetType;
 import org.apache.abdera.protocol.server.impl.AbstractWorkspaceProvider;
 import org.apache.abdera.protocol.server.impl.CollectionAdapterManager;
-import org.apache.abdera.protocol.server.impl.RegexTargetResolver;
-import org.apache.abdera.protocol.server.impl.TemplateTargetBuilder;
+import org.apache.abdera.protocol.server.impl.RouteManager;
 
 public class BasicProvider 
   extends AbstractWorkspaceProvider {
@@ -33,18 +32,13 @@
   public static final String PARAM_ENTRY = "entry";
   
   public BasicProvider() {
-    setTargetResolver(
-      new RegexTargetResolver()
-        .setPattern("/", TargetType.TYPE_SERVICE)
-        .setPattern("/" + "([^/#?]+)", TargetType.TYPE_COLLECTION, PARAM_FEED)
-        .setPattern("/" + "([^/#?]+)/([^/#?]+)", TargetType.TYPE_ENTRY, PARAM_FEED, PARAM_ENTRY)
-    );
-    setTargetBuilder(
-      new TemplateTargetBuilder()
-        .setTemplate(TargetType.TYPE_SERVICE, "{target_base}/")
-        .setTemplate(TargetType.TYPE_COLLECTION, "{target_base}/{" + PARAM_FEED + "}")
-        .setTemplate(TargetType.TYPE_ENTRY, "{target_base}/{" + PARAM_FEED + "}/{" + PARAM_ENTRY
+ "}")
-    );
+    RouteManager routeManager = 
+      new RouteManager()
+        .addRoute("service", "/", TargetType.TYPE_SERVICE)
+        .addRoute("feed", "/:feed", TargetType.TYPE_COLLECTION)
+        .addRoute("entry", "/:feed/:entry", TargetType.TYPE_ENTRY);
+    setTargetBuilder(routeManager);
+    setTargetResolver(routeManager);
     addWorkspace(new BasicWorkspace(this));
   }
 

Modified: incubator/abdera/java/trunk/server/src/test/java/org/apache/abdera/protocol/server/test/basic/BasicTest.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/server/src/test/java/org/apache/abdera/protocol/server/test/basic/BasicTest.java?rev=617529&r1=617528&r2=617529&view=diff
==============================================================================
--- incubator/abdera/java/trunk/server/src/test/java/org/apache/abdera/protocol/server/test/basic/BasicTest.java
(original)
+++ incubator/abdera/java/trunk/server/src/test/java/org/apache/abdera/protocol/server/test/basic/BasicTest.java
Fri Feb  1 07:58:37 2008
@@ -39,7 +39,6 @@
 import org.apache.abdera.util.MimeTypeHelper;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
-import org.junit.Ignore;
 import org.junit.Test;
 
 public class BasicTest extends Assert {
@@ -61,7 +60,6 @@
     server.stop();
   }
   @Test
-  @Ignore
   public void testGetService() {
     ClientResponse resp = client.get("http://localhost:9002/");
     assertNotNull(resp);



Mime
View raw message