From b7d0d0aba4d6554961b188d69ef89fc4d38d9baa Mon Sep 17 00:00:00 2001 From: Anton Keks Date: Sun, 6 Mar 2011 20:47:31 +0200 Subject: [PATCH] make base dir search smarter (and work under Intellij) --- test/net/azib/ipscan/config/LabelsTest.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/net/azib/ipscan/config/LabelsTest.java b/test/net/azib/ipscan/config/LabelsTest.java index b5afb3a9..573e47a0 100755 --- a/test/net/azib/ipscan/config/LabelsTest.java +++ b/test/net/azib/ipscan/config/LabelsTest.java @@ -83,7 +83,10 @@ public class LabelsTest { public static File findBaseDir() { URL url = LabelsTest.class.getClassLoader().getResource("messages.properties"); - return new File(url.getPath()).getParentFile().getParentFile(); + File parent = new File(url.getPath()); + while (!new File(parent, "build.xml").exists()) + parent = parent.getParentFile(); + return parent; } private void recurseAndTestLabels(File dir) throws IOException {