You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kie.apache.org by "tkobayas (via GitHub)" <gi...@apache.org> on 2025/02/18 03:47:27 UTC

[PR] [incubator-kie-drools-6239] Review and update EmbeddedStorageManagerTest [incubator-kie-drools]

tkobayas opened a new pull request, #6258:
URL: https://github.com/apache/incubator-kie-drools/pull/6258

   **Issue**: 
   * https://github.com/apache/incubator-kie-drools/issues/6239
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] [incubator-kie-drools-6239] Review and update EmbeddedStorageManagerTest [incubator-kie-drools]

Posted by "tkobayas (via GitHub)" <gi...@apache.org>.
tkobayas commented on code in PR #6258:
URL: https://github.com/apache/incubator-kie-drools/pull/6258#discussion_r1959023034


##########
drools-reliability/drools-reliability-tests/src/test/java/org/drools/reliability/test/EmbeddedStorageManagerTest.java:
##########
@@ -59,31 +69,17 @@ static boolean isEmbeddedInfinispan() {
 
     @Test
     void removeAllSessionCaches_shouldLeaveNonSessionCache() {
-        ((InfinispanStorageManager) StorageManagerFactory.get().getStorageManager()).setEmbeddedCacheManager(new FakeCacheManager());
-
         StorageManagerFactory.get().getStorageManager().removeAllSessionStorages();
 
-        assertThat(StorageManagerFactory.get().getStorageManager().getStorageNames()).contains("METADATA_0");
+        assertThat(StorageManagerFactory.get().getStorageManager().getStorageNames())
+                .containsExactlyInAnyOrder("METADATA_0", "___protobuf_metadata", "___script_cache");
     }
 
     @Test
     void removeCachesBySessionId_shouldRemoveSpecifiedCacheOnly() {
-        ((InfinispanStorageManager) StorageManagerFactory.get().getStorageManager()).setEmbeddedCacheManager(new FakeCacheManager());
-
         StorageManagerFactory.get().getStorageManager().removeStoragesBySessionId("1");
 
-        assertThat(StorageManagerFactory.get().getStorageManager().getStorageNames()).contains(SESSION_STORAGE_PREFIX + "0_" + "epDefault", "METADATA_0");
-    }
-
-    public static class FakeCacheManager extends DefaultCacheManager {

Review Comment:
   While trying to adapt the test code to meet Infinispan 15, I noticed that this `FakeCacheManager` quite depends on `DefaultCacheManager`, and it's not actually possible to write "Fake" class in this case. So changed to just use `DefaultCacheManager` .



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] [incubator-kie-drools-6239] Review and update EmbeddedStorageManagerTest [incubator-kie-drools]

Posted by "tkobayas (via GitHub)" <gi...@apache.org>.
tkobayas merged PR #6258:
URL: https://github.com/apache/incubator-kie-drools/pull/6258


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org