MLIOFactory { public String getTargetPath(String fileName) { String targetDir = MLCoreServiceValueHolder.getInstance().getDatasetStorage().getStorageDirectory(); if ("hdfs".equals(MLCoreServiceValueHolder.getInstance().getDatasetStorage().getStorageType())) { return MLCoreServiceValueHolder.getInstance().getHdfsUrl() + targetDir + "/" + fileName; } return targetDir + File.separator + fileName; } MLIOFactory(Properties properties); MLInputAdapter getInputAdapter(String type); MLOutputAdapter getOutputAdapter(String type); String getTargetPath(String fileName);  }
@Test public void getTargetPath() { Storage storage = new Storage(); storage.setStorageDirectory(File.separator + "tmp"); storage.setStorageType("file"); MLCoreServiceValueHolder.getInstance().setDatasetStorage(storage); String path = ioFactory.getTargetPath("test-ml.csv"); Assert.assertEquals(path, File.separator + "tmp" + File.separator + "test-ml.csv"); }