1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38 package com.gargoylesoftware.base.testing;
39
40 import junit.framework.TestCase;
41
42 /***
43 * Tests for RecursiveTestSuite
44 *
45 * @version $Revision: 1.5 $
46 * @author <a href="mailto:mbowler@GargoyleSoftware.com">Mike Bowler</a>
47 */
48 public class RecursiveTestSuiteTest extends TestCase {
49
50 private final AcceptAllTestFilter acceptAllTestFilter_ = new AcceptAllTestFilter();
51
52
53 /***
54 * Create an instance of the test
55 *
56 * @param name The name of the test
57 */
58 public RecursiveTestSuiteTest( final String name ) {
59 super( name );
60 }
61
62
63 /***
64 * Test constructor with a null starting path
65 *
66 * @exception Exception If an error occurs
67 */
68 public void testConstructor_NullStartingPath()
69 throws Exception {
70 try {
71 new RecursiveTestSuite( (String)null, acceptAllTestFilter_ );
72 fail( "Expected exception" );
73 }
74 catch( final NullPointerException e ) {
75
76 }
77 }
78
79
80 /***
81 * Test constructor where starting path isn't a directory
82 *
83 * @exception Exception If an error occurs
84 */
85 public void testConstructor_StartingPathNotADirectory()
86 throws Exception {
87 try {
88 new RecursiveTestSuite( "build.xml", acceptAllTestFilter_ );
89 fail( "Expected exception" );
90 }
91 catch( final IllegalArgumentException e ) {
92
93 }
94 }
95
96
97 /***
98 * Test constructor where starting path doesn't exist
99 *
100 * @exception Exception If an error occurs
101 */
102 public void testConstructor_StartingPathDoesntExist()
103 throws Exception {
104 try {
105 new RecursiveTestSuite( "foobar", acceptAllTestFilter_ );
106 fail( "Expected exception" );
107 }
108 catch( final IllegalArgumentException e ) {
109
110 }
111 }
112
113
114 /***
115 * Test constructor with a null filter
116 *
117 * @exception Exception If an error occurs
118 */
119 public void testConstructor_NullFilter()
120 throws Exception {
121 try {
122 new RecursiveTestSuite( ".", null );
123 fail( "Expected exception" );
124 }
125 catch( final NullPointerException e ) {
126
127 }
128 }
129 }
130