File tree Expand file tree Collapse file tree 1 file changed +18
-9
lines changed
test/org/opensolaris/opengrok/history Expand file tree Collapse file tree 1 file changed +18
-9
lines changed Original file line number Diff line number Diff line change 25
25
package org .opensolaris .opengrok .history ;
26
26
27
27
import java .io .File ;
28
+ import java .io .IOException ;
29
+ import java .nio .file .Files ;
28
30
import org .junit .After ;
29
31
import org .junit .AfterClass ;
30
32
import org .junit .Before ;
@@ -60,16 +62,23 @@ public void tearDown() {
60
62
/**
61
63
* Test of isRepositoryFor method, of class SCCSRepository.
62
64
*/
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 ();
69
71
SCCSRepository instance = new SCCSRepository ();
70
72
assertTrue (instance .isRepositoryFor (tdir ));
71
- test .delete ();
72
- tdir .delete ();
73
73
}
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
+ }
75
84
}
You can’t perform that action at this time.
0 commit comments