static String getHomeDir(String name) {
    String homeDir = HOME_DIR_TL.get();
    if (homeDir == null) {
      String sysProp = name + HOME_DIR;
      homeDir = System.getProperty(sysProp);
      if (homeDir == null) {
        throw new IllegalArgumentException(MessageFormat.format(
            "System property [{0}] not defined", sysProp));
      }
    }
    return homeDir;
  }
@Test
  public void getHomeDir() {
    System.setProperty("TestServerWebApp0.home.dir", "/tmp");
    assertEquals(ServerWebApp.getHomeDir("TestServerWebApp0"), "/tmp");
    assertEquals(ServerWebApp.getDir("TestServerWebApp0", ".log.dir", "/tmp/log"), "/tmp/log");
    System.setProperty("TestServerWebApp0.log.dir", "/tmplog");
    assertEquals(ServerWebApp.getDir("TestServerWebApp0", ".log.dir", "/tmp/log"), "/tmplog");
  }