Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

apply lockout for non fictional switch #500

Merged
merged 17 commits into from
Jul 31, 2024

Conversation

souissimai
Copy link
Contributor

No description provided.

@souissimai souissimai requested a review from antoinebhs July 23, 2024 09:44
Copy link
Contributor

@antoinebhs antoinebhs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure we want to do the change in this service. Don't we want to change it in network-store in the default method?
What's the purpose of the change? To change the disconnect behavior or only for a very specific case?
It seems very strange (wrong?) to have the two types of disconnect mixed together inside the same modification

Also, I thought we just needed to ignore fictional switch, the default was IS_CLOSED_BREAKER so I would have chosen IS_NONFICTIONAL_CLOSED_BREAKER, why IS_NONFICTIONAL_BREAKER?
=> discussed with PO, we only want to change the lockout behavior

I also don't really understand the changes in the tests.

We can also fix the sonar issue

cc @SlimaneAmar

@antoinebhs antoinebhs requested a review from SlimaneAmar July 23, 2024 11:11
}

private boolean disconnectOneTerminal(Terminal terminal) {
return !terminal.isConnected() || terminal.disconnect();
}

private boolean disconnectNonFictionalOneTerminal(Terminal terminal) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove NonFictional in the name and pass the predicate in argument

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

.add();
assertNotNull(line);

line.getTerminal("v1f").disconnect(SwitchPredicates.IS_NONFICTIONAL);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't understand !
Need to create a fictional switch and test disconnect
And another tests each with a type of switch ?

Signed-off-by: maissa SOUISSI <[email protected]>
Signed-off-by: maissa SOUISSI <[email protected]>
@souissimai souissimai requested a review from antoinebhs July 29, 2024 12:09
@Test
public void testLockoutLinesWithLoadBreakerSwitches() throws Exception {
//Lockout line with switches of kind LOAD_BREAK_SWITCH
getNetwork().getSwitch("br11").setProperty("Kind", SwitchKind.LOAD_BREAK_SWITCH.toString());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A property does not modify the type !

@@ -73,20 +99,46 @@ protected void assertAfterNetworkModificationCreation() {
TestUtils.assertOperatingStatus(getNetwork(), TARGET_LINE_ID, TARGET_BRANCH_STATUS);
}

private void assertAfterNetworkModificationLockout(String lineID) throws Exception {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename by testLockoutLine

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@SlimaneAmar
Copy link
Contributor

Remove the Sonar issue

Signed-off-by: maissa SOUISSI <[email protected]>
@souissimai souissimai requested a review from antoinebhs July 31, 2024 12:23
Copy link

@souissimai souissimai merged commit 107ace1 into main Jul 31, 2024
3 checks passed
@souissimai souissimai deleted the lockout-for-non-fictional-switch branch July 31, 2024 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants