@Test public void nullInput() { try { comparisonWriter.write((Boolean) null, null, true); fail(); } catch (Exception ignored) { } try { comparisonWriter.write((LimitViolation) null, null, true); fail(); } catch (Exception ignored) { } try { comparisonWriter.write((List<String>) null, null, true); fail(); } catch (Exception ignored) { } }
public SecurityAnalysisResultComparisonWriter write(Boolean computationOk1, Boolean computationOk2, boolean equivalent) { checkInput(computationOk1, computationOk2); try { formatter = contingency == null ? formatter.writeEmptyCell() : formatter.writeCell(contingency); formatter = computationOk1 == null ? formatter.writeEmptyCells(1) : formatter.writeCell(getStatus(computationOk1)); formatter = computationOk2 == null ? formatter.writeEmptyCells(1) : formatter.writeCell(getStatus(computationOk2)); formatter.writeEmptyCells(11); formatter.writeCell(getComparison(equivalent)); } catch (IOException e) { LOGGER.error("Error writing security analysis results computation status comparison: {}", e.getMessage()); } return this; }
SecurityAnalysisResultComparisonWriter implements AutoCloseable { public SecurityAnalysisResultComparisonWriter write(Boolean computationOk1, Boolean computationOk2, boolean equivalent) { checkInput(computationOk1, computationOk2); try { formatter = contingency == null ? formatter.writeEmptyCell() : formatter.writeCell(contingency); formatter = computationOk1 == null ? formatter.writeEmptyCells(1) : formatter.writeCell(getStatus(computationOk1)); formatter = computationOk2 == null ? formatter.writeEmptyCells(1) : formatter.writeCell(getStatus(computationOk2)); formatter.writeEmptyCells(11); formatter.writeCell(getComparison(equivalent)); } catch (IOException e) { LOGGER.error("Error writing security analysis results computation status comparison: {}", e.getMessage()); } return this; } }
SecurityAnalysisResultComparisonWriter implements AutoCloseable { public SecurityAnalysisResultComparisonWriter write(Boolean computationOk1, Boolean computationOk2, boolean equivalent) { checkInput(computationOk1, computationOk2); try { formatter = contingency == null ? formatter.writeEmptyCell() : formatter.writeCell(contingency); formatter = computationOk1 == null ? formatter.writeEmptyCells(1) : formatter.writeCell(getStatus(computationOk1)); formatter = computationOk2 == null ? formatter.writeEmptyCells(1) : formatter.writeCell(getStatus(computationOk2)); formatter.writeEmptyCells(11); formatter.writeCell(getComparison(equivalent)); } catch (IOException e) { LOGGER.error("Error writing security analysis results computation status comparison: {}", e.getMessage()); } return this; } SecurityAnalysisResultComparisonWriter(Writer writer); }
SecurityAnalysisResultComparisonWriter implements AutoCloseable { public SecurityAnalysisResultComparisonWriter write(Boolean computationOk1, Boolean computationOk2, boolean equivalent) { checkInput(computationOk1, computationOk2); try { formatter = contingency == null ? formatter.writeEmptyCell() : formatter.writeCell(contingency); formatter = computationOk1 == null ? formatter.writeEmptyCells(1) : formatter.writeCell(getStatus(computationOk1)); formatter = computationOk2 == null ? formatter.writeEmptyCells(1) : formatter.writeCell(getStatus(computationOk2)); formatter.writeEmptyCells(11); formatter.writeCell(getComparison(equivalent)); } catch (IOException e) { LOGGER.error("Error writing security analysis results computation status comparison: {}", e.getMessage()); } return this; } SecurityAnalysisResultComparisonWriter(Writer writer); void setContingency(String contingency); SecurityAnalysisResultComparisonWriter write(Boolean computationOk1, Boolean computationOk2, boolean equivalent); SecurityAnalysisResultComparisonWriter write(LimitViolation violation1, LimitViolation violation2, boolean equivalent); SecurityAnalysisResultComparisonWriter write(List<String> actions1, List<String> actions2, boolean equivalent); @Override void close(); }
SecurityAnalysisResultComparisonWriter implements AutoCloseable { public SecurityAnalysisResultComparisonWriter write(Boolean computationOk1, Boolean computationOk2, boolean equivalent) { checkInput(computationOk1, computationOk2); try { formatter = contingency == null ? formatter.writeEmptyCell() : formatter.writeCell(contingency); formatter = computationOk1 == null ? formatter.writeEmptyCells(1) : formatter.writeCell(getStatus(computationOk1)); formatter = computationOk2 == null ? formatter.writeEmptyCells(1) : formatter.writeCell(getStatus(computationOk2)); formatter.writeEmptyCells(11); formatter.writeCell(getComparison(equivalent)); } catch (IOException e) { LOGGER.error("Error writing security analysis results computation status comparison: {}", e.getMessage()); } return this; } SecurityAnalysisResultComparisonWriter(Writer writer); void setContingency(String contingency); SecurityAnalysisResultComparisonWriter write(Boolean computationOk1, Boolean computationOk2, boolean equivalent); SecurityAnalysisResultComparisonWriter write(LimitViolation violation1, LimitViolation violation2, boolean equivalent); SecurityAnalysisResultComparisonWriter write(List<String> actions1, List<String> actions2, boolean equivalent); @Override void close();  }