incubator-ftpserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n..@apache.org
Subject svn commit: r490759 - /incubator/ftpserver/trunk/core/src/test/org/apache/ftpserver/usermanager/WritePermissionTest.java
Date Thu, 28 Dec 2006 16:41:40 GMT
Author: ngn
Date: Thu Dec 28 08:41:40 2006
New Revision: 490759

URL: http://svn.apache.org/viewvc?view=rev&rev=490759
Log:
Adding test for WritePermission that was excluded from last commit by mistake

Added:
    incubator/ftpserver/trunk/core/src/test/org/apache/ftpserver/usermanager/WritePermissionTest.java
  (with props)

Added: incubator/ftpserver/trunk/core/src/test/org/apache/ftpserver/usermanager/WritePermissionTest.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/test/org/apache/ftpserver/usermanager/WritePermissionTest.java?view=auto&rev=490759
==============================================================================
--- incubator/ftpserver/trunk/core/src/test/org/apache/ftpserver/usermanager/WritePermissionTest.java
(added)
+++ incubator/ftpserver/trunk/core/src/test/org/apache/ftpserver/usermanager/WritePermissionTest.java
Thu Dec 28 08:41:40 2006
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  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.
+ */  
+
+package org.apache.ftpserver.usermanager;
+
+
+
+import junit.framework.TestCase;
+
+public class WritePermissionTest extends TestCase {
+    
+
+    public void testRootDir() throws Exception {
+        WritePermission permission = new WritePermission("/");
+        
+        assertTrue(permission.authorize(new WriteRequest("/")));    
+    }
+    
+    
+    public void testDirs() throws Exception {
+        WritePermission permission = new WritePermission("/bar");
+        
+        assertFalse(permission.authorize(new WriteRequest("/foo")));    
+        assertFalse(permission.authorize(new WriteRequest("/foo/bar")));    
+        assertTrue(permission.authorize(new WriteRequest("/bar")));    
+        assertTrue(permission.authorize(new WriteRequest("/bar/foo")));    
+    }
+
+}

Propchange: incubator/ftpserver/trunk/core/src/test/org/apache/ftpserver/usermanager/WritePermissionTest.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message