Runfiles { static Runfiles createDirectoryBasedForTesting(String runfilesDir) throws IOException { return new DirectoryBased(runfilesDir); } private  Runfiles(); static Runfiles create(); static Runfiles create(Map<String, String> env); final String rlocation(String path); abstract Map<String, String> getEnvVars();  }
@Test public void testDirectoryBasedCtorArgumentValidation() throws Exception { try { Runfiles.createDirectoryBasedForTesting(null); fail(); } catch (IllegalArgumentException e) { } try { Runfiles.createDirectoryBasedForTesting(""); fail(); } catch (IllegalArgumentException e) { } try { Runfiles.createDirectoryBasedForTesting("non-existent directory is bad"); fail(); } catch (IllegalArgumentException e) { } Runfiles.createDirectoryBasedForTesting(System.getenv("TEST_TMPDIR")); }