View Javadoc
1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one or more
3    * contributor license agreements.  See the NOTICE file distributed with
4    * this work for additional information regarding copyright ownership.
5    * The ASF licenses this file to You under the Apache License, Version 2.0
6    * (the "License"); you may not use this file except in compliance with
7    * the License.  You may obtain a copy of the License at
8    *
9    *      http://www.apache.org/licenses/LICENSE-2.0
10   *
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS,
13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   * See the License for the specific language governing permissions and
15   * limitations under the License.
16   */
17  package org.apache.commons.vfs2;
18  
19  import org.apache.commons.vfs2.impl.VfsClassLoaderTests;
20  
21  /**
22   * The suite of tests for a file system.
23   * <p>
24   * To be ran in the context of a provider using a wrapper such as
25   * {@link org.apache.commons.vfs2.provider.local.LocalProviderTestCase}
26   * </p>
27   */
28  public class ProviderTestSuite extends AbstractTestSuite {
29  
30      /**
31       * Adds the tests for a file system to this suite.
32       */
33      public ProviderTestSuite(final ProviderTestConfig providerConfig) throws Exception {
34          this(providerConfig, "", false, false);
35      }
36  
37      /**
38       * Adds the tests for a file system to this suite. Provider has an empty directory.
39       */
40      public ProviderTestSuite(final ProviderTestConfig providerConfig, final boolean addEmptyDir) throws Exception {
41          this(providerConfig, "", false, addEmptyDir);
42      }
43  
44      protected ProviderTestSuite(final ProviderTestConfig providerConfig, final String prefix, final boolean nested,
45              final boolean addEmptyDir) throws Exception {
46          super(providerConfig, prefix, nested, addEmptyDir);
47      }
48  
49      /**
50       * Adds base tests - excludes the nested test cases.
51       */
52      @Override
53      protected void addBaseTests() throws Exception {
54          addTests(UrlTests.class);
55          addTests(ProviderCacheStrategyTests.class);
56          addTests(UriTests.class);
57          addTests(NamingTests.class);
58          addTests(ContentTests.class);
59          addTests(ProviderReadTests.class);
60          addTests(ProviderWriteTests.class);
61          addTests(ProviderWriteAppendTests.class);
62          addTests(ProviderRandomReadTests.class);
63          addTests(ProviderRandomReadWriteTests.class);
64          addTests(ProviderRandomSetLengthTests.class);
65          addTests(ProviderRenameTests.class);
66          addTests(ProviderDeleteTests.class);
67          addTests(LastModifiedTests.class);
68          addTests(UrlStructureTests.class);
69          addTests(VfsClassLoaderTests.class);
70      }
71  
72  }