From 21bc0ec2b381d85e946bc75a3992f5856bd4c5e9 Mon Sep 17 00:00:00 2001 From: Franck LECUYER Date: Fri, 13 Dec 2024 10:01:05 +0100 Subject: [PATCH 1/3] upgrade to powsybl dependencies 2024.4.0 Signed-off-by: Franck LECUYER --- pom.xml | 2 +- .../study/server/NetworkVariantsListener.java | 26 ++++++++++++++++--- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index bfdf559f6..cd3fe5579 100644 --- a/pom.xml +++ b/pom.xml @@ -42,7 +42,7 @@ - 35 + 36-SNAPSHOT org.gridsuite.study.server 5.0.0-alpha.14 5.3 diff --git a/src/main/java/org/gridsuite/study/server/NetworkVariantsListener.java b/src/main/java/org/gridsuite/study/server/NetworkVariantsListener.java index 713d2ee4a..eea047f51 100644 --- a/src/main/java/org/gridsuite/study/server/NetworkVariantsListener.java +++ b/src/main/java/org/gridsuite/study/server/NetworkVariantsListener.java @@ -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 } @@ -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 @@ -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 } @@ -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 + } } From 6470ead293c0f0b8793335d7d497f468e30cc7a3 Mon Sep 17 00:00:00 2001 From: Franck LECUYER Date: Mon, 23 Dec 2024 15:27:21 +0100 Subject: [PATCH 2/3] upgrade to gridsuite dependencies 36 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index cd3fe5579..d8a99b1d7 100644 --- a/pom.xml +++ b/pom.xml @@ -42,7 +42,7 @@ - 36-SNAPSHOT + 36 org.gridsuite.study.server 5.0.0-alpha.14 5.3 From ab901e69ce6d5c99f9b96108f5b91429559567d9 Mon Sep 17 00:00:00 2001 From: Franck LECUYER Date: Thu, 9 Jan 2025 18:02:04 +0100 Subject: [PATCH 3/3] Improve coverage Signed-off-by: Franck LECUYER --- .../study/server/NetworkVariantsListenerTests.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/test/java/org/gridsuite/study/server/NetworkVariantsListenerTests.java b/src/test/java/org/gridsuite/study/server/NetworkVariantsListenerTests.java index 1c798e341..a87d6b0b4 100644 --- a/src/test/java/org/gridsuite/study/server/NetworkVariantsListenerTests.java +++ b/src/test/java/org/gridsuite/study/server/NetworkVariantsListenerTests.java @@ -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 = equipmentInfosService.findAllEquipmentInfos(NETWORK_UUID); assertEquals(2, equipmentInfos.size()); assertEquals(2, equipmentInfos.stream().filter(eq -> eq.getVariantId().equals(VariantManagerConstants.INITIAL_VARIANT_ID)).count());