@Test
 public void testSourceRoot() throws IOException {
   RuntimeEnvironment instance = RuntimeEnvironment.getInstance();
   assertNull(instance.getSourceRootFile());
   assertNull(instance.getSourceRootPath());
   File f = File.createTempFile("sourceroot", null);
   String path = f.getCanonicalPath();
   assertTrue(f.delete());
   instance.setSourceRoot(path);
   assertEquals(path, instance.getSourceRootPath());
   assertEquals(path, instance.getSourceRootFile().getCanonicalPath());
 }
  @Test
  public void testProjects() throws IOException {
    RuntimeEnvironment instance = RuntimeEnvironment.getInstance();
    assertFalse(instance.hasProjects());
    assertNotNull(instance.getProjects());
    assertEquals(0, instance.getProjects().size());
    assertNull(instance.getDefaultProject());

    File file = new File("/opengrok_automatic_test/foo/bar");
    instance.setSourceRoot("/opengrok_automatic_test/foo");
    Project p = new Project();
    p.setPath("/bar");
    assertEquals("/bar", p.getId());
    instance.getProjects().add(p);
    assertEquals(p, Project.getProject(file));
    instance.setProjects(null);
    assertNull(instance.getProjects());
  }