7979 */
8080class OpenSecurityAnalysisTest extends AbstractOpenSecurityAnalysisTest {
8181
82- // TO DO : use powsybl-core LimitViolations.comparator() instead when it'll compare also OperationalLimtisGroupId
83- Comparator <LimitViolation > COMPARATOR = LimitViolations .comparator ()
82+ // TO DO : use powsybl-core LimitViolations.comparator() instead when it'll compare also OperationalLimitsGroupId
83+ Comparator <LimitViolation > limitViolationComparator = LimitViolations .comparator ()
8484 .thenComparing (LimitViolation ::getOperationalLimitsGroupId );
8585
8686 @ Test
@@ -1355,7 +1355,7 @@ void testViolationOnThreeWindingsTransformersLeg() {
13551355 assertEquals (1 , result .getPreContingencyResult ().getLimitViolationsResult ().getLimitViolations ().size ());
13561356 LimitViolation expected = new LimitViolation ("3wt" , null , "DEFAULT" , LimitViolationType .CURRENT , "permanent" ,
13571357 60 , 400. , 1.0F , 435.0831773201809 , TwoSides .TWO .toThreeSides (), null );
1358- int compare = COMPARATOR .compare (expected ,
1358+ int compare = limitViolationComparator .compare (expected ,
13591359 result .getPreContingencyResult ().getLimitViolationsResult ().getLimitViolations ().get (0 ));
13601360 assertEquals (0 , compare );
13611361 }
@@ -2739,21 +2739,21 @@ void testAcceptableDurations(SecurityAnalysisParameters securityAnalysisParamete
27392739
27402740 LimitViolation violation0 = new LimitViolation ("NHV1_NHV2_2" , null , "DEFAULT" , LimitViolationType .CURRENT , "20'" ,
27412741 60 , 1000.0 , 1.0F , 1047.8598237521767 , TwoSides .TWO .toThreeSides (), null );
2742- int compare0 = COMPARATOR .compare (violation0 , result .getPostContingencyResults ().get (0 )
2742+ int compare0 = limitViolationComparator .compare (violation0 , result .getPostContingencyResults ().get (0 )
27432743 .getLimitViolationsResult ().getLimitViolations ().get (0 ));
27442744 assertEquals (0 , compare0 );
27452745
27462746 LimitViolation violation1 = new LimitViolation ("NHV1_NHV2_1" , null , "DEFAULT" , LimitViolationType .CURRENT , "10'" ,
27472747 60 , 1000.0 , 1.0F , 1047.8598237521767 , TwoSides .TWO .toThreeSides (), null );
2748- int compare1 = COMPARATOR .compare (violation1 , result .getPostContingencyResults ().get (1 )
2748+ int compare1 = limitViolationComparator .compare (violation1 , result .getPostContingencyResults ().get (1 )
27492749 .getLimitViolationsResult ().getLimitViolations ().get (0 ));
27502750 assertEquals (0 , compare1 );
27512751
2752- int compare2 = COMPARATOR .compare (violation0 , result .getPostContingencyResults ().get (2 )
2752+ int compare2 = limitViolationComparator .compare (violation0 , result .getPostContingencyResults ().get (2 )
27532753 .getLimitViolationsResult ().getLimitViolations ().get (0 ));
27542754 assertEquals (0 , compare2 ); // FIXME line open at one side
27552755
2756- int compare3 = COMPARATOR .compare (violation1 , result .getPostContingencyResults ().get (3 )
2756+ int compare3 = limitViolationComparator .compare (violation1 , result .getPostContingencyResults ().get (3 )
27572757 .getLimitViolationsResult ().getLimitViolations ().get (0 ));
27582758 assertEquals (0 , compare3 ); // FIXME line open at one side
27592759
@@ -2764,12 +2764,12 @@ void testAcceptableDurations(SecurityAnalysisParameters securityAnalysisParamete
27642764
27652765 LimitViolation violation4 = new LimitViolation ("NHV1_NHV2_2" , null , "DEFAULT" , LimitViolationType .CURRENT , "permanent" ,
27662766 2147483647 , 899.9999999999999 , 1.0F , 911.6056881941461 , TwoSides .ONE .toThreeSides (), null );
2767- int compare4 = COMPARATOR .compare (violation4 , result2 .getPostContingencyResults ().get (0 )
2767+ int compare4 = limitViolationComparator .compare (violation4 , result2 .getPostContingencyResults ().get (0 )
27682768 .getLimitViolationsResult ().getLimitViolations ().get (0 ));
27692769 assertEquals (0 , compare4 );
27702770 LimitViolation violation5 = new LimitViolation ("NHV1_NHV2_2" , null , "DEFAULT" , LimitViolationType .CURRENT , "permanent" ,
27712771 1200 , 899.9999999999999 , 1.0F , 911.6056881941461 , TwoSides .TWO .toThreeSides (), null );
2772- int compare5 = COMPARATOR .compare (violation5 , result2 .getPostContingencyResults ().get (0 )
2772+ int compare5 = limitViolationComparator .compare (violation5 , result2 .getPostContingencyResults ().get (0 )
27732773 .getLimitViolationsResult ().getLimitViolations ().get (1 ));
27742774 assertEquals (0 , compare5 );
27752775
@@ -2779,12 +2779,12 @@ void testAcceptableDurations(SecurityAnalysisParameters securityAnalysisParamete
27792779 SecurityAnalysisResult result3 = runSecurityAnalysis (network , contingencies .getContingencies (network ), Collections .emptyList (), securityAnalysisParameters );
27802780 LimitViolation violation6 = new LimitViolation ("NHV1_NHV2_2" , null , "DEFAULT" , LimitViolationType .CURRENT , "permanent" ,
27812781 2147483647 , 899.9999999999999 , 1.0F , 911.6056881941463 , TwoSides .ONE .toThreeSides (), null );
2782- int compare6 = COMPARATOR .compare (violation6 , result3 .getPostContingencyResults ().get (0 )
2782+ int compare6 = limitViolationComparator .compare (violation6 , result3 .getPostContingencyResults ().get (0 )
27832783 .getLimitViolationsResult ().getLimitViolations ().get (0 ));
27842784 assertEquals (0 , compare6 );
27852785 LimitViolation violation7 = new LimitViolation ("NHV1_NHV2_2" , null , "DEFAULT" , LimitViolationType .CURRENT , "permanent" ,
27862786 1200 , 899.9999999999999 , 1.0F , 911.6056881941463 , TwoSides .TWO .toThreeSides (), null );
2787- int compare7 = COMPARATOR .compare (violation7 , result3 .getPostContingencyResults ().get (0 )
2787+ int compare7 = limitViolationComparator .compare (violation7 , result3 .getPostContingencyResults ().get (0 )
27882788 .getLimitViolationsResult ().getLimitViolations ().get (1 ));
27892789 assertEquals (0 , compare7 );
27902790 }
0 commit comments