Skip to content

Commit 1aebb54

Browse files
author
Vladimir Kotal
committed
cover codemgr_wsdata as well
1 parent 7b87377 commit 1aebb54

File tree

1 file changed

+18
-9
lines changed

1 file changed

+18
-9
lines changed

test/org/opensolaris/opengrok/history/SCCSRepositoryTest.java

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
package org.opensolaris.opengrok.history;
2626

2727
import java.io.File;
28+
import java.io.IOException;
29+
import java.nio.file.Files;
2830
import org.junit.After;
2931
import org.junit.AfterClass;
3032
import org.junit.Before;
@@ -60,16 +62,23 @@ public void tearDown() {
6062
/**
6163
* Test of isRepositoryFor method, of class SCCSRepository.
6264
*/
63-
@Test
64-
public void testIsRepositoryFor() {
65-
//test bug 15954
66-
File tdir = new File(System.getProperty("java.io.tmpdir")+File.separator+"testogrepo");
67-
File test = new File(tdir,"Codemgr_wsdata");
68-
test.mkdirs();//TODO fix FileUtilities to not leave over dummy directories in tmp and then use them here ;)
65+
private void testIsRepositoryFor(final String fileName) throws IOException {
66+
File tdir = Files.createTempDirectory("SCCSrepotest" + fileName).toFile();
67+
File test = new File(tdir, fileName);
68+
test.mkdirs();
69+
tdir.deleteOnExit();
70+
test.deleteOnExit();
6971
SCCSRepository instance = new SCCSRepository();
7072
assertTrue(instance.isRepositoryFor(tdir));
71-
test.delete();
72-
tdir.delete();
7373
}
74-
74+
75+
@Test
76+
public void testIsRepositoryForCodemgr1() throws IOException {
77+
testIsRepositoryFor("Codemgr_wsdata");
78+
}
79+
80+
@Test
81+
public void testIsRepositoryForCodemgr2() throws IOException {
82+
testIsRepositoryFor("codemgr_wsdata");
83+
}
7584
}

0 commit comments

Comments
 (0)