File: JDependTestCase.java

package info (click to toggle)
libjdepend-java 2.9-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 800 kB
  • ctags: 782
  • sloc: java: 3,873; xml: 549; makefile: 7; sh: 6
file content (64 lines) | stat: -rw-r--r-- 1,494 bytes parent folder | download | duplicates (7)
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
package jdepend.framework;

import java.io.*;

import junit.framework.*;

/**
 * @author <b>Mike Clark</b>
 * @author Clarkware Consulting, Inc.
 */

public class JDependTestCase extends TestCase {

    private String homeDir;
    private String testDir;
    private String testDataDir;
    private String buildDir;
    private String packageSubDir;
    private String originalUserHome;

    
    public JDependTestCase(String name) {
        super(name);
    }

    protected void setUp() {

        homeDir = System.getProperty("jdepend.home");
        if (homeDir == null) {
            fail("Property 'jdepend.home' not defined");
        }
        homeDir = homeDir + File.separator;
        testDir = homeDir + File.separator + "test" + File.separator;
        testDataDir = testDir + "data" + File.separator;
        buildDir = homeDir + "build" + File.separator;
        packageSubDir = "jdepend" + File.separator + 
                        "framework" + File.separator;
        originalUserHome = System.getProperty("user.home");
    }

    protected void tearDown() {
        System.setProperty("user.home", originalUserHome);
    }

    public String getHomeDir() {
        return homeDir;
    }

    public String getTestDataDir() {
        return testDataDir;
    }
    
    public String getTestDir() {
        return testDir;
    }

    public String getBuildDir() {
        return buildDir;
    }
    
    public String getPackageSubDir() {
        return packageSubDir;
    }
}