@Test public void testLoadFromRioHome() { String oldRioHome = System.getProperty("rio.home"); try { System.setProperty("rio.home", System.getProperty("user.dir") + "/src/test/resources"); RioProperties.load(); String locators = System.getProperty(Constants.LOCATOR_PROPERTY_NAME); Assert.assertNotNull(locators); } finally { if (oldRioHome == null) System.clearProperty("RIO_HOME"); else System.setProperty("rio.home", oldRioHome); } }
public static void load() { File rioEnv; String rioEnvFileName = System.getProperty(Constants.ENV_PROPERTY_NAME, System.getenv(Constants.ENV_PROPERTY_NAME)); if(rioEnvFileName==null) { File rioRoot = new File(System.getProperty("user.home"), ".rio"); rioEnv = new File(rioRoot, "rio.env"); if(rioEnv.exists()) { loadAndSetProperties(rioEnv); } else { String rioHome = System.getProperty("rio.home", System.getenv("RIO_HOME")); if(rioHome!=null) { rioEnv = new File(rioHome, "config/rio.env"); if(rioEnv.exists()) { loadAndSetProperties(rioEnv); } else { System.err.println(rioEnv.getPath()+" not found, skipping"); } } else { System.err.println("RIO_HOME environment not set"); } } } else { rioEnv = new File(rioEnvFileName); if(rioEnv.exists()) { loadAndSetProperties(rioEnv); } } }
RioProperties { public static void load() { File rioEnv; String rioEnvFileName = System.getProperty(Constants.ENV_PROPERTY_NAME, System.getenv(Constants.ENV_PROPERTY_NAME)); if(rioEnvFileName==null) { File rioRoot = new File(System.getProperty("user.home"), ".rio"); rioEnv = new File(rioRoot, "rio.env"); if(rioEnv.exists()) { loadAndSetProperties(rioEnv); } else { String rioHome = System.getProperty("rio.home", System.getenv("RIO_HOME")); if(rioHome!=null) { rioEnv = new File(rioHome, "config/rio.env"); if(rioEnv.exists()) { loadAndSetProperties(rioEnv); } else { System.err.println(rioEnv.getPath()+" not found, skipping"); } } else { System.err.println("RIO_HOME environment not set"); } } } else { rioEnv = new File(rioEnvFileName); if(rioEnv.exists()) { loadAndSetProperties(rioEnv); } } } }
RioProperties { public static void load() { File rioEnv; String rioEnvFileName = System.getProperty(Constants.ENV_PROPERTY_NAME, System.getenv(Constants.ENV_PROPERTY_NAME)); if(rioEnvFileName==null) { File rioRoot = new File(System.getProperty("user.home"), ".rio"); rioEnv = new File(rioRoot, "rio.env"); if(rioEnv.exists()) { loadAndSetProperties(rioEnv); } else { String rioHome = System.getProperty("rio.home", System.getenv("RIO_HOME")); if(rioHome!=null) { rioEnv = new File(rioHome, "config/rio.env"); if(rioEnv.exists()) { loadAndSetProperties(rioEnv); } else { System.err.println(rioEnv.getPath()+" not found, skipping"); } } else { System.err.println("RIO_HOME environment not set"); } } } else { rioEnv = new File(rioEnvFileName); if(rioEnv.exists()) { loadAndSetProperties(rioEnv); } } } private  RioProperties(); }
RioProperties { public static void load() { File rioEnv; String rioEnvFileName = System.getProperty(Constants.ENV_PROPERTY_NAME, System.getenv(Constants.ENV_PROPERTY_NAME)); if(rioEnvFileName==null) { File rioRoot = new File(System.getProperty("user.home"), ".rio"); rioEnv = new File(rioRoot, "rio.env"); if(rioEnv.exists()) { loadAndSetProperties(rioEnv); } else { String rioHome = System.getProperty("rio.home", System.getenv("RIO_HOME")); if(rioHome!=null) { rioEnv = new File(rioHome, "config/rio.env"); if(rioEnv.exists()) { loadAndSetProperties(rioEnv); } else { System.err.println(rioEnv.getPath()+" not found, skipping"); } } else { System.err.println("RIO_HOME environment not set"); } } } else { rioEnv = new File(rioEnvFileName); if(rioEnv.exists()) { loadAndSetProperties(rioEnv); } } } private  RioProperties(); static void load(); }
RioProperties { public static void load() { File rioEnv; String rioEnvFileName = System.getProperty(Constants.ENV_PROPERTY_NAME, System.getenv(Constants.ENV_PROPERTY_NAME)); if(rioEnvFileName==null) { File rioRoot = new File(System.getProperty("user.home"), ".rio"); rioEnv = new File(rioRoot, "rio.env"); if(rioEnv.exists()) { loadAndSetProperties(rioEnv); } else { String rioHome = System.getProperty("rio.home", System.getenv("RIO_HOME")); if(rioHome!=null) { rioEnv = new File(rioHome, "config/rio.env"); if(rioEnv.exists()) { loadAndSetProperties(rioEnv); } else { System.err.println(rioEnv.getPath()+" not found, skipping"); } } else { System.err.println("RIO_HOME environment not set"); } } } else { rioEnv = new File(rioEnvFileName); if(rioEnv.exists()) { loadAndSetProperties(rioEnv); } } } private  RioProperties(); static void load();  }