@Test public void test() throws IOException { final String basePath = System.getenv("DATA_DIR"); if (isNullOrEmpty(basePath)) { LOGGER.warn("To run this test, you need to set a system variable named DATA_DIR to the dir contains the data files."); return; } final Optional<Path> dataFile = Files .list(Paths.get(basePath)) .filter(path -> PROFILE_TXT.equals(path.getFileName().toString())) .findFirst(); if (!dataFile.isPresent()) { LOGGER.warn("No {} found under {}, skipping ...", PROFILE_TXT, basePath); return; } ReportDetails<AgentProfile> profileReport = AgentProfileParser.getDefault().parse(dataFile.get()); assertNotNull(profileReport); assertTrue(profileReport.getError(), profileReport.isOk()); final AgentProfile profile = profileReport.getData(); assertNotNull(profile); LOGGER.info(JsonUtil.toPrettyJson(profile)); }
public static AgentProfileParser getDefault() { return INSTANCE; }
AgentProfileParser extends PlainTextDataFileParser<AgentProfile> { public static AgentProfileParser getDefault() { return INSTANCE; } }
AgentProfileParser extends PlainTextDataFileParser<AgentProfile> { public static AgentProfileParser getDefault() { return INSTANCE; } private  AgentProfileParser(); }
AgentProfileParser extends PlainTextDataFileParser<AgentProfile> { public static AgentProfileParser getDefault() { return INSTANCE; } private  AgentProfileParser(); static AgentProfileParser getDefault(); }
AgentProfileParser extends PlainTextDataFileParser<AgentProfile> { public static AgentProfileParser getDefault() { return INSTANCE; } private  AgentProfileParser(); static AgentProfileParser getDefault();  }