@Test public void testIgnoresTestSrcdirWhenJavaRunfilesIsUndefinedAndJustFails() throws Exception { Path dir = Files.createTempDirectory( FileSystems.getDefault().getPath(System.getenv("TEST_TMPDIR")), null); Runfiles.create( ImmutableMap.of( "RUNFILES_DIR", dir.toString(), "RUNFILES_MANIFEST_FILE", "ignored when RUNFILES_MANIFEST_ONLY is not set to 1", "TEST_SRCDIR", "should always be ignored")); Runfiles.create( ImmutableMap.of( "JAVA_RUNFILES", dir.toString(), "RUNFILES_MANIFEST_FILE", "ignored when RUNFILES_MANIFEST_ONLY is not set to 1", "TEST_SRCDIR", "should always be ignored")); try { Runfiles.create( ImmutableMap.of( "RUNFILES_DIR", "", "JAVA_RUNFILES", "", "RUNFILES_MANIFEST_FILE", "ignored when RUNFILES_MANIFEST_ONLY is not set to 1", "TEST_SRCDIR", "should always be ignored")); fail(); } catch (IOException e) { assertThat(e).hasMessageThat().contains("$RUNFILES_DIR and $JAVA_RUNFILES"); } }
public static Runfiles create() throws IOException { return create(System.getenv()); }
Runfiles { public static Runfiles create() throws IOException { return create(System.getenv()); } }
Runfiles { public static Runfiles create() throws IOException { return create(System.getenv()); } private  Runfiles(); }
Runfiles { public static Runfiles create() throws IOException { return create(System.getenv()); } private  Runfiles(); static Runfiles create(); static Runfiles create(Map<String, String> env); final String rlocation(String path); abstract Map<String, String> getEnvVars(); }
Runfiles { public static Runfiles create() throws IOException { return create(System.getenv()); } private  Runfiles(); static Runfiles create(); static Runfiles create(Map<String, String> env); final String rlocation(String path); abstract Map<String, String> getEnvVars();  }