@@ -154,13 +154,16 @@ void testGetHistory() throws Exception {
154
154
@ Test
155
155
void testDetermineParentInvalid () throws Exception {
156
156
File codemgrDir = new File (repositoryRoot , SCCSRepository .CODEMGR_WSDATA );
157
- assertTrue (codemgrDir .mkdirs ());
157
+ if (!codemgrDir .isDirectory ()) {
158
+ assertTrue (codemgrDir .mkdirs ());
159
+ }
158
160
File parentFile = new File (codemgrDir , "parent" );
159
161
assertTrue (parentFile .createNewFile ());
160
162
try (PrintWriter out = new PrintWriter (parentFile .toString ())) {
161
163
out .println ("foo" );
162
164
}
163
165
assertNull (sccsRepository .determineParent (CommandTimeoutType .INDEXER ));
166
+ assertTrue (parentFile .delete ());
164
167
}
165
168
166
169
/**
@@ -169,7 +172,9 @@ void testDetermineParentInvalid() throws Exception {
169
172
@ Test
170
173
void testDetermineParent () throws Exception {
171
174
File codemgrDir = new File (repositoryRoot , SCCSRepository .CODEMGR_WSDATA );
172
- assertTrue (codemgrDir .mkdirs ());
175
+ if (!codemgrDir .isDirectory ()) {
176
+ assertTrue (codemgrDir .mkdirs ());
177
+ }
173
178
File parentFile = new File (codemgrDir , "parent" );
174
179
assertTrue (parentFile .createNewFile ());
175
180
final String expectedParent = "/foo" ;
@@ -178,6 +183,7 @@ void testDetermineParent() throws Exception {
178
183
out .println (expectedParent );
179
184
}
180
185
assertEquals (expectedParent , sccsRepository .determineParent (CommandTimeoutType .INDEXER ));
186
+ assertTrue (parentFile .delete ());
181
187
}
182
188
183
189
private static class GetHistoryTestParams {
0 commit comments