PsseRawReader { public PsseRawModel read(BufferedReader reader) throws IOException { Objects.requireNonNull(reader); PsseCaseIdentification caseIdentification = readCaseIdentification(reader); PsseRawModel model = new PsseRawModel(caseIdentification); model.getBuses().addAll(parseRecords(readRecordBlock(reader), PsseBus.class)); model.getLoads().addAll(parseRecords(readRecordBlock(reader), PsseLoad.class)); model.getFixedShunts().addAll(parseRecords(readRecordBlock(reader), PsseFixedShunt.class)); model.getGenerators().addAll(parseRecords(readRecordBlock(reader), PsseGenerator.class)); model.getNonTransformerBranches().addAll(parseRecords(readRecordBlock(reader), PsseNonTransformerBranch.class)); model.getTransformers().addAll(readTransformers(reader)); model.getAreas().addAll(parseRecords(readRecordBlock(reader), PsseArea.class)); readRecordBlock(reader); readRecordBlock(reader); readRecordBlock(reader); readRecordBlock(reader); readRecordBlock(reader); model.getZones().addAll(parseRecords(readRecordBlock(reader), PsseZone.class)); readRecordBlock(reader); model.getOwners().addAll(parseRecords(readRecordBlock(reader), PsseOwner.class)); readRecordBlock(reader); model.getSwitchedShunts().addAll(parseRecords(readRecordBlock(reader), PsseSwitchedShunt.class)); readRecordBlock(reader); readRecordBlock(reader); return model; }  PsseRawModel read(BufferedReader reader); boolean checkCaseIdentification(BufferedReader reader);  }
@Test public void ieee14BusTest() throws IOException { try (BufferedReader reader = new BufferedReader(new InputStreamReader(getClass().getResourceAsStream("/IEEE_14_bus.raw")))) { PsseRawModel rawData = new PsseRawReader().read(reader); assertNotNull(rawData); String jsonRef = new String(ByteStreams.toByteArray(getClass().getResourceAsStream("/IEEE_14_bus.json")), StandardCharsets.UTF_8); String json = new ObjectMapper().writerWithDefaultPrettyPrinter().writeValueAsString(rawData); assertEquals(jsonRef, json); } }