You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by rg...@apache.org on 2009/01/07 14:28:51 UTC
svn commit: r732328 [2/2] - in /commons/proper/vfs/trunk: ./ core/
core/src/main/java/org/apache/commons/vfs/impl/
core/src/main/java/org/apache/commons/vfs/provider/http/
core/src/main/java/org/apache/commons/vfs/provider/webdav/
core/src/test/java/co...
Modified: commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/test/AbstractProviderTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/test/AbstractProviderTestCase.java?rev=732328&r1=732327&r2=732328&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/test/AbstractProviderTestCase.java (original)
+++ commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/test/AbstractProviderTestCase.java Wed Jan 7 05:28:48 2009
@@ -24,6 +24,7 @@
import org.apache.commons.vfs.FileSystemException;
import org.apache.commons.vfs.FileType;
import org.apache.commons.vfs.FileSystemManager;
+import org.apache.commons.vfs.FileSystem;
import org.apache.commons.vfs.impl.DefaultFileSystemManager;
import org.apache.commons.vfs.provider.AbstractFileSystem;
import org.apache.commons.vfs.provider.local.DefaultLocalFileProvider;
@@ -35,6 +36,10 @@
import java.net.URLConnection;
import java.util.Arrays;
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import junit.framework.TestCase;
+
/**
* File system test cases, which verifies the structure and naming
* functionality.
@@ -54,6 +59,7 @@
private DefaultFileSystemManager manager;
private ProviderTestConfig providerConfig;
private Method method;
+ private boolean addEmptyDir;
// Expected contents of "file1.txt"
public static final String FILE1_CONTENT = "This is a test file.";
@@ -113,7 +119,7 @@
* some provider config do some post-initialization in getBaseTestFolder.
* This is a hack to allow access to this code for <code>createManager</code>
*/
- protected FileObject getBaseTestFolder(FileSystemManager fs) throws Exception
+ public FileObject getBaseTestFolder(FileSystemManager fs) throws Exception
{
return providerConfig.getBaseTestFolder(fs);
}
@@ -181,9 +187,14 @@
for (int i = 0; i < caps.length; i++)
{
final Capability cap = caps[i];
- if (!readFolder.getFileSystem().hasCapability(cap))
+ FileSystem fs = readFolder.getFileSystem();
+ String name = fs.getClass().getName();
+ int index = name.lastIndexOf('.');
+ String fsName = (index > 0) ? name.substring(index + 1) : name;
+ if (!fs.hasCapability(cap))
{
- System.out.println("skipping " + getName() + " because fs does not have cap " + cap);
+ System.out.println("skipping " + getName() + " because " +
+ fsName + " does not have capability " + cap);
return;
}
}
@@ -325,7 +336,10 @@
base.addFile("file space.txt", FILE1_CONTENT);
base.addFile("empty.txt", "");
- base.addFolder("emptydir");
+ if (addEmptyDir)
+ {
+ base.addFolder("emptydir");
+ }
final FileInfo dir = base.addFolder("dir1");
dir.addFile("file1.txt", TEST_FILE_CONTENT);
@@ -349,4 +363,25 @@
return base;
}
+
+ protected void addEmptyDir(boolean addEmptyDir)
+ {
+ this.addEmptyDir = addEmptyDir;
+ }
+
+ protected static Test notConfigured(Class testClass)
+ {
+ return warning(testClass + " is not configured for tests, skipping");
+ }
+
+ private static Test warning(final String message)
+ {
+ return new TestCase("warning")
+ {
+ protected void runTest()
+ {
+ System.out.println(message);
+ }
+ };
+ }
}
Modified: commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/test/AbstractProviderTestConfig.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/test/AbstractProviderTestConfig.java?rev=732328&r1=732327&r2=732328&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/test/AbstractProviderTestConfig.java (original)
+++ commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/test/AbstractProviderTestConfig.java Wed Jan 7 05:28:48 2009
@@ -26,7 +26,7 @@
* @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a>
* @version $Revision$ $Date$
*/
-public abstract class AbstractProviderTestConfig
+public abstract class AbstractProviderTestConfig extends AbstractProviderTestCase
implements ProviderTestConfig
{
private FilesCache cache = null;
Modified: commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/test/AbstractTestSuite.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/test/AbstractTestSuite.java?rev=732328&r1=732327&r2=732328&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/test/AbstractTestSuite.java (original)
+++ commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/test/AbstractTestSuite.java Wed Jan 7 05:28:48 2009
@@ -57,24 +57,35 @@
private Thread[] startThreadSnapshot;
private Thread[] endThreadSnapshot;
+ private boolean addEmptyDir;
/**
* Adds the tests for a file system to this suite.
*/
public AbstractTestSuite(final ProviderTestConfig providerConfig) throws Exception
{
- this(providerConfig, "", false);
+ this(providerConfig, "", false, false);
}
protected AbstractTestSuite(final ProviderTestConfig providerConfig,
final String prefix,
- final boolean nested)
+ final boolean nested) throws Exception
+ {
+ this(providerConfig, prefix, nested, false);
+ }
+
+
+ protected AbstractTestSuite(final ProviderTestConfig providerConfig,
+ final String prefix,
+ final boolean nested,
+ final boolean addEmptyDir)
throws Exception
{
super(new TestSuite());
testSuite = (TestSuite) fTest;
this.providerConfig = providerConfig;
this.prefix = prefix;
+ this.addEmptyDir = addEmptyDir;
addBaseTests();
if (!nested)
{
@@ -123,6 +134,7 @@
final AbstractProviderTestCase testCase = (AbstractProviderTestCase) testClass.newInstance();
testCase.setMethod(method);
testCase.setName(prefix + method.getName());
+ testCase.addEmptyDir(this.addEmptyDir);
testSuite.addTest(testCase);
}
}
Modified: commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/test/ProviderReadTests.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/test/ProviderReadTests.java?rev=732328&r1=732327&r2=732328&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/test/ProviderReadTests.java (original)
+++ commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/test/ProviderReadTests.java Wed Jan 7 05:28:48 2009
@@ -91,6 +91,13 @@
// Make sure all children were found
assertNotNull(children);
+ if (info.children.size() != children.length)
+ {
+ for (int i=0; i < children.length; ++i)
+ {
+ System.out.println(children[i].getName());
+ }
+ }
assertEquals("count children of \"" + file.getName() + "\"", info.children.size(), children.length);
// Recursively check each child
Modified: commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/test/ProviderTestSuite.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/test/ProviderTestSuite.java?rev=732328&r1=732327&r2=732328&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/test/ProviderTestSuite.java (original)
+++ commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/test/ProviderTestSuite.java Wed Jan 7 05:28:48 2009
@@ -33,15 +33,27 @@
*/
public ProviderTestSuite(final ProviderTestConfig providerConfig) throws Exception
{
- this(providerConfig, "", false);
+ this(providerConfig, "", false, false);
}
+ /**
+ * Adds the tests for a file system to this suite. Provider has an empty directory.
+ */
+ public ProviderTestSuite(final ProviderTestConfig providerConfig,
+ final boolean addEmptyDir) throws Exception
+ {
+ this(providerConfig, "", false, addEmptyDir);
+ }
+
+
+
protected ProviderTestSuite(final ProviderTestConfig providerConfig,
final String prefix,
- final boolean nested)
+ final boolean nested,
+ final boolean addEmptyDir)
throws Exception
{
- super(providerConfig, prefix, nested);
+ super(providerConfig, prefix, nested, addEmptyDir);
}
/**
Added: commons/proper/vfs/trunk/core/src/test/test-data/write-tests/dummy.txt
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/test/test-data/write-tests/dummy.txt?rev=732328&view=auto
==============================================================================
--- commons/proper/vfs/trunk/core/src/test/test-data/write-tests/dummy.txt (added)
+++ commons/proper/vfs/trunk/core/src/test/test-data/write-tests/dummy.txt Wed Jan 7 05:28:48 2009
@@ -0,0 +1 @@
+dummy file to cause directory to be created.
\ No newline at end of file
Modified: commons/proper/vfs/trunk/examples/pom.xml
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/examples/pom.xml?rev=732328&r1=732327&r2=732328&view=diff
==============================================================================
--- commons/proper/vfs/trunk/examples/pom.xml (original)
+++ commons/proper/vfs/trunk/examples/pom.xml Wed Jan 7 05:28:48 2009
@@ -32,6 +32,7 @@
<groupId>org.apache.commons</groupId>
<artifactId>commons-vfs-project</artifactId>
<version>2.0-SNAPSHOT</version>
+ <relativePath>../</relativePath>
</parent>
<dependencies>
Modified: commons/proper/vfs/trunk/pom.xml
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/pom.xml?rev=732328&r1=732327&r2=732328&view=diff
==============================================================================
--- commons/proper/vfs/trunk/pom.xml (original)
+++ commons/proper/vfs/trunk/pom.xml Wed Jan 7 05:28:48 2009
@@ -24,6 +24,7 @@
<groupId>org.apache.commons</groupId>
<artifactId>commons-parent</artifactId>
<version>11</version>
+ <relativePath>.</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -85,6 +86,12 @@
<email>jcarman -at- apache.org</email>
<organization>Apache Software Foundation</organization>
</developer>
+ <developer>
+ <name>Ralph Goers</name>
+ <id>rgoers</id>
+ <email>rgoers -at- apache.org</email>
+ <organization>Intuit</organization>
+ </developer>
</developers>
<contributors>
@@ -108,10 +115,28 @@
<commons.binary.suffix></commons.binary.suffix>
<commons.jira.id>VFS</commons.jira.id>
<commons.jira.pid>12310495</commons.jira.pid>
- </properties>
+ </properties>
<build>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-site-plugin</artifactId>
+ <version>2.0-beta-5</version>
+ </plugin>
+ </plugins>
+ </pluginManagement>
<plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-site-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ <version>2.2</version>
+ </plugin>
<plugin>
<groupId>org.apache.commons</groupId>
<artifactId>commons-build-plugin</artifactId>
@@ -136,6 +161,53 @@
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-project-info-reports-plugin</artifactId>
+ <version>2.1</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-site-plugin</artifactId>
+ <configuration>
+ <stagingDirectory>${user.home}/vfssite/tmp</stagingDirectory>
+ <stagingSiteURL>${user.home}/vfssite/staging</stagingSiteURL>
+ <!-- Exclude the navigation file for Maven 1 sites
+ and the changes file used by the changes-plugin,
+ as they interfere with the site generation. -->
+ <moduleExcludes>
+ <xdoc>navigation.xml,changes.xml</xdoc>
+ </moduleExcludes>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-changes-plugin</artifactId>
+ <version>2.0</version>
+ <configuration>
+ <xmlPath>${basedir}/xdocs/changes.xml</xmlPath>
+ <issueLinkTemplate>%URL%/%ISSUE%</issueLinkTemplate>
+ </configuration>
+ <reportSets>
+ <reportSet>
+ <reports>
+ <report>changes-report</report>
+ </reports>
+ </reportSet>
+ </reportSets>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ <version>2.2</version>
+ <configuration>
+ <propertiesLocation>${project.parent.relativePath}/checkstyle.properties</propertiesLocation>
+ <!-- <configLocation>${basedir}/conf/checkstyle.xml</configLocation> -->
+ <!-- <suppressionsLocation>${basedir}/conf/checkstyle-suppressions.xml</suppressionsLocation> -->
+ <enableRulesSummary>false</enableRulesSummary>
+ <propertyExpansion>basedir=${basedir}</propertyExpansion>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jxr-plugin</artifactId>
<version>2.1</version>
<configuration>
Modified: commons/proper/vfs/trunk/sandbox/pom.xml
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/sandbox/pom.xml?rev=732328&r1=732327&r2=732328&view=diff
==============================================================================
--- commons/proper/vfs/trunk/sandbox/pom.xml (original)
+++ commons/proper/vfs/trunk/sandbox/pom.xml Wed Jan 7 05:28:48 2009
@@ -32,7 +32,8 @@
<groupId>org.apache.commons</groupId>
<artifactId>commons-vfs-project</artifactId>
<version>2.0-SNAPSHOT</version>
- </parent>
+ <relativePath>../</relativePath>
+ </parent>
<dependencies>
<dependency>
Modified: commons/proper/vfs/trunk/src/site/site.xml
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/src/site/site.xml?rev=732328&r1=732327&r2=732328&view=diff
==============================================================================
--- commons/proper/vfs/trunk/src/site/site.xml (original)
+++ commons/proper/vfs/trunk/src/site/site.xml Wed Jan 7 05:28:48 2009
@@ -37,13 +37,18 @@
</menu>
<menu name="Development">
- <item name="Test Server" href="/testserver.html"/>
+ <item name="Testing" href="/testing.html"/>
<item name="Mailing Lists" href="/mail-lists.html"/>
<item name="Issue Tracking" href="/issue-tracking.html"/>
<item name="Source Repository" href="/source-repository.html"/>
<item name="To Do List" href="/todo.html"/>
</menu>
-
+
+ <menu name="Components">
+ <item name="Core" href="commons-vfs/index.html"/>
+ <item name="Examples" href="commons-vfs-examples/index.html"/>
+ <item name="Sandbox" href="commons-vfs-sandbox/index.html"/>
+ </menu>
</body>
</project>
Modified: commons/proper/vfs/trunk/xdocs/api.xml
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/xdocs/api.xml?rev=732328&r1=732327&r2=732328&view=diff
==============================================================================
--- commons/proper/vfs/trunk/xdocs/api.xml (original)
+++ commons/proper/vfs/trunk/xdocs/api.xml Wed Jan 7 05:28:48 2009
@@ -107,10 +107,12 @@
<subsection name="User Authentication">
<p>
- You cann put the credentials into th url, but the drawback here is, that it is easily possible to get access to the password.
+ You can put the credentials into the url, but the drawback here is, that it is
+ easily possible to get access to the password.
</p>
<p>
- To solve you can use the <a href="apidocs/org/apache/commons/vfs/UserAuthenticator.html">UserAuthenticator</a>
+ To solve you can use the
+ <a href="apidocs/org/apache/commons/vfs/UserAuthenticator.html">UserAuthenticator</a>
</p>
<p>
For example:
@@ -123,15 +125,17 @@
</code>
</p>
<p>
- Internally the UserAuthenticator uses char arrays which will be zeroed before its freed for garbage collection.
- Unhappily none of the current libraries use char arrays and so VFS has to create a string. Thus, the main advantage
+ Internally the UserAuthenticator uses char arrays which will be zeroed before it is
+ freed for garbage collection.Unhappily none of the current libraries use char
+ arrays and so VFS has to create a string. Thus, the main advantage
of this solution - security - is lost, but hey, thats not VFS fault ;-)
</p>
<p>
- VFS calls <code>UserAuthenticator.requestAuthentication</code> each time it requires credentials, it depends on the
- filesystem implementation how often this might be. For example, with FTP this is on every connection, in SMB/JCIFS
- this is for EVERY OBJECT. It is up to you how long you will cache credentials of if you would like to provide a
- "save credentials" checkbox.
+ VFS calls <code>UserAuthenticator.requestAuthentication</code> each time it
+ requires credentials, it depends on the filesystem implementation how often
+ this might be. For example, with FTP this is on every connection, in SMB/JCIFS
+ this is for EVERY OBJECT. It is up to you how long you will cache credentials
+ of if you would like to provide a "save credentials" checkbox.
</p>
</subsection>
Modified: commons/proper/vfs/trunk/xdocs/filesystems.xml
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/xdocs/filesystems.xml?rev=732328&r1=732327&r2=732328&view=diff
==============================================================================
--- commons/proper/vfs/trunk/xdocs/filesystems.xml (original)
+++ commons/proper/vfs/trunk/xdocs/filesystems.xml Wed Jan 7 05:28:48 2009
@@ -56,17 +56,16 @@
<li>
<a href="#mime">mime</a>
</li>
- </ul>
+ <li>
+ <a href="#WebDAV">WebDAV</a><br />
+ </li>
+ </ul>
</section>
<section name="Things from the sandbox">
<p>The following file systems are in development:</p>
<ul>
<li>
- <a href="#WebDAV">WebDAV</a><br />
- We can't release WebDAV as we depend on an snapshot, thus it is in our sandbox.
- </li>
- <li>
<a href="#CIFS">CIFS</a>
</li>
<li>
Modified: commons/proper/vfs/trunk/xdocs/index.xml
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/xdocs/index.xml?rev=732328&r1=732327&r2=732328&view=diff
==============================================================================
--- commons/proper/vfs/trunk/xdocs/index.xml (original)
+++ commons/proper/vfs/trunk/xdocs/index.xml Wed Jan 7 05:28:48 2009
@@ -69,7 +69,7 @@
VFS is splitted into core, examples and sandbox now.
</p>
<p>
- Due to some technical reasons we had to move the webdav and jcifs (smb) filesystem to
+ Due to some technical reasons we had to move the jcifs (smb) filesystem to
the sandbox. So if you need one of these filesystems you have to build VFS manually.
</p>
<p>
Modified: commons/proper/vfs/trunk/xdocs/navigation.xml
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/xdocs/navigation.xml?rev=732328&r1=732327&r2=732328&view=diff
==============================================================================
--- commons/proper/vfs/trunk/xdocs/navigation.xml (original)
+++ commons/proper/vfs/trunk/xdocs/navigation.xml Wed Jan 7 05:28:48 2009
@@ -37,7 +37,7 @@
</menu>
<menu name="Development">
- <item name="Test Server" href="/testserver.html"/>
+ <item name="Testing" href="/testing.html"/>
<item name="Mailing Lists" href="/mail-lists.html"/>
<item name="Issue Tracking" href="/issue-tracking.html"/>
<item name="Source Repository" href="/cvs-usage.html"/>
Copied: commons/proper/vfs/trunk/xdocs/testing.xml (from r729829, commons/proper/vfs/trunk/xdocs/testserver.xml)
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/xdocs/testing.xml?p2=commons/proper/vfs/trunk/xdocs/testing.xml&p1=commons/proper/vfs/trunk/xdocs/testserver.xml&r1=729829&r2=732328&rev=732328&view=diff
==============================================================================
--- commons/proper/vfs/trunk/xdocs/testserver.xml (original)
+++ commons/proper/vfs/trunk/xdocs/testing.xml Wed Jan 7 05:28:48 2009
@@ -16,114 +16,94 @@
-->
<document>
<properties>
- <title>Setup a Testserver</title>
- <author email="imario@apache.org">Mario Ivankovits</author>
+ <title>Running the Tests</title>
+ <author email="rgoers@apache.org">Ralph Goers</author>
</properties>
<body>
- <section name="Testserver">
+ <section name="Running the tests">
<p>
- This documentation describes how to setup a VFS testserver needed during development for the junit
- tests.
+ This page details how to setup the tests for the various providers and then
+ run them with Maven 2.
</p>
<p>
- I tried to simplify things as good as I can, e.g. this setup uses for all server the same vfs work
- directory.
- Thus it is needed to setup apache to use user 'vfsusr' instead of 'wwwrun'.
- <br/>
- Based on this description it should be possible for you to avoid this "insecurity" if needed.
+ The tests were run on Mac OS/X 10.5. The tests requiring a remote repository
+ were pointed to a second machine running Kubuntu 7.10 and the various servers
+ that can be installed from the system administration tool. The only exception
+ to this is that the WebDAV and Http support was testing using Day CRX 1.4 as
+ the server.
</p>
- <p>
- I created it during setup a fresh server based on the following components:
- <ol>
- <li>SuSE Linux 9.3 Minimal Installation</li>
- <li>Apache 2 Webserver (apache2-2.0.53)</li>
- <li>Samba 3 (samba-3.0.12)</li>
- <li>ssh (openssh-3.9p1)</li>
- <li>vsftp (vsftpd-2.0.2-3)</li>
- </ol>
- </p>
+ <subsection name="Getting Started">
+ <p>
+ First, from the root directory of the project, run <code>mvn install</code>.
+ This will compile all the source and test source and then run all the tests
+ for providers that use the local file system.
+ </p>
+ </subsection>
+ <subsection name="Setting up the remote server">
+ <p>
+ Each remote service needs to have the test data placed within it's "repository".
+ After running the maven build, the test data can be found in
+ core/target/test-data. Each service may require a userid and password to be
+ created. For example, to run the ftp test on a Linux system a user should be
+ created and the test data placed within that user's home directory. See the
+ following sections for details on each service.
+ </p>
+ <p>
+ Each repository should contain the following list of files for the tests to
+ complete successfully.
+ </p>
+ <source><![CDATA[
+write-tests
+read-tests
+read-tests/file1.txt
+read-tests/dir1
+read-tests/dir1/file1.txt
+read-tests/dir1/file2.txt
+read-tests/dir1/file3.txt
+read-tests/dir1/subdir1
+read-tests/dir1/subdir1/file1.txt
+read-tests/dir1/subdir1/file2.txt
+read-tests/dir1/subdir1/file3.txt
+read-tests/dir1/subdir2
+read-tests/dir1/subdir2/file1.txt
+read-tests/dir1/subdir2/file2.txt
+read-tests/dir1/subdir2/file3.txt
+read-tests/dir1/subdir3
+read-tests/dir1/subdir3/file1.txt
+read-tests/dir1/subdir3/file2.txt
+read-tests/dir1/subdir3/file3.txt
+read-tests/empty.txt
+read-tests/file%.txt
+code
+code/sealed
+code/sealed/AnotherClass.class
+code/ClassToLoad.class]]></source>
+ </subsection>
- <subsection name="System setup">
+ <subsection name="Apache 2 Webserver">
+ <p>
+ Create a user on the system
+ </p>
<ol>
- <li>You need maven to build the local test-data structure. This is done automatically during build of VFS.</li>
<li>Create a user 'vfsusr' with password 'vfs/%\te:st' and home directory '/home/vfsusr'
<br/>
<source><![CDATA[
-useradd -p vfsusr -m vfsusr
- ]]></source>
+useradd -p vfsusr -m vfsusr]]></source>
</li>
- <li>Create the directories
+ <li>In vfsuser's home directory create the directories
<ol>
- <li>/vfstest</li>
- <li>/vfstest/write-tests</li>
+ <li>vfstest</li>
+ <li>vfstest/write-tests</li>
</ol>
- and copy from your local 'target/test-data' the directories
- <source>code,read-tests</source> into it.<br />
- Now your structure looks like this:<br />
- <source><![CDATA[
-/vfstest
-/vfstest/write-tests
-/vfstest/read-tests
-/vfstest/read-tests/emptydir
-/vfstest/read-tests/file1.txt
-/vfstest/read-tests/dir1
-/vfstest/read-tests/dir1/file1.txt
-/vfstest/read-tests/dir1/file2.txt
-/vfstest/read-tests/dir1/file3.txt
-/vfstest/read-tests/dir1/subdir1
-/vfstest/read-tests/dir1/subdir1/file1.txt
-/vfstest/read-tests/dir1/subdir1/file2.txt
-/vfstest/read-tests/dir1/subdir1/file3.txt
-/vfstest/read-tests/dir1/subdir2
-/vfstest/read-tests/dir1/subdir2/file1.txt
-/vfstest/read-tests/dir1/subdir2/file2.txt
-/vfstest/read-tests/dir1/subdir2/file3.txt
-/vfstest/read-tests/dir1/subdir3
-/vfstest/read-tests/dir1/subdir3/file1.txt
-/vfstest/read-tests/dir1/subdir3/file2.txt
-/vfstest/read-tests/dir1/subdir3/file3.txt
-/vfstest/read-tests/empty.txt
-/vfstest/read-tests/file%.txt
-/vfstest/code
-/vfstest/code/sealed
-/vfstest/code/sealed/AnotherClass.class
-/vfstest/code/ClassToLoad.class
- ]]></source>
</li>
- <li>Setup a symbolic link to '/vfstest'<br />
+ <li>Copy the test data into the vfstest directory</li>
+ <li>Create a symbolic link at '/vfstest' to /home/vfsuser/vfstest<br />
<source><![CDATA[
-ln -s /vfstest /home/vfsusr/vfstest
- ]]></source>
+ln -s /vfstest /home/vfsusr/vfstest]]></source>
</li>
- <li>Set permissions
- <br/>
- <source><![CDATA[
-find /vfstest -print0 | xargs -0 chown vfsusr.users
- ]]></source>
- </li>
- <li>After you followed the steps below and setup the server ensure they
- are activated and running.<br />
- This is only needed if you installed a fresh system. Otherwise simply restart them.
- <br/>
- <source><![CDATA[
-insserv xinetd
-insserv apache2
-insserv smb
-insserv nmb
-/etc/rc.d/xinetd restart
-/etc/rc.d/apache2 restart
-/etc/rc.d/smb restart
-/etc/rc.d/nmb restart
- ]]></source>
- </li>
- </ol>
- </subsection>
-
- <subsection name="Apache 2 Webserver">
- <ol>
<li>Create a file named '/etc/apache2/conf.d/vfstest.conf' with this content<br />
<source><![CDATA[
#
@@ -152,8 +132,7 @@
<Limit PUT POST DELETE PROPFIND PROPPATCH MKCOL COPY MOVE LOCK UNLOCK>
Require user vfsusr
</Limit>
-</Location>
- ]]></source>
+</Location>]]></source>
</li>
<li>change the permission on
<source><![CDATA[
@@ -163,19 +142,70 @@
<li>Activate the WebDAV module by adding 'dav' and 'dav_fs' to the list of modules in '/etc/sysconfig/apache2'. e.g <br/>
<source><![CDATA[
APACHE_MODULES="access actions alias auth auth_dbm autoindex cgi dir env expires include log_config
-mime negotiation setenvif ssl suexec userdir php4 php5 dav dav_fs"
- ]]></source>
+mime negotiation setenvif ssl suexec userdir php4 php5 dav dav_fs"]]></source>
</li>
<li>Setup the webserver to use user-id 'vfsusr' and group 'users'. This can be done by changing the file '/etc/apache2/uid.conf'<br />
<source><![CDATA[
User vfsusr
-Group users
- ]]></source>
+Group users]]></source>
</li>
<li>Create the VFS user to access the Webdav resource<br />
<source><![CDATA[
-htpasswd2 -cmb /etc/apache2/passwd vfsusr 'vfs/%\te:st'
- ]]></source>
+htpasswd2 -cmb /etc/apache2/passwd vfsusr 'vfstest']]></source>
+ </li>
+ <li>Add the following to profiles section of settings.xml in the Maven home
+ directory. Modify the urls to match your setup.
+ <source><![CDATA[
+ <profile>
+ <id>http</id>
+ <activation>
+ <activeByDefault>false</activeByDefault>
+ </activation>
+ <properties>
+ <test.http.uri>http://vfsusr:vfstest@192.168.10.133:80/vfstest/test-data</test.http.uri>
+ </properties>
+ </profile>
+ <profile>
+ <id>webdav</id>
+ <activation>
+ <activeByDefault>false</activeByDefault>
+ </activation>
+ <properties>
+ <test.webdav.uri>webdav://vfsusr:vfstest@192.168.10.133:80/vfstest/test-data</test.webdav.uri>
+ </properties>
+ </profile>]]></source>
+ </li>
+ </ol>
+ </subsection>
+
+ <subsection name="Day CRX or Apache Jackrabbit">
+ <ol>
+ <li>Use Windows Explorer, Mac Finder or a similar tool to connect to the
+ repository.</li>
+ <li>Create a vfstest directory</li>
+ <li>Drag the test-data from Explorer/Finder window to the repository window to
+ copy the files to the vfstest directory in the repository</li>
+ <li>Add the following to profiles section of settings.xml in the Maven home
+ directory. Modify the urls to match your setup.
+ <source><![CDATA[
+ <profile>
+ <id>http</id>
+ <activation>
+ <activeByDefault>false</activeByDefault>
+ </activation>
+ <properties>
+ <test.http.uri>http://admin:admin@192.168.10.133:7402/vfstest/test-data</test.http.uri>
+ </properties>
+ </profile>
+ <profile>
+ <id>webdav</id>
+ <activation>
+ <activeByDefault>false</activeByDefault>
+ </activation>
+ <properties>
+ <test.webdav.uri>webdav://admin:admin@192.168.10.133:7402/vfstest/test-data</test.webdav.uri>
+ </properties>
+ </profile>]]></source>
</li>
</ol>
</subsection>
@@ -188,13 +218,11 @@
comment = VFS Test Directory
path = /home/vfsusr
guest ok = yes
- writable = yes
- ]]></source>
+ writable = yes]]></source>
</li>
- <li>Setup a 'vfsusr' with password 'vfs/%\te:st'<br />
+ <li>Setup a 'vfsusr' with password 'vfstest'<br />
<source><![CDATA[
-smbpasswd -a vfsusr
- ]]></source>
+smbpasswd -a vfsusr]]></source>
</li>
</ol>
</subsection>
@@ -203,45 +231,58 @@
<ol>
<li>In '/etc/ssh/sshd_config' ensure<br />
<source><![CDATA[
-PasswordAuthentication yes
- ]]></source>
+PasswordAuthentication yes]]></source>
</li>
</ol>
</subsection>
<subsection name="vsftp">
<ol>
+ <li>Create a user 'vfsusr' with password 'vfstest' and home directory '/home/vfsusr'
+ <br/>
+ <source><![CDATA[
+useradd -p vfsusr -m vfsusr]]></source>
+ </li>
+ <li>In vfsuser's home directory create the directories
+ <ol>
+ <li>vfstest</li>
+ <li>vfstest/write-tests</li>
+ </ol>
+ </li>
+ <li>Copy the test data into the vfstest directory</li>
<li>Ensure the server is not disabled in the xinetd configuration<br />
Set <source>disable=no</source> in '/etc/xinetd.d/vsftpd'
</li>
<li>Setup the server config: '/etc/vsftpd.conf'<br/>
- <source>
+ <source><![CDATA[
write_enable=YES
-local_enable=YES
- </source>
+local_enable=YES]]></source>
+
+ <li>Add the following to profiles section of settings.xml in the Maven home
+ directory. Modify the urls to match your setup.
+ <source><![CDATA[
+ <profile>
+ <id>ftp</id>
+ <activation>
+ <activeByDefault>false</activeByDefault>
+ </activation>
+ <properties>
+ <test.ftp.uri>ftp://admin:admin@192.168.10.133/vfstest/test-data</test.ftp.uri>
+ </properties>
+ </profile>]]></source>
+ </li> </li>
- </li>
</ol>
</subsection>
- <subsection name="Tests">
- Now we are finished and you can try to activate the tests by
- <ol>
- <li>reactivate the tests in 'build.xml'.<br/>
- Search for <code><![CDATA[<!-- tests disabled -->]]></code> and comment the exclude.</li>
- <source><![CDATA[
-<!-- tests disabled
-<exclude name="**/*.java">
-</exclude>
- -->
- ]]></source>
- <li>or use the class org.apache.commons.vfs.RunTest where you have
- to adapt some properties at the top of the file and choose which test
- you would like to run by comment the others.<br />
- This is the way how I debug a failed testcase.
- </li>
- </ol>
+ <subsection name="Running tests">
+ <p>
+ Running tests simply requires that the appropriate profile be activated. For
+ example, to run just the webdav test do
+ <code>mvn -P webdav test -Dtest=WebdavProviderTestCase</code>. Multipe tests
+ can be run by doing <code>mvn -P webdav -P http test</code>.
+ </p>
</subsection>
</section>
</body>
Propchange: commons/proper/vfs/trunk/xdocs/testing.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: commons/proper/vfs/trunk/xdocs/testing.xml
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: commons/proper/vfs/trunk/xdocs/testing.xml
------------------------------------------------------------------------------
svn:mergeinfo =
Propchange: commons/proper/vfs/trunk/xdocs/testing.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml