abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmsn...@apache.org
Subject svn commit: r613765 [4/4] - in /incubator/abdera/java/branches/server_refactor/src: main/java/org/ main/java/org/apache/ main/java/org/apache/abdera/ main/java/org/apache/abdera/protocol/ main/java/org/apache/abdera/protocol/server/ main/java/org/apach...
Date Mon, 21 Jan 2008 05:33:58 GMT
Added: incubator/abdera/java/branches/server_refactor/src/test/java/org/apache/abdera/protocol/server/test/ext/ExtTest.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/branches/server_refactor/src/test/java/org/apache/abdera/protocol/server/test/ext/ExtTest.java?rev=613765&view=auto
==============================================================================
--- incubator/abdera/java/branches/server_refactor/src/test/java/org/apache/abdera/protocol/server/test/ext/ExtTest.java
(added)
+++ incubator/abdera/java/branches/server_refactor/src/test/java/org/apache/abdera/protocol/server/test/ext/ExtTest.java
Sun Jan 20 21:33:46 2008
@@ -0,0 +1,166 @@
+/*
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements.  The ASF licenses this file to You
+* under the Apache License, Version 2.0 (the "License"); you may not
+* use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.  For additional information regarding
+* copyright in this work, please see the NOTICE file in the top level
+* directory of this distribution.
+*/
+package org.apache.abdera.protocol.server.test.ext;
+
+import java.io.ByteArrayInputStream;
+import java.util.Date;
+
+import junit.framework.TestCase;
+
+import org.apache.abdera.Abdera;
+import org.apache.abdera.model.Collection;
+import org.apache.abdera.model.Document;
+import org.apache.abdera.model.Entry;
+import org.apache.abdera.model.Feed;
+import org.apache.abdera.model.Service;
+import org.apache.abdera.model.Workspace;
+import org.apache.abdera.protocol.Response.ResponseType;
+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.test.JettyServer;
+import org.apache.abdera.util.Constants;
+import org.apache.abdera.util.MimeTypeHelper;
+
+public class ExtTest 
+  extends TestCase {
+
+  private static JettyServer server;
+  private static Abdera abdera = Abdera.getInstance();
+  private static AbderaClient client = new AbderaClient();
+
+  public ExtTest() {
+    try {
+      if (server == null) {
+        server = new JettyServer();
+        server.start(TestServiceContext.class);
+      }
+    } catch (Exception e) {}
+  }
+  
+  private int count = 5;
+  
+  @Override protected void tearDown() throws Exception {
+    if (--count == 0) server.stop();
+  }
+  
+  public void testGetService() {
+    ClientResponse resp = client.get("http://localhost:8080/atom");
+    assertNotNull(resp);
+    assertEquals(resp.getType(),ResponseType.SUCCESS);
+    assertTrue(MimeTypeHelper.isMatch(resp.getContentType().toString(), Constants.APP_MEDIA_TYPE));
+    Document<Service> doc = resp.getDocument();
+    Service service = doc.getRoot();
+    assertEquals(service.getWorkspaces().size(),1);
+    Workspace workspace = service.getWorkspaces().get(0);
+    assertEquals(workspace.getCollections().size(),1);
+    Collection collection = workspace.getCollections().get(0);
+    assertEquals(collection.getResolvedHref().toString(), "http://localhost:8080/atom/feed");
+    assertEquals(collection.getTitle().toString(), "/atom/feed");
+    resp.release();
+  }
+  
+  public void testGetFeed() {
+    ClientResponse resp = client.get("http://localhost:8080/atom/feed");
+    assertNotNull(resp);
+    assertEquals(resp.getType(),ResponseType.SUCCESS);
+    assertTrue(MimeTypeHelper.isMatch(resp.getContentType().toString(), Constants.ATOM_MEDIA_TYPE));
+    Document<Feed> doc = resp.getDocument();
+    Feed feed = doc.getRoot();
+    assertEquals(feed.getId().toString(), "tag:example.org,2006:feed");
+    assertEquals(feed.getTitle(), "Simple");
+    assertEquals(feed.getAuthor().getName(), "Simple");
+    assertEquals(feed.getEntries().size(), 0);
+    resp.release();
+  }
+  
+  public void testPostEntry() {
+    Entry entry = abdera.newEntry();
+    entry.setId("http://localhost:8080/atom/feed/entries/1");
+    entry.setTitle("test entry");
+    entry.setContent("Test Content");
+    entry.addLink("http://example.org");
+    entry.setUpdated(new Date());
+    entry.addAuthor("James");
+    ClientResponse resp = client.post("http://localhost:8080/atom/feed", entry);
+    assertNotNull(resp);
+    assertEquals(resp.getType(),ResponseType.SUCCESS);
+    assertEquals(resp.getStatus(), 201);
+    assertNotNull(resp.getLocation());
+    resp.release();
+    resp = client.get("http://localhost:8080/atom/feed");
+    Document<Feed> feed_doc = resp.getDocument();
+    Feed feed = feed_doc.getRoot();
+    assertEquals(feed.getEntries().size(),1);
+  }
+  
+  public void testPostMedia() {
+    ByteArrayInputStream in = new ByteArrayInputStream(new byte[] {0x01,0x02,0x03,0x04});
+    RequestOptions options = client.getDefaultRequestOptions();
+    options.setContentType("application/octet-stream");
+    ClientResponse resp = client.post("http://localhost:8080/atom/feed", in, options);
+    assertEquals(resp.getType(),ResponseType.CLIENT_ERROR);
+    assertEquals(resp.getStatus(), 415);
+    resp.release();
+  }
+  
+  public void testPutEntry() {
+    ClientResponse resp = client.get("http://localhost:8080/atom/feed");
+    Document<Feed> feed_doc = resp.getDocument();
+    Feed feed = feed_doc.getRoot();
+    Entry entry = feed.getEntries().get(0);
+    String edit = entry.getEditLinkResolvedHref().toString();
+    resp.release();
+    resp = client.get(edit);
+    Document<Entry> doc = resp.getDocument();
+    entry = doc.getRoot();
+    entry.setTitle("This is the modified title");
+    resp.release();
+    resp = client.put(edit, entry);
+    assertEquals(resp.getType(), ResponseType.SUCCESS);
+    assertEquals(resp.getStatus(), 204);
+    resp.release();
+    resp = client.get(edit);
+    doc = resp.getDocument();
+    entry = doc.getRoot();
+    assertEquals(entry.getTitle(), "This is the modified title");
+    resp.release();
+    resp = client.get("http://localhost:8080/atom/feed");
+    feed_doc = resp.getDocument();
+    feed = feed_doc.getRoot();
+    assertEquals(feed.getEntries().size(),1);
+    resp.release();
+  }
+  
+  public void testDeleteEntry() {
+    ClientResponse resp = client.get("http://localhost:8080/atom/feed");
+    Document<Feed> feed_doc = resp.getDocument();
+    Feed feed = feed_doc.getRoot();
+    Entry entry = feed.getEntries().get(0);
+    String edit = entry.getEditLinkResolvedHref().toString();
+    resp.release();
+    resp = client.delete(edit);    
+    assertEquals(resp.getType(),ResponseType.SUCCESS);
+    resp.release();
+    resp = client.get("http://localhost:8080/atom/feed");
+    feed_doc = resp.getDocument();
+    feed = feed_doc.getRoot();
+    assertEquals(feed.getEntries().size(),0);
+    resp.release();
+  }
+}

Added: incubator/abdera/java/branches/server_refactor/src/test/java/org/apache/abdera/protocol/server/test/ext/TestExtendedProvider.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/branches/server_refactor/src/test/java/org/apache/abdera/protocol/server/test/ext/TestExtendedProvider.java?rev=613765&view=auto
==============================================================================
--- incubator/abdera/java/branches/server_refactor/src/test/java/org/apache/abdera/protocol/server/test/ext/TestExtendedProvider.java
(added)
+++ incubator/abdera/java/branches/server_refactor/src/test/java/org/apache/abdera/protocol/server/test/ext/TestExtendedProvider.java
Sun Jan 20 21:33:46 2008
@@ -0,0 +1,269 @@
+/*
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements.  The ASF licenses this file to You
+* under the Apache License, Version 2.0 (the "License"); you may not
+* use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.  For additional information regarding
+* copyright in this work, please see the NOTICE file in the top level
+* directory of this distribution.
+*/
+package org.apache.abdera.protocol.server.test.ext;
+
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.activation.MimeType;
+
+import org.apache.abdera.Abdera;
+import org.apache.abdera.factory.Factory;
+import org.apache.abdera.i18n.iri.IRI;
+import org.apache.abdera.model.Document;
+import org.apache.abdera.model.Entry;
+import org.apache.abdera.model.Feed;
+import org.apache.abdera.parser.ParseException;
+import org.apache.abdera.parser.Parser;
+import org.apache.abdera.protocol.server.CollectionAdapter;
+import org.apache.abdera.protocol.server.ProviderHelper;
+import org.apache.abdera.protocol.server.RequestContext;
+import org.apache.abdera.protocol.server.ResponseContext;
+import org.apache.abdera.protocol.server.TargetType;
+import org.apache.abdera.protocol.server.RequestContext.Scope;
+import org.apache.abdera.protocol.server.impl.AbstractResponseContext;
+import org.apache.abdera.protocol.server.impl.BaseResponseContext;
+import org.apache.abdera.protocol.server.impl.EmptyResponseContext;
+import org.apache.abdera.protocol.server.provider.ext.AbstractNamedCollectionAdapter;
+import org.apache.abdera.protocol.server.provider.ext.ExtendedProvider;
+import org.apache.abdera.protocol.server.provider.ext.ExtendedWorkspaceManager;
+import org.apache.abdera.protocol.server.provider.ext.NamedCollectionAdapter;
+import org.apache.abdera.protocol.server.provider.ext.SimpleWorkspaceInfo;
+import org.apache.abdera.protocol.server.provider.ext.WorkspaceInfo;
+import org.apache.abdera.util.MimeTypeHelper;
+
+public class TestExtendedProvider 
+  extends ExtendedProvider {
+  
+  private static final String SERVICES_BASE = "/atom";
+  
+  protected ExtendedWorkspaceManager initWorkspaceManager() {
+    return new TestWorkspaceManager();
+  }
+ 
+  public static class TestWorkspaceManager 
+    extends ExtendedWorkspaceManager {
+  
+    TestWorkspaceManager() {
+      SimpleWorkspaceInfo wi = new SimpleWorkspaceInfo();
+      wi.setName("Test");
+      Map<String,NamedCollectionAdapter> map = 
+        new HashMap<String,NamedCollectionAdapter>();
+      TestCollectionAdapter tca = new TestCollectionAdapter();
+      map.put(tca.getName(), tca);
+      wi.setCollectionAdapters(map);
+      this.setWorkspaceInfo(wi);
+    }
+    
+    public CollectionAdapter getCollectionAdapter(
+      RequestContext request) {
+        for (WorkspaceInfo wi : this.getWorkspaceInfo()) {
+          CollectionAdapter ca = wi.getCollectionAdapter(request);
+          if (ca != null) return ca;
+        }
+        return null;
+    }
+  }
+
+  public static class TestCollectionAdapter 
+    extends AbstractNamedCollectionAdapter {
+
+    public String getAuthor() {
+      return "James";
+    }
+
+    public String getName() {
+      return SERVICES_BASE + "/feed";
+    }
+
+    public String[] getPatterns(TargetType type) {
+      if (type.equals(TargetType.TYPE_COLLECTION)) {
+        return new String[] {getName()};
+      } else if (type.equals(TargetType.TYPE_ENTRY)) {
+        return new String[] {getName() + "/([^/?#]+)"};
+      } else return null;
+    }
+    
+    public String getId(RequestContext request) {
+      return request.getAbdera().getFactory().newUuidUri();
+    }
+
+    public String getTitle(RequestContext request) {
+      return "Test";
+    }
+    
+    private Document<Feed> feed_doc;
+    
+    private Document<Feed> init_feed_doc(Abdera abdera, RequestContext context) {
+      Feed feed = (Feed) context.getAttribute(Scope.SESSION, "feed");
+      if (feed == null) {
+        Factory factory = abdera.getFactory();
+        feed = factory.newFeed();
+        try {
+          feed.setId("tag:example.org,2006:feed");
+          feed.setTitle("Simple");
+          feed.setUpdated(new Date());
+          feed.addLink("");
+          feed.addLink("","self");
+          feed.addAuthor("Simple");
+        } catch (Exception e) {}
+        context.setAttribute(Scope.SESSION, "feed", "feed");
+      } 
+      return feed.getDocument();
+    }
+    
+    private synchronized Document<Feed> get_feed_doc(Abdera abdera, RequestContext
context) {
+      if (feed_doc == null) {
+        feed_doc = init_feed_doc(abdera, context);
+      }
+      return feed_doc;
+    }
+
+    public ResponseContext getFeed(
+      RequestContext request) {
+        Abdera abdera = request.getAbdera();
+        Document<Feed> feed = get_feed_doc(abdera, request);
+        AbstractResponseContext rc; 
+        rc = new BaseResponseContext<Document<Feed>>(feed);
+        rc.setEntityTag(calculateEntityTag(feed.getRoot()));
+        return rc;
+    }
+
+    public ResponseContext deleteEntry(
+      RequestContext request) {
+        Entry entry = getAbderaEntry(request);
+        if (entry != null)
+          entry.discard();
+        return new EmptyResponseContext(204);
+    }
+
+    public ResponseContext getEntry(
+      RequestContext request) {
+        Entry entry = (Entry) getAbderaEntry(request);
+        if (entry != null) {
+          Feed feed = entry.getParentElement();
+          entry = (Entry) entry.clone();
+          entry.setSource(feed.getAsSource());
+          Document<Entry> entry_doc = entry.getDocument();
+          AbstractResponseContext rc = new BaseResponseContext<Document<Entry>>(entry_doc);
+          rc.setEntityTag(calculateEntityTag(entry));
+          return rc;
+        } else {
+          return new EmptyResponseContext(404);
+        }
+    }
+
+    @SuppressWarnings("unchecked") 
+    public ResponseContext postEntry(
+      RequestContext request) {
+        Abdera abdera = request.getAbdera();
+        Factory factory = abdera.getFactory();
+        Parser parser = abdera.getParser();
+        try {
+          MimeType contentType = request.getContentType();
+          String ctype = (contentType != null) ? contentType.toString() : null;
+          if (ctype != null && !MimeTypeHelper.isAtom(ctype) && !MimeTypeHelper.isXml(ctype))
+            return new EmptyResponseContext(415);
+    
+          Document<Entry> entry_doc = 
+            (Document<Entry>) request.getDocument(parser).clone();
+          if (entry_doc != null) {
+            Entry entry = entry_doc.getRoot();
+            if (!ProviderHelper.isValidEntry(entry))
+              return new EmptyResponseContext(400);
+            entry.setUpdated(new Date());
+            entry.getIdElement().setValue(factory.newUuidUri());
+            entry.addLink("feed/" + entry.getId().toString(), "edit");
+            Feed feed = get_feed_doc(abdera, request).getRoot();
+            feed.insertEntry(entry);
+            feed.setUpdated(new Date());
+            BaseResponseContext<Entry> rc = new BaseResponseContext<Entry>(entry);
+            IRI baseUri = ProviderHelper.resolveBase(request);
+            rc.setLocation(baseUri.resolve(entry.getEditLinkResolvedHref()).toString());
+            rc.setContentLocation(rc.getLocation().toString());
+            rc.setEntityTag(calculateEntityTag(entry));
+            rc.setStatus(201);
+            return rc;
+          } else {
+            return new EmptyResponseContext(400);
+          }
+        } catch (ParseException pe) {
+          return new EmptyResponseContext(415);
+        } catch (ClassCastException cce) {
+          return new EmptyResponseContext(415);
+        } catch (Exception e) {
+          return new EmptyResponseContext(400);
+      }
+    }
+
+    @SuppressWarnings("unchecked") 
+    public ResponseContext putEntry(
+      RequestContext request) {
+        Abdera abdera = request.getAbdera();
+        Parser parser = abdera.getParser();
+        Entry orig_entry = getAbderaEntry(request);
+        if (orig_entry != null) {
+          try {
+            MimeType contentType = request.getContentType();
+            if (contentType != null && !MimeTypeHelper.isAtom(contentType.toString()))
+              return new EmptyResponseContext(415);
+            
+            Document<Entry> entry_doc = 
+              (Document<Entry>) request.getDocument(parser).clone();
+            if (entry_doc != null) {
+              Entry entry = entry_doc.getRoot();
+              if (!entry.getId().equals(orig_entry.getId()))
+                return new EmptyResponseContext(409);
+              if (!ProviderHelper.isValidEntry(entry))
+                return new EmptyResponseContext(400);
+              entry.setUpdated(new Date());
+              entry.getIdElement().setValue(orig_entry.getId().toString());
+              entry.addLink("atom/feed/" + entry.getId().toString(), "edit");
+              orig_entry.discard();
+              Feed feed = get_feed_doc(abdera, request).getRoot();
+              feed.insertEntry(entry);
+              feed.setUpdated(new Date());
+              return new EmptyResponseContext(204);
+            } else {
+              return new EmptyResponseContext(400);
+            }
+          } catch (ParseException pe) {
+            return new EmptyResponseContext(415);
+          } catch (ClassCastException cce) {
+            return new EmptyResponseContext(415);
+          } catch (Exception e) {
+            return new EmptyResponseContext(400);
+          }
+        } else {
+          return new EmptyResponseContext(404);
+        }
+    }
+    
+    private Entry getAbderaEntry(RequestContext request) {
+      Abdera abdera = request.getAbdera();
+      String entry_id = getEntryID(request);
+      Document<Feed> feed = get_feed_doc(abdera, request);
+      try { 
+        return feed.getRoot().getEntry(entry_id); 
+      } catch (Exception e) {}
+      return null;
+    }
+    
+  }
+}

Added: incubator/abdera/java/branches/server_refactor/src/test/java/org/apache/abdera/protocol/server/test/ext/TestProviderManager.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/branches/server_refactor/src/test/java/org/apache/abdera/protocol/server/test/ext/TestProviderManager.java?rev=613765&view=auto
==============================================================================
--- incubator/abdera/java/branches/server_refactor/src/test/java/org/apache/abdera/protocol/server/test/ext/TestProviderManager.java
(added)
+++ incubator/abdera/java/branches/server_refactor/src/test/java/org/apache/abdera/protocol/server/test/ext/TestProviderManager.java
Sun Jan 20 21:33:46 2008
@@ -0,0 +1,31 @@
+/*
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements.  The ASF licenses this file to You
+* under the Apache License, Version 2.0 (the "License"); you may not
+* use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.  For additional information regarding
+* copyright in this work, please see the NOTICE file in the top level
+* directory of this distribution.
+*/
+package org.apache.abdera.protocol.server.test.ext;
+
+import org.apache.abdera.protocol.server.Provider;
+import org.apache.abdera.protocol.server.impl.AbstractSingletonProviderManager;
+
+public class TestProviderManager 
+  extends AbstractSingletonProviderManager {
+
+  @Override
+  protected Provider initProvider() {
+    return new TestExtendedProvider();
+  }
+
+}

Added: incubator/abdera/java/branches/server_refactor/src/test/java/org/apache/abdera/protocol/server/test/ext/TestServiceContext.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/branches/server_refactor/src/test/java/org/apache/abdera/protocol/server/test/ext/TestServiceContext.java?rev=613765&view=auto
==============================================================================
--- incubator/abdera/java/branches/server_refactor/src/test/java/org/apache/abdera/protocol/server/test/ext/TestServiceContext.java
(added)
+++ incubator/abdera/java/branches/server_refactor/src/test/java/org/apache/abdera/protocol/server/test/ext/TestServiceContext.java
Sun Jan 20 21:33:46 2008
@@ -0,0 +1,30 @@
+/*
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements.  The ASF licenses this file to You
+* under the Apache License, Version 2.0 (the "License"); you may not
+* use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.  For additional information regarding
+* copyright in this work, please see the NOTICE file in the top level
+* directory of this distribution.
+*/
+package org.apache.abdera.protocol.server.test.ext;
+
+import org.apache.abdera.protocol.server.impl.DefaultServiceContext;
+
+public class TestServiceContext 
+  extends DefaultServiceContext {
+
+  public TestServiceContext() {
+    this.defaultprovidermanager = TestProviderManager.class.getName();
+    this.defaulttargetresolver = TestTargetResolver.class.getName();
+  }
+  
+}

Added: incubator/abdera/java/branches/server_refactor/src/test/java/org/apache/abdera/protocol/server/test/ext/TestTargetResolver.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/branches/server_refactor/src/test/java/org/apache/abdera/protocol/server/test/ext/TestTargetResolver.java?rev=613765&view=auto
==============================================================================
--- incubator/abdera/java/branches/server_refactor/src/test/java/org/apache/abdera/protocol/server/test/ext/TestTargetResolver.java
(added)
+++ incubator/abdera/java/branches/server_refactor/src/test/java/org/apache/abdera/protocol/server/test/ext/TestTargetResolver.java
Sun Jan 20 21:33:46 2008
@@ -0,0 +1,32 @@
+/*
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements.  The ASF licenses this file to You
+* under the Apache License, Version 2.0 (the "License"); you may not
+* use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.  For additional information regarding
+* copyright in this work, please see the NOTICE file in the top level
+* directory of this distribution.
+*/
+package org.apache.abdera.protocol.server.test.ext;
+
+import org.apache.abdera.protocol.server.TargetType;
+import org.apache.abdera.protocol.server.impl.RegexTargetResolver;
+
+public class TestTargetResolver 
+  extends RegexTargetResolver {
+
+  public TestTargetResolver() {
+    setPattern("/atom(\\?[^#]*)?", TargetType.TYPE_SERVICE);
+    setPattern("/atom/feed(\\?[^#]*)?", TargetType.TYPE_COLLECTION);
+    setPattern("/atom/feed/([^/#?]+)(\\?[^#]*)?", TargetType.TYPE_ENTRY);
+  }
+  
+}

Added: incubator/abdera/java/branches/server_refactor/src/test/java/org/apache/abdera/protocol/server/test/simple/SimpleProvider.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/branches/server_refactor/src/test/java/org/apache/abdera/protocol/server/test/simple/SimpleProvider.java?rev=613765&view=auto
==============================================================================
--- incubator/abdera/java/branches/server_refactor/src/test/java/org/apache/abdera/protocol/server/test/simple/SimpleProvider.java
(added)
+++ incubator/abdera/java/branches/server_refactor/src/test/java/org/apache/abdera/protocol/server/test/simple/SimpleProvider.java
Sun Jan 20 21:33:46 2008
@@ -0,0 +1,275 @@
+/*
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements.  The ASF licenses this file to You
+* under the Apache License, Version 2.0 (the "License"); you may not
+* use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.  For additional information regarding
+* copyright in this work, please see the NOTICE file in the top level
+* directory of this distribution.
+*/
+package org.apache.abdera.protocol.server.test.simple;
+
+import java.io.IOException;
+import java.util.Date;
+
+import javax.activation.MimeType;
+
+import org.apache.abdera.Abdera;
+import org.apache.abdera.factory.Factory;
+import org.apache.abdera.i18n.iri.IRI;
+import org.apache.abdera.i18n.text.UrlEncoding;
+import org.apache.abdera.model.Base;
+import org.apache.abdera.model.Document;
+import org.apache.abdera.model.Entry;
+import org.apache.abdera.model.Feed;
+import org.apache.abdera.parser.ParseException;
+import org.apache.abdera.parser.Parser;
+import org.apache.abdera.protocol.server.CollectionAdapter;
+import org.apache.abdera.protocol.server.ProviderHelper;
+import org.apache.abdera.protocol.server.RequestContext;
+import org.apache.abdera.protocol.server.ResponseContext;
+import org.apache.abdera.protocol.server.TargetType;
+import org.apache.abdera.protocol.server.RequestContext.Scope;
+import org.apache.abdera.protocol.server.impl.AbstractResponseContext;
+import org.apache.abdera.protocol.server.impl.AbstractWorkspaceManagerProvider;
+import org.apache.abdera.protocol.server.impl.BaseResponseContext;
+import org.apache.abdera.protocol.server.impl.EmptyResponseContext;
+import org.apache.abdera.protocol.server.impl.StreamWriterResponseContext;
+import org.apache.abdera.util.Constants;
+import org.apache.abdera.util.EntityTag;
+import org.apache.abdera.util.MimeTypeHelper;
+import org.apache.abdera.writer.StreamWriter;
+
+@SuppressWarnings("unchecked")
+public class SimpleProvider 
+  extends AbstractWorkspaceManagerProvider
+  implements CollectionAdapter {
+    
+  public CollectionAdapter getCollectionAdapter(
+    RequestContext request) {
+      return this;
+  }
+
+  private EntityTag service_etag = new EntityTag("simple");
+  private Document<Feed> feed_doc;
+  
+  private Document<Feed> init_feed_doc(Abdera abdera, RequestContext context) {
+    Feed feed = (Feed) context.getAttribute(Scope.SESSION, "feed");
+    if (feed == null) {
+      Factory factory = abdera.getFactory();
+      feed = factory.newFeed();
+      try {
+        feed.setId("tag:example.org,2006:feed");
+        feed.setTitle("Simple");
+        feed.setUpdated(new Date());
+        feed.addLink("");
+        feed.addLink("","self");
+        feed.addAuthor("Simple");
+      } catch (Exception e) {}
+      context.setAttribute(Scope.SESSION, "feed", "feed");
+    } 
+    return feed.getDocument();
+  }
+  
+  private synchronized Document<Feed> get_feed_doc(Abdera abdera, RequestContext context)
{
+    if (feed_doc == null) {
+      feed_doc = init_feed_doc(abdera, context);
+    }
+    return feed_doc;
+  }
+
+  
+  protected ResponseContext getServiceDocument(
+    RequestContext request) {
+      Abdera abdera = request.getAbdera();
+      AbstractResponseContext rc = 
+        new StreamWriterResponseContext(abdera) {
+          protected void writeTo(
+            StreamWriter sw) 
+              throws IOException {
+            sw.startDocument()
+              .startService()
+              .startWorkspace()
+              .writeTitle("Simple")
+              .startCollection("atom/feed")
+              .writeTitle("Simple")
+              .writeAcceptsEntry()
+              .startCategories(false)
+              .endCategories()
+              .endCollection()
+              .endWorkspace()
+              .endService()
+              .endDocument();
+          }
+        }; 
+      rc.setStatus(200);
+      rc.setEntityTag(service_etag);
+      rc.setContentType(Constants.APP_MEDIA_TYPE);
+      return rc;
+  }
+
+  public ResponseContext getFeed(
+    RequestContext request) {
+      Abdera abdera = request.getAbdera();
+      Document<Feed> feed = get_feed_doc(abdera, request);
+      AbstractResponseContext rc; 
+      rc = new BaseResponseContext<Document<Feed>>(feed);
+      rc.setEntityTag(calculateEntityTag(feed.getRoot()));
+      return rc;
+  }
+
+  
+  public ResponseContext deleteEntry(
+    RequestContext request) {
+      Entry entry = getAbderaEntry(request);
+      if (entry != null)
+        entry.discard();
+      return new EmptyResponseContext(204);
+  }
+
+  public ResponseContext getEntry(
+    RequestContext request) {
+      Entry entry = (Entry) getAbderaEntry(request);
+      if (entry != null) {
+        Feed feed = entry.getParentElement();
+        entry = (Entry) entry.clone();
+        entry.setSource(feed.getAsSource());
+        Document<Entry> entry_doc = entry.getDocument();
+        AbstractResponseContext rc = new BaseResponseContext<Document<Entry>>(entry_doc);
+        rc.setEntityTag(calculateEntityTag(entry));
+        return rc;
+      } else {
+        return new EmptyResponseContext(404);
+      }
+  }
+
+  public ResponseContext postEntry(
+    RequestContext request) {
+      Abdera abdera = request.getAbdera();
+      Factory factory = abdera.getFactory();
+      Parser parser = abdera.getParser();
+      try {
+        MimeType contentType = request.getContentType();
+        String ctype = (contentType != null) ? contentType.toString() : null;
+        if (ctype != null && !MimeTypeHelper.isAtom(ctype) && !MimeTypeHelper.isXml(ctype))
+          return new EmptyResponseContext(415);
+  
+        Document<Entry> entry_doc = 
+          (Document<Entry>) request.getDocument(parser).clone();
+        if (entry_doc != null) {
+          Entry entry = entry_doc.getRoot();
+          if (!ProviderHelper.isValidEntry(entry))
+            return new EmptyResponseContext(400);
+          entry.setUpdated(new Date());
+          entry.getIdElement().setValue(factory.newUuidUri());
+          entry.addLink("feed/" + entry.getId().toString(), "edit");
+          Feed feed = get_feed_doc(abdera, request).getRoot();
+          feed.insertEntry(entry);
+          feed.setUpdated(new Date());
+          BaseResponseContext rc = new BaseResponseContext(entry);
+          IRI baseUri = ProviderHelper.resolveBase(request);
+          rc.setLocation(baseUri.resolve(entry.getEditLinkResolvedHref()).toString());
+          rc.setContentLocation(rc.getLocation().toString());
+          rc.setEntityTag(calculateEntityTag(entry));
+          rc.setStatus(201);
+          return rc;
+        } else {
+          return new EmptyResponseContext(400);
+        }
+      } catch (ParseException pe) {
+        return new EmptyResponseContext(415);
+      } catch (ClassCastException cce) {
+        return new EmptyResponseContext(415);
+      } catch (Exception e) {
+        return new EmptyResponseContext(400);
+    }
+  }
+
+  public ResponseContext putEntry(
+    RequestContext request) {
+      Abdera abdera = request.getAbdera();
+      Parser parser = abdera.getParser();
+      Entry orig_entry = getAbderaEntry(request);
+      if (orig_entry != null) {
+        try {
+          MimeType contentType = request.getContentType();
+          if (contentType != null && !MimeTypeHelper.isAtom(contentType.toString()))
+            return new EmptyResponseContext(415);
+          
+          Document<Entry> entry_doc = 
+            (Document<Entry>) request.getDocument(parser).clone();
+          if (entry_doc != null) {
+            Entry entry = entry_doc.getRoot();
+            if (!entry.getId().equals(orig_entry.getId()))
+              return new EmptyResponseContext(409);
+            if (!ProviderHelper.isValidEntry(entry))
+              return new EmptyResponseContext(400);
+            entry.setUpdated(new Date());
+            entry.getIdElement().setValue(orig_entry.getId().toString());
+            entry.addLink("atom/feed/" + entry.getId().toString(), "edit");
+            orig_entry.discard();
+            Feed feed = get_feed_doc(abdera, request).getRoot();
+            feed.insertEntry(entry);
+            feed.setUpdated(new Date());
+            return new EmptyResponseContext(204);
+          } else {
+            return new EmptyResponseContext(400);
+          }
+        } catch (ParseException pe) {
+          return new EmptyResponseContext(415);
+        } catch (ClassCastException cce) {
+          return new EmptyResponseContext(415);
+        } catch (Exception e) {
+          return new EmptyResponseContext(400);
+        }
+      } else {
+        return new EmptyResponseContext(404);
+      }
+  }
+  
+  private EntityTag calculateEntityTag(Base base) {
+    String id = null;
+    String modified = null;
+    if (base instanceof Entry) {
+      id = ((Entry)base).getId().toString();
+      modified = ((Entry)base).getUpdatedElement().getText();
+    } else if (base instanceof Feed) {
+      id = ((Feed)base).getId().toString();
+      modified = ((Feed)base).getUpdatedElement().getText();
+    }
+    return EntityTag.generate(id, modified);      
+  }
+  
+  private Entry getAbderaEntry(RequestContext request) {
+    Abdera abdera = request.getAbdera();
+    String entry_id = getEntryID(request);
+    Document<Feed> feed = get_feed_doc(abdera, request);
+    try { 
+      return feed.getRoot().getEntry(entry_id); 
+    } catch (Exception e) {}
+    return null;
+  }
+  
+  private String getEntryID(RequestContext request) {
+    if (request.getTarget().getType() != TargetType.TYPE_ENTRY) 
+      return null;
+    String path = request.getUri().toString();
+    String[] segments = path.split("/");
+    return UrlEncoding.decode(segments[segments.length-1]);
+  }
+  
+  public ResponseContext extensionRequest(RequestContext request) {
+    return ProviderHelper.notallowed(
+      request, 
+      "Method Not Allowed", 
+      this.getMethods(request));
+  }
+}

Added: incubator/abdera/java/branches/server_refactor/src/test/java/org/apache/abdera/protocol/server/test/simple/SimpleProviderManager.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/branches/server_refactor/src/test/java/org/apache/abdera/protocol/server/test/simple/SimpleProviderManager.java?rev=613765&view=auto
==============================================================================
--- incubator/abdera/java/branches/server_refactor/src/test/java/org/apache/abdera/protocol/server/test/simple/SimpleProviderManager.java
(added)
+++ incubator/abdera/java/branches/server_refactor/src/test/java/org/apache/abdera/protocol/server/test/simple/SimpleProviderManager.java
Sun Jan 20 21:33:46 2008
@@ -0,0 +1,31 @@
+/*
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements.  The ASF licenses this file to You
+* under the Apache License, Version 2.0 (the "License"); you may not
+* use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.  For additional information regarding
+* copyright in this work, please see the NOTICE file in the top level
+* directory of this distribution.
+*/
+package org.apache.abdera.protocol.server.test.simple;
+
+import org.apache.abdera.protocol.server.Provider;
+import org.apache.abdera.protocol.server.impl.AbstractSingletonProviderManager;
+
+public class SimpleProviderManager 
+  extends AbstractSingletonProviderManager {
+
+  @Override
+  protected Provider initProvider() {
+    return new SimpleProvider();
+  }
+
+}

Added: incubator/abdera/java/branches/server_refactor/src/test/java/org/apache/abdera/protocol/server/test/simple/SimpleServiceContext.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/branches/server_refactor/src/test/java/org/apache/abdera/protocol/server/test/simple/SimpleServiceContext.java?rev=613765&view=auto
==============================================================================
--- incubator/abdera/java/branches/server_refactor/src/test/java/org/apache/abdera/protocol/server/test/simple/SimpleServiceContext.java
(added)
+++ incubator/abdera/java/branches/server_refactor/src/test/java/org/apache/abdera/protocol/server/test/simple/SimpleServiceContext.java
Sun Jan 20 21:33:46 2008
@@ -0,0 +1,30 @@
+/*
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements.  The ASF licenses this file to You
+* under the Apache License, Version 2.0 (the "License"); you may not
+* use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.  For additional information regarding
+* copyright in this work, please see the NOTICE file in the top level
+* directory of this distribution.
+*/
+package org.apache.abdera.protocol.server.test.simple;
+
+import org.apache.abdera.protocol.server.impl.DefaultServiceContext;
+
+public class SimpleServiceContext 
+  extends DefaultServiceContext {
+
+  public SimpleServiceContext() {
+    this.defaultprovidermanager = SimpleProviderManager.class.getName();
+    this.defaulttargetresolver = SimpleTargetResolver.class.getName();
+  }
+  
+}

Added: incubator/abdera/java/branches/server_refactor/src/test/java/org/apache/abdera/protocol/server/test/simple/SimpleTargetResolver.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/branches/server_refactor/src/test/java/org/apache/abdera/protocol/server/test/simple/SimpleTargetResolver.java?rev=613765&view=auto
==============================================================================
--- incubator/abdera/java/branches/server_refactor/src/test/java/org/apache/abdera/protocol/server/test/simple/SimpleTargetResolver.java
(added)
+++ incubator/abdera/java/branches/server_refactor/src/test/java/org/apache/abdera/protocol/server/test/simple/SimpleTargetResolver.java
Sun Jan 20 21:33:46 2008
@@ -0,0 +1,32 @@
+/*
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements.  The ASF licenses this file to You
+* under the Apache License, Version 2.0 (the "License"); you may not
+* use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.  For additional information regarding
+* copyright in this work, please see the NOTICE file in the top level
+* directory of this distribution.
+*/
+package org.apache.abdera.protocol.server.test.simple;
+
+import org.apache.abdera.protocol.server.TargetType;
+import org.apache.abdera.protocol.server.impl.RegexTargetResolver;
+
+public class SimpleTargetResolver 
+  extends RegexTargetResolver {
+
+  public SimpleTargetResolver() {
+    setPattern("/atom(\\?[^#]*)?", TargetType.TYPE_SERVICE);
+    setPattern("/atom/feed(\\?[^#]*)?", TargetType.TYPE_COLLECTION);
+    setPattern("/atom/feed/([^/#?]+)(\\?[^#]*)?", TargetType.TYPE_ENTRY);
+  }
+  
+}

Added: incubator/abdera/java/branches/server_refactor/src/test/java/org/apache/abdera/protocol/server/test/simple/SimpleTest.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/branches/server_refactor/src/test/java/org/apache/abdera/protocol/server/test/simple/SimpleTest.java?rev=613765&view=auto
==============================================================================
--- incubator/abdera/java/branches/server_refactor/src/test/java/org/apache/abdera/protocol/server/test/simple/SimpleTest.java
(added)
+++ incubator/abdera/java/branches/server_refactor/src/test/java/org/apache/abdera/protocol/server/test/simple/SimpleTest.java
Sun Jan 20 21:33:46 2008
@@ -0,0 +1,166 @@
+/*
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements.  The ASF licenses this file to You
+* under the Apache License, Version 2.0 (the "License"); you may not
+* use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.  For additional information regarding
+* copyright in this work, please see the NOTICE file in the top level
+* directory of this distribution.
+*/
+package org.apache.abdera.protocol.server.test.simple;
+
+import java.io.ByteArrayInputStream;
+import java.util.Date;
+
+import junit.framework.TestCase;
+
+import org.apache.abdera.Abdera;
+import org.apache.abdera.model.Collection;
+import org.apache.abdera.model.Document;
+import org.apache.abdera.model.Entry;
+import org.apache.abdera.model.Feed;
+import org.apache.abdera.model.Service;
+import org.apache.abdera.model.Workspace;
+import org.apache.abdera.protocol.Response.ResponseType;
+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.test.JettyServer;
+import org.apache.abdera.util.Constants;
+import org.apache.abdera.util.MimeTypeHelper;
+
+public class SimpleTest 
+  extends TestCase {
+
+  private static JettyServer server;
+  private static Abdera abdera = Abdera.getInstance();
+  private static AbderaClient client = new AbderaClient();
+
+  public SimpleTest() {
+    try {
+      if (server == null) {
+        server = new JettyServer();
+        server.start(SimpleServiceContext.class);
+      }
+    } catch (Exception e) {}
+  }
+  
+  private int count = 5;
+  
+  @Override protected void tearDown() throws Exception {
+    if (--count == 0) server.stop();
+  }
+  
+  public void testGetService() {
+    ClientResponse resp = client.get("http://localhost:8080/atom");
+    assertNotNull(resp);
+    assertEquals(resp.getType(),ResponseType.SUCCESS);
+    assertTrue(MimeTypeHelper.isMatch(resp.getContentType().toString(), Constants.APP_MEDIA_TYPE));
+    Document<Service> doc = resp.getDocument();
+    Service service = doc.getRoot();
+    assertEquals(service.getWorkspaces().size(),1);
+    Workspace workspace = service.getWorkspaces().get(0);
+    assertEquals(workspace.getCollections().size(),1);
+    Collection collection = workspace.getCollections().get(0);
+    assertEquals(collection.getResolvedHref().toString(), "http://localhost:8080/atom/feed");
+    assertEquals(collection.getTitle().toString(), "Simple");
+    resp.release();
+  }
+  
+  public void testGetFeed() {
+    ClientResponse resp = client.get("http://localhost:8080/atom/feed");
+    assertNotNull(resp);
+    assertEquals(resp.getType(),ResponseType.SUCCESS);
+    assertTrue(MimeTypeHelper.isMatch(resp.getContentType().toString(), Constants.ATOM_MEDIA_TYPE));
+    Document<Feed> doc = resp.getDocument();
+    Feed feed = doc.getRoot();
+    assertEquals(feed.getId().toString(), "tag:example.org,2006:feed");
+    assertEquals(feed.getTitle(), "Simple");
+    assertEquals(feed.getAuthor().getName(), "Simple");
+    assertEquals(feed.getEntries().size(), 0);
+    resp.release();
+  }
+  
+  public void testPostEntry() {
+    Entry entry = abdera.newEntry();
+    entry.setId("http://localhost:8080/atom/feed/entries/1");
+    entry.setTitle("test entry");
+    entry.setContent("Test Content");
+    entry.addLink("http://example.org");
+    entry.setUpdated(new Date());
+    entry.addAuthor("James");
+    ClientResponse resp = client.post("http://localhost:8080/atom/feed", entry);
+    assertNotNull(resp);
+    assertEquals(resp.getType(),ResponseType.SUCCESS);
+    assertEquals(resp.getStatus(), 201);
+    assertNotNull(resp.getLocation());
+    resp.release();
+    resp = client.get("http://localhost:8080/atom/feed");
+    Document<Feed> feed_doc = resp.getDocument();
+    Feed feed = feed_doc.getRoot();
+    assertEquals(feed.getEntries().size(),1);
+  }
+  
+  public void testPostMedia() {
+    ByteArrayInputStream in = new ByteArrayInputStream(new byte[] {0x01,0x02,0x03,0x04});
+    RequestOptions options = client.getDefaultRequestOptions();
+    options.setContentType("application/octet-stream");
+    ClientResponse resp = client.post("http://localhost:8080/atom/feed", in, options);
+    assertEquals(resp.getType(),ResponseType.CLIENT_ERROR);
+    assertEquals(resp.getStatus(), 415);
+    resp.release();
+  }
+  
+  public void testPutEntry() {
+    ClientResponse resp = client.get("http://localhost:8080/atom/feed");
+    Document<Feed> feed_doc = resp.getDocument();
+    Feed feed = feed_doc.getRoot();
+    Entry entry = feed.getEntries().get(0);
+    String edit = entry.getEditLinkResolvedHref().toString();
+    resp.release();
+    resp = client.get(edit);
+    Document<Entry> doc = resp.getDocument();
+    entry = doc.getRoot();
+    entry.setTitle("This is the modified title");
+    resp.release();
+    resp = client.put(edit, entry);
+    assertEquals(resp.getType(), ResponseType.SUCCESS);
+    assertEquals(resp.getStatus(), 204);
+    resp.release();
+    resp = client.get(edit);
+    doc = resp.getDocument();
+    entry = doc.getRoot();
+    assertEquals(entry.getTitle(), "This is the modified title");
+    resp.release();
+    resp = client.get("http://localhost:8080/atom/feed");
+    feed_doc = resp.getDocument();
+    feed = feed_doc.getRoot();
+    assertEquals(feed.getEntries().size(),1);
+    resp.release();
+  }
+  
+  public void testDeleteEntry() {
+    ClientResponse resp = client.get("http://localhost:8080/atom/feed");
+    Document<Feed> feed_doc = resp.getDocument();
+    Feed feed = feed_doc.getRoot();
+    Entry entry = feed.getEntries().get(0);
+    String edit = entry.getEditLinkResolvedHref().toString();
+    resp.release();
+    resp = client.delete(edit);    
+    assertEquals(resp.getType(),ResponseType.SUCCESS);
+    resp.release();
+    resp = client.get("http://localhost:8080/atom/feed");
+    feed_doc = resp.getDocument();
+    feed = feed_doc.getRoot();
+    assertEquals(feed.getEntries().size(),0);
+    resp.release();
+  }
+}

Added: incubator/abdera/java/branches/server_refactor/src/test/resources/abdera/adapter/sample.properties
URL: http://svn.apache.org/viewvc/incubator/abdera/java/branches/server_refactor/src/test/resources/abdera/adapter/sample.properties?rev=613765&view=auto
==============================================================================
--- incubator/abdera/java/branches/server_refactor/src/test/resources/abdera/adapter/sample.properties
(added)
+++ incubator/abdera/java/branches/server_refactor/src/test/resources/abdera/adapter/sample.properties
Sun Jan 20 21:33:46 2008
@@ -0,0 +1,4 @@
+feedUri=http://localhost:8080/sample
+adapterClassName=org.apache.abdera.protocol.server.provider.basic.SampleBasicAdapter
+title=title for any sample feed
+author=rayc
\ No newline at end of file



Mime
View raw message