Skip to content

Commit

Permalink
Modify gradient user routine test
Browse files Browse the repository at this point in the history
Signed-off-by: jarchambault <[email protected]>
  • Loading branch information
jeanneArchambault committed Dec 13, 2024
1 parent e629bdd commit c900cb8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@
*/
package com.powsybl.openloadflow.knitro.solver;

//import com.powsybl.ieeecdf.converter.IeeeCdfNetworkFactory;
import com.powsybl.iidm.network.Bus;
import com.powsybl.iidm.network.Network;
import com.powsybl.iidm.network.VariantManagerConstants;
//import com.powsybl.iidm.network.extensions.*;
import com.powsybl.iidm.network.test.EurostagTutorialExample1Factory;
import com.powsybl.iidm.network.test.FourSubstationsNodeBreakerFactory;
import com.powsybl.loadflow.LoadFlow;
Expand All @@ -26,7 +24,6 @@
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;

//import java.util.List;
import java.util.Set;

import static com.powsybl.openloadflow.util.LoadFlowAssert.*;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ void testGradientUserRoutine() {
assertEquals(1, parametersKnitro.getGradientUserRoutine());

// wrong values
IllegalArgumentException e = assertThrows(IllegalArgumentException.class, () -> parametersKnitro.setGradientComputationMode(0));
IllegalArgumentException e = assertThrows(IllegalArgumentException.class, () -> parametersKnitro.setGradientUserRoutine(0));
assertEquals("User routine must be between 1 and 2", e.getMessage());
IllegalArgumentException e2 = assertThrows(IllegalArgumentException.class, () -> parametersKnitro.setGradientComputationMode(3));
IllegalArgumentException e2 = assertThrows(IllegalArgumentException.class, () -> parametersKnitro.setGradientUserRoutine(3));
assertEquals("User routine must be between 1 and 2", e2.getMessage());
}

Expand Down

0 comments on commit c900cb8

Please sign in to comment.