]> source.dussan.org Git - archiva.git/commitdiff
MRM-781 - Removal of Archiva-Webdav implementation in favor of Jackrabbit-webdav
authorJames William Dumay <jdumay@apache.org>
Wed, 4 Jun 2008 05:52:40 +0000 (05:52 +0000)
committerJames William Dumay <jdumay@apache.org>
Wed, 4 Jun 2008 05:52:40 +0000 (05:52 +0000)
* DELETE should 404 if resource does not exist
* 93% litmus coverage

git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@662989 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavResource.java
archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/DavResourceTest.java

index 78c1b0c8f97db2d50cb2580dec07fbf55c761ad7..ee4602f92b188dacf124d38126ee4d56e0441f94 100644 (file)
@@ -329,6 +329,10 @@ public class ArchivaDavResource
                 throw new DavException( HttpServletResponse.SC_INTERNAL_SERVER_ERROR );
             }
         }
+        else
+        {
+            throw new DavException( HttpServletResponse.SC_NOT_FOUND );
+        }
     }
 
     public void move( DavResource destination )
index 46cd3af722e86f83cdf2a0f8c85b71939934b598..e091461a95f63f1a986acb251473bdc82cfbc878 100644 (file)
@@ -90,6 +90,22 @@ public class DavResourceTest extends PlexusInSpringTestCase
         return new ArchivaDavResource(file.getAbsolutePath(), logicalPath, mimeTypes, session, resourceLocator, resourceFactory);
     }
     
+    public void testDeleteNonExistantResourceShould404()
+        throws Exception
+    {
+        File dir = new File(baseDir, "testdir");
+        try
+        {
+            DavResource directoryResource = getDavResource("/testdir", dir);
+            directoryResource.getCollection().removeMember(directoryResource);
+            fail("Did not throw DavException");
+        }
+        catch (DavException e)
+        {
+            assertEquals(DavServletResponse.SC_NOT_FOUND, e.getErrorCode());
+        }
+    }
+    
     public void testDeleteCollection()
         throws Exception
     {