* Test output directory relative to the sub project.
*/
private static final String TEST_OUTPUT_DIR = "resources/testoutput";
+
+ /**
+ * Test input directory relative to the sub project.
+ */
+ private static final String TEST_INPUT_DIR = "resources/test";
/*
* Disabled.
URL location = source.getLocation();
String protocol = location.getProtocol();
if (!protocol.equals("file")) {
+ LOG.warn("protocol is not 'file': " + location);
return new File(aRelativePath);
}
path = URLDecoder.decode(location.getPath(), "UTF-8");
} catch (UnsupportedEncodingException e) {
// ignore it.. just don't decode
+ LOG.warn("Decoding path failed: '" + location.getPath() + "'", e );
}
return new File(new File(path).getParentFile(), aRelativePath);
String packagePath = packageName.replaceAll("\\.", "/");
return new File(file, packagePath);
}
+
+ /**
+ * Gets the test input directory for a specific test class.
+ *
+ * @param aTestClass
+ * Test class.
+ * @return Test input directory.
+ */
+ public static File getTestInputDir(Class aTestClass) {
+ File file = getPath(TEST_INPUT_DIR, aTestClass);
+ String packageName = aTestClass.getPackage().getName();
+ String packagePath = packageName.replaceAll("\\.", "/");
+ return new File(file, packagePath);
+ }
/**
* Creates a directory hierarchy for the output directory of a test class if