Skip to content

Commit

Permalink
Tests should run from Eclipse and Maven
Browse files Browse the repository at this point in the history
  • Loading branch information
jsotuyod committed Oct 17, 2016
1 parent 882c413 commit 2d57061
Showing 1 changed file with 15 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,24 @@ public void testGui2Dependencies() {
protected void setUp() throws Exception {
super.setUp();

engine = new JDepend();

// Get the classes root directory
String rootDirectory = new File(getClass().getResource("/").toURI()).getCanonicalPath();
String classpath = System.getProperty("java.class.path");
if (classpath == null) {
String rootDirectory = new File(getClass().getResource("/").toURI()).getCanonicalPath();
engine.addDirectory(rootDirectory);
} else {
String[] cpParts = classpath.split(File.pathSeparator);
for (String cpStr : cpParts) {
File file = new File(cpStr);
if (file.isDirectory()) {
engine.addDirectory(file.getCanonicalPath());
}
}
}

// Setup the JDepend analysis
engine = new JDepend();
engine.addDirectory(rootDirectory);
engine.analyze();
}

Expand Down

0 comments on commit 2d57061

Please sign in to comment.