@Test public void testLoadQuestionFromFile() throws Exception { JSONObject testQuestion = new JSONObject(); testQuestion.put( "instance", new JSONObject() .put("instanceName", "testQuestionName") .put("description", "test question description")); Path questionJsonPath = _folder.newFile("testquestion.json").toPath(); CommonUtil.writeFile(questionJsonPath, testQuestion.toString()); JSONObject question = Client.loadQuestionFromFile(questionJsonPath); assertEquals( "testQuestionName", question.getJSONObject(BfConsts.PROP_INSTANCE).getString(BfConsts.PROP_INSTANCE_NAME)); assertEquals( "test question description", question.getJSONObject(BfConsts.PROP_INSTANCE).getString(BfConsts.PROP_DESCRIPTION)); }
static JSONObject loadQuestionFromFile(Path questionFile) { String questionText = CommonUtil.readFile(questionFile); return loadQuestionFromText(questionText, questionFile.toString()); }
Client extends AbstractClient implements IClient { static JSONObject loadQuestionFromFile(Path questionFile) { String questionText = CommonUtil.readFile(questionFile); return loadQuestionFromText(questionText, questionFile.toString()); } }
Client extends AbstractClient implements IClient { static JSONObject loadQuestionFromFile(Path questionFile) { String questionText = CommonUtil.readFile(questionFile); return loadQuestionFromText(questionText, questionFile.toString()); } Client(Settings settings);  Client(String[] args); }
Client extends AbstractClient implements IClient { static JSONObject loadQuestionFromFile(Path questionFile) { String questionText = CommonUtil.readFile(questionFile); return loadQuestionFromText(questionText, questionFile.toString()); } Client(Settings settings);  Client(String[] args); @Override BatfishLogger getLogger(); Settings getSettings(); void run(List<String> initialCommands); }
Client extends AbstractClient implements IClient { static JSONObject loadQuestionFromFile(Path questionFile) { String questionText = CommonUtil.readFile(questionFile); return loadQuestionFromText(questionText, questionFile.toString()); } Client(Settings settings);  Client(String[] args); @Override BatfishLogger getLogger(); Settings getSettings(); void run(List<String> initialCommands);  }