View Javadoc

1   /*
2    * Copyright 2011-2012 smartics, Kronseder & Reiner GmbH
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *     http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package de.smartics.util.lang;
17  
18  import org.junit.experimental.categories.Category;
19  import org.junit.experimental.theories.DataPoint;
20  
21  import de.smartics.testdoc.annotations.Uut;
22  import de.smartics.testdoc.categories.type.ObjectBasics;
23  import de.smartics.util.test.theories.ObjectTheories;
24  
25  @Category(ObjectBasics.class)
26  @Uut(type = ClassPathContext.class)
27  public class ClassPathContextObjectBasics extends ObjectTheories
28  {
29  
30    private static ClassPathContext create(final String path)
31    {
32      final ClassLoader loader =
33          ClassPathContextObjectBasics.class.getClassLoader(); // NOPMD
34      return new ClassPathContext(loader, path);
35    }
36  
37    @DataPoint
38    public static final ClassPathContext ONE = create("/path/to/one");
39  
40    @DataPoint
41    public static final ClassPathContext EQUAL = create("/path/to/one");
42  
43    @DataPoint
44    public static final ClassPathContext TWO = create("/path/to/two");
45  
46    @DataPoint
47    public static final ClassPathContext IDENTICAL = ONE;
48  
49    @DataPoint
50    public static final ClassPathContext NULL_PATH = create(null);
51  
52    @DataPoint
53    public static final ClassPathContext NULL = null;
54  
55    @DataPoint
56    public static final String OTHER = "other";
57  }