Security { public static void printPostContingencyViolations(SecurityAnalysisResult result, Network network, Writer writer, TableFormatterFactory formatterFactory, LimitViolationFilter limitViolationFilter) { printPostContingencyViolations(result, network, writer, formatterFactory, limitViolationFilter, true); } private  Security(); static List<LimitViolation> checkLimits(Network network); static List<LimitViolation> checkLimits(Network network, float limitReduction); static List<LimitViolation> checkLimits(Network network, CurrentLimitType currentLimitType, float limitReduction); static List<LimitViolation> checkLimits(Network network, Set<CurrentLimitType> currentLimitTypes, float limitReduction); static String printLimitsViolations(Network network); static String printLimitsViolations(Network network, boolean writeName); static String printLimitsViolations(Network network, LimitViolationFilter filter); static String printLimitsViolations(List<LimitViolation> violations, Network network); static String printLimitsViolations(List<LimitViolation> violations, Network network, LimitViolationFilter filter); static String printLimitsViolations(List<LimitViolation> violations, Network network, LimitViolationFilter filter, TableFormatterConfig formatterConfig); static String printLimitsViolations(List<LimitViolation> violations, Network network, LimitViolationWriteConfig printConfig); static void printPreContingencyViolations(SecurityAnalysisResult result, Network network, Writer writer, TableFormatterFactory formatterFactory,
                                                     LimitViolationFilter limitViolationFilter); static void printPreContingencyViolations(SecurityAnalysisResult result, Network network, Writer writer, TableFormatterFactory formatterFactory,
                                                     TableFormatterConfig formatterConfig, LimitViolationFilter limitViolationFilter); static void printPreContingencyViolations(SecurityAnalysisResult result, Network network, Writer writer, TableFormatterFactory formatterFactory,
                                                     LimitViolationWriteConfig printConfig); static void printPostContingencyViolations(SecurityAnalysisResult result, Network network, Writer writer, TableFormatterFactory formatterFactory,
            LimitViolationFilter limitViolationFilter); static void printPostContingencyViolations(SecurityAnalysisResult result, Network network, Writer writer, TableFormatterFactory formatterFactory,
                                                      LimitViolationFilter limitViolationFilter, boolean filterPreContingencyViolations); static void printPostContingencyViolations(SecurityAnalysisResult result, Network network, Writer writer, TableFormatterFactory formatterFactory,
                                                      TableFormatterConfig formatterConfig, LimitViolationFilter limitViolationFilter, boolean filterPreContingencyViolations); static void printPostContingencyViolations(SecurityAnalysisResult result, Network network, Writer writer, TableFormatterFactory formatterFactory,
                                                      PostContingencyLimitViolationWriteConfig writeConfig); static void print(SecurityAnalysisResult result, Network network, Writer writer, TableFormatterFactory tableFormatterFactory, TableFormatterConfig tableFormatterConfig); static void print(SecurityAnalysisResult result, Network network, Writer writer, TableFormatterFactory tableFormatterFactory,
                             PostContingencyLimitViolationWriteConfig writeConfig);  }
@Test public void printPostContingencyViolations() throws Exception { StringWriter writer = new StringWriter(); try { Security.printPostContingencyViolations(result, network, writer, formatterFactory, formatterConfig, null, false); } finally { writer.close(); } assertEquals(String.join(System.lineSeparator(), "Post-contingency limit violations", "Contingency,Status,Action,Equipment (2),End,Country,Base voltage,Violation type,Violation name,Value,Limit,abs(value-limit),Loading rate %", "contingency1,converge,,Equipment (2),,,,,,,,,", ",,action2,,,,,,,,,,", ",,,NHV1_NHV2_1,VLHV1,FR,380,CURRENT,Permanent limit,1100.0000,950.0000,150.0000,110.00", ",,,NHV1_NHV2_2,VLHV1,FR,380,CURRENT,Permanent limit,950.0000,855.0000,95.0000,105.56"), writer.toString().trim()); }
@Test public void printPostContingencyViolationsWithPreContingencyViolationsFiltering() throws Exception { StringWriter writer = new StringWriter(); try { Security.printPostContingencyViolations(result, network, writer, formatterFactory, formatterConfig, null, true); } finally { writer.close(); } assertEquals(String.join(System.lineSeparator(), "Post-contingency limit violations", "Contingency,Status,Action,Equipment (1),End,Country,Base voltage,Violation type,Violation name,Value,Limit,abs(value-limit),Loading rate %", "contingency1,converge,,Equipment (1),,,,,,,,,", ",,action2,,,,,,,,,,", ",,,NHV1_NHV2_2,VLHV1,FR,380,CURRENT,Permanent limit,950.0000,855.0000,95.0000,105.56"), writer.toString().trim()); }