@Test public void testEnvironment() throws Exception { String ip = "1.2.3.4"; int port = 8080; File propFile = setProperties(Config.REMOTECAR_HOST, ip, Config.WEBCONTROL_PORT, "" + port); Environment env = Config.getEnvironment(); String piIp = env.getString(Config.REMOTECAR_HOST); assertEquals(ip, piIp); assertFalse(env.isPi()); assertEquals(port, env.getInteger(Config.WEBCONTROL_PORT)); propFile.delete(); }
private Environment() { runningOnRaspberryPi = isPi(); }
Environment { private Environment() { runningOnRaspberryPi = isPi(); } }
Environment { private Environment() { runningOnRaspberryPi = isPi(); } private  Environment();  Environment(String propFilePath); }
Environment { private Environment() { runningOnRaspberryPi = isPi(); } private  Environment();  Environment(String propFilePath); static String readFirstLine(File file); static String osRelease(); boolean isPi(); static Environment getInstance(); boolean runningOnRaspberryPi(); Properties getProperties(); JsonObject asJsonObject(); static void from(JsonObject configJo); List<String> getMyIpAddresses(); String getString(String key); int getInteger(String key); double getDouble(String key); static void reset(); static void from(String propFilePath); static void mock(); }
Environment { private Environment() { runningOnRaspberryPi = isPi(); } private  Environment();  Environment(String propFilePath); static String readFirstLine(File file); static String osRelease(); boolean isPi(); static Environment getInstance(); boolean runningOnRaspberryPi(); Properties getProperties(); JsonObject asJsonObject(); static void from(JsonObject configJo); List<String> getMyIpAddresses(); String getString(String key); int getInteger(String key); double getDouble(String key); static void reset(); static void from(String propFilePath); static void mock(); static String dukesHome; public String propFilePath; }