This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-vfs.git


The following commit(s) were added to refs/heads/master by this push:
     new 9d7a7d4c Add some documentation to make the unit tests easier to 
follow (#556)
9d7a7d4c is described below

commit 9d7a7d4c0209bded22a54b7987b20bb8f1da23bf
Author: Arnout Engelen <arn...@bzzt.net>
AuthorDate: Tue Jun 25 20:15:10 2024 +0200

    Add some documentation to make the unit tests easier to follow (#556)
---
 CONTRIBUTING.md                                              | 12 ++++++++++++
 .../org/apache/commons/vfs2/AbstractProviderTestCase.java    |  3 +++
 .../test/java/org/apache/commons/vfs2/ProviderTestSuite.java |  4 ++++
 3 files changed, 19 insertions(+)

diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index a8baa310..e1d65e32 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -82,6 +82,18 @@ The JIRA tickets are used to generate the changelog for the 
next release.
 For changes of a trivial nature to comments and documentation, it is not 
always necessary to create a new ticket in JIRA.
 In this case, it is appropriate to start the first line of a commit with 
'(doc)' instead of a ticket number.
 
+Testing
+-------
+
+Please add unit tests for any fixes or new features.
+
+When running individual tests, tests that extend `AbstractProviderTestCase`
+(such as `NamingTests`) cannot be run in isolation: instead, you can run them
+'in the context of' a provider, for example from `LocalProviderTestCase`.
+These configure a `ProviderTestSuite` with the tests to run.
+
+This could likely be simplified, we are tracking that possible
+improvement in https://issues.apache.org/jira/browse/VFS-855 .
 
 Submitting Changes
 ------------------
diff --git 
a/commons-vfs2/src/test/java/org/apache/commons/vfs2/AbstractProviderTestCase.java
 
b/commons-vfs2/src/test/java/org/apache/commons/vfs2/AbstractProviderTestCase.java
index 9b02bf13..562ee3e6 100644
--- 
a/commons-vfs2/src/test/java/org/apache/commons/vfs2/AbstractProviderTestCase.java
+++ 
b/commons-vfs2/src/test/java/org/apache/commons/vfs2/AbstractProviderTestCase.java
@@ -36,6 +36,9 @@ import 
org.apache.commons.vfs2.provider.local.DefaultLocalFileProvider;
  * <p>
  * Works from a base folder, and assumes a particular structure under that 
base folder.
  * </p>
+ * <p>
+ * Not intended to be executed individually, but instead to be part of a 
{@link ProviderTestSuite}.
+ * </p>
  */
 public abstract class AbstractProviderTestCase extends TestCase {
 
diff --git 
a/commons-vfs2/src/test/java/org/apache/commons/vfs2/ProviderTestSuite.java 
b/commons-vfs2/src/test/java/org/apache/commons/vfs2/ProviderTestSuite.java
index 92e15f8a..2922bbd8 100644
--- a/commons-vfs2/src/test/java/org/apache/commons/vfs2/ProviderTestSuite.java
+++ b/commons-vfs2/src/test/java/org/apache/commons/vfs2/ProviderTestSuite.java
@@ -20,6 +20,10 @@ import org.apache.commons.vfs2.impl.VfsClassLoaderTests;
 
 /**
  * The suite of tests for a file system.
+ * <p>
+ * To be ran in the context of a provider using a wrapper such as
+ * {@link org.apache.commons.vfs2.provider.local.LocalProviderTestCase}
+ * </p>
  */
 public class ProviderTestSuite extends AbstractTestSuite {
 

Reply via email to