Here you can find the source of getTestDir(final String name)
public static File getTestDir(final String name) throws IOException, URISyntaxException
//package com.java2s; //License from project: Open Source License import java.io.File; import java.io.IOException; import java.net.URI; import java.net.URISyntaxException; import java.net.URL; public class Main { public static File getTestDir(final String name) throws IOException, URISyntaxException { ClassLoader cloader = Thread.currentThread().getContextClassLoader(); URL resource = cloader.getResource(name); if (resource == null) { throw new IOException("Cannot find test directory: " + name); }/*from w w w. j a v a2 s . c o m*/ return new File(new URI(resource.toExternalForm()).normalize().getPath()); } }