tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1401468 - /tomcat/sandbox/trunk-resources/test/org/apache/catalina/webresources/TestFileResourceSet.java
Date Tue, 23 Oct 2012 20:58:29 GMT
Author: markt
Date: Tue Oct 23 20:58:29 2012
New Revision: 1401468

URL: http://svn.apache.org/viewvc?rev=1401468&view=rev
Log:
Missed file

Added:
    tomcat/sandbox/trunk-resources/test/org/apache/catalina/webresources/TestFileResourceSet.java
  (with props)

Added: tomcat/sandbox/trunk-resources/test/org/apache/catalina/webresources/TestFileResourceSet.java
URL: http://svn.apache.org/viewvc/tomcat/sandbox/trunk-resources/test/org/apache/catalina/webresources/TestFileResourceSet.java?rev=1401468&view=auto
==============================================================================
--- tomcat/sandbox/trunk-resources/test/org/apache/catalina/webresources/TestFileResourceSet.java
(added)
+++ tomcat/sandbox/trunk-resources/test/org/apache/catalina/webresources/TestFileResourceSet.java
Tue Oct 23 20:58:29 2012
@@ -0,0 +1,63 @@
+/*
+ * 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.catalina.webresources;
+
+import java.io.File;
+
+import org.apache.catalina.WebResourceRoot;
+import org.apache.catalina.WebResourceSet;
+
+public class TestFileResourceSet extends AbstractTestResourceSet {
+
+    @Override
+    public WebResourceRoot getWebResourceRoot() {
+        File f = new File(getBaseDir());
+        TesterWebResourceRoot root = new TesterWebResourceRoot();
+        WebResourceSet webResourceSet =
+                new DirResourceSet(new TesterWebResourceRoot(),
+                        f.getAbsolutePath(), "", "");
+        root.setWebResourceSet(webResourceSet);
+
+        WebResourceSet f1 = new FileResourceSet(root,
+                "test/webresources/dir1/f1.txt", "f1.txt", "");
+        root.addPreResources(f1);
+
+        WebResourceSet f2 = new FileResourceSet(root,
+                "test/webresources/dir1/f2.txt", "f2.txt", "");
+        root.addPreResources(f2);
+
+        WebResourceSet d1f1 = new FileResourceSet(root,
+                "test/webresources/dir1/d1/d1-f1.txt", "d1/d1-f1.txt", "");
+        root.addPreResources(d1f1);
+
+        WebResourceSet d2f1 = new FileResourceSet(root,
+                "test/webresources/dir1/d2/d2-f1.txt", "d2/d2-f1.txt", "");
+        root.addPreResources(d2f1);
+
+        return root;
+    }
+
+    @Override
+    protected boolean isWriteable() {
+        return true;
+    }
+
+    @Override
+    public String getBaseDir() {
+        return "test/webresources/dir2";
+    }
+}

Propchange: tomcat/sandbox/trunk-resources/test/org/apache/catalina/webresources/TestFileResourceSet.java
------------------------------------------------------------------------------
    svn:eol-style = native



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message