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

Upgrade to gridsuite dependencies 36 #661

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
</developers>

<properties>
<gridsuite-dependencies.version>35</gridsuite-dependencies.version>
<gridsuite-dependencies.version>36</gridsuite-dependencies.version>
<liquibase-hibernate-package>org.gridsuite.study.server</liquibase-hibernate-package>
<mockwebserver3.version>5.0.0-alpha.14</mockwebserver3.version>
<apache.httpclient.version>5.3</apache.httpclient.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public void afterRemoval(String s) {
}

@Override
public void onUpdate(Identifiable identifiable, String attribute, Object oldValue, Object newValue) {
public void onVariantCreated(String sourceVariantId, String targetVariantId) {
// Nothing to do in this listener
}

Expand All @@ -53,6 +53,11 @@ public void onVariantRemoved(String variantId) {
equipmentInfosService.deleteVariants(networkUuid, List.of(variantId));
}

@Override
public void onVariantOverwritten(String sourceVariantId, String targetVariantId) {
// Nothing to do in this listener
}

@Override
public void onExtensionAfterRemoval(Identifiable<?> identifiable, String s) {
// Implement the method here
Expand All @@ -64,7 +69,7 @@ public void onExtensionCreation(Extension<?> extension) {
}

@Override
public void onUpdate(Identifiable<?> identifiable, String s, String s1, Object o, Object o1) {
public void onUpdate(Identifiable identifiable, String attribute, String variantId, Object oldValue, Object newValue) {
// Implement the method here
}

Expand All @@ -74,7 +79,22 @@ public void onExtensionBeforeRemoval(Extension<?> extension) {
}

@Override
public void onExtensionUpdate(Extension<?> extension, String s, Object o, Object o1) {
public void onExtensionUpdate(Extension<?> extension, String s, String variantId, Object o, Object o1) {
// Implement the method here
}

@Override
public void onPropertyAdded(Identifiable identifiable, String attribute, Object newValue) {
// Nothing to do in this listener
}

@Override
public void onPropertyReplaced(Identifiable identifiable, String attribute, Object oldValue, Object newValue) {
// Nothing to do in this listener
}

@Override
public void onPropertyRemoved(Identifiable identifiable, String attribute, Object oldValue) {
// Nothing to do in this listener
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,14 @@ void testVariantNotifications() {
NetworkVariantsListener listener = new NetworkVariantsListener(NETWORK_UUID, equipmentInfosService);

listener.onVariantRemoved(VARIANT_ID);
listener.onVariantCreated("variant_1", "variant_2");
listener.onVariantOverwritten("variant_2", "variant_3");
listener.onUpdate(null, null, null, null, null);
listener.onExtensionUpdate(null, null, null, null, null);
listener.onPropertyAdded(null, null, null);
listener.onPropertyReplaced(null, null, null, null);
listener.onPropertyRemoved(null, null, null);

List<EquipmentInfos> equipmentInfos = equipmentInfosService.findAllEquipmentInfos(NETWORK_UUID);
assertEquals(2, equipmentInfos.size());
assertEquals(2, equipmentInfos.stream().filter(eq -> eq.getVariantId().equals(VariantManagerConstants.INITIAL_VARIANT_ID)).count());
Expand Down
Loading