From 4ac959e69c476dbfd072d49b7b1732f4db65a722 Mon Sep 17 00:00:00 2001 From: Ryan Lubke Date: Wed, 28 Feb 2024 22:03:39 -0500 Subject: [PATCH] Bug 36349929 - [36349892->24.03] Error creating named executor view when using POF (merge main -> ce/main @ 107201) [git-p4: depot-paths = "//dev/coherence-ce/main/": change = 107204] --- .../NamedClusteredExecutorService.java | 4 +- ...estIT.java => RemoteExecutorExtendIT.java} | 7 +- ...cutorTestIT.java => RemoteExecutorIT.java} | 10 ++- .../executor/RemoteExecutorPofIT.java | 75 +++++++++++++++++++ 4 files changed, 88 insertions(+), 8 deletions(-) rename prj/test/functional/concurrent/src/main/java/concurrent/executor/{RemoteExecutorExtendTestIT.java => RemoteExecutorExtendIT.java} (90%) rename prj/test/functional/concurrent/src/main/java/concurrent/executor/{RemoteExecutorTestIT.java => RemoteExecutorIT.java} (86%) create mode 100644 prj/test/functional/concurrent/src/main/java/concurrent/executor/RemoteExecutorPofIT.java diff --git a/prj/coherence-concurrent/src/main/java/com/oracle/coherence/concurrent/executor/NamedClusteredExecutorService.java b/prj/coherence-concurrent/src/main/java/com/oracle/coherence/concurrent/executor/NamedClusteredExecutorService.java index d7f2a998fd5c6..915c2d3518d2e 100644 --- a/prj/coherence-concurrent/src/main/java/com/oracle/coherence/concurrent/executor/NamedClusteredExecutorService.java +++ b/prj/coherence-concurrent/src/main/java/com/oracle/coherence/concurrent/executor/NamedClusteredExecutorService.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2022, Oracle and/or its affiliates. + * Copyright (c) 2000, 2024, Oracle and/or its affiliates. * * Licensed under the Universal Permissive License v 1.0 as shown at * https://oss.oracle.com/licenses/upl. @@ -54,7 +54,7 @@ public NamedClusteredExecutorService(Name name) f_name = name; m_viewNamed = Caches.executors(session()) - .view().filter(Filters.equal(Extractors.extract("getOption", Name.class, null), f_name)).build(); + .view().filter(Filters.equal(Extractors.extract("getExecutorName()"), f_name)).build(); } // ----- ClusteredExecutorService methods --------------------------- diff --git a/prj/test/functional/concurrent/src/main/java/concurrent/executor/RemoteExecutorExtendTestIT.java b/prj/test/functional/concurrent/src/main/java/concurrent/executor/RemoteExecutorExtendIT.java similarity index 90% rename from prj/test/functional/concurrent/src/main/java/concurrent/executor/RemoteExecutorExtendTestIT.java rename to prj/test/functional/concurrent/src/main/java/concurrent/executor/RemoteExecutorExtendIT.java index 5fda4409a3952..64e2d36664e3d 100644 --- a/prj/test/functional/concurrent/src/main/java/concurrent/executor/RemoteExecutorExtendTestIT.java +++ b/prj/test/functional/concurrent/src/main/java/concurrent/executor/RemoteExecutorExtendIT.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2022, Oracle and/or its affiliates. + * Copyright (c) 2000, 2024, Oracle and/or its affiliates. * * Licensed under the Universal Permissive License v 1.0 as shown at * https://oss.oracle.com/licenses/upl. @@ -20,7 +20,6 @@ import com.oracle.bedrock.runtime.java.options.ClassName; import com.oracle.bedrock.runtime.java.options.IPv4Preferred; -import com.oracle.bedrock.runtime.java.options.SystemProperty; import com.oracle.bedrock.runtime.options.DisplayName; import com.tangosol.net.Coherence; @@ -33,7 +32,7 @@ * @author rl 7.12.2021 * @since 21.12 */ -public class RemoteExecutorExtendTestIT +public class RemoteExecutorExtendIT extends AbstractRemoteExecutorTest { // ----- AbstractRemoteExecutorTest methods ----------------------------- @@ -51,7 +50,7 @@ protected Coherence getClient() * under target/test-output. This is added as an option to the cluster * and client processes. */ - static TestLogs logs = new TestLogs(RemoteExecutorExtendTestIT.class); + static TestLogs logs = new TestLogs(RemoteExecutorExtendIT.class); /** * A Bedrock JUnit5 extension that starts a Coherence cluster of a single diff --git a/prj/test/functional/concurrent/src/main/java/concurrent/executor/RemoteExecutorTestIT.java b/prj/test/functional/concurrent/src/main/java/concurrent/executor/RemoteExecutorIT.java similarity index 86% rename from prj/test/functional/concurrent/src/main/java/concurrent/executor/RemoteExecutorTestIT.java rename to prj/test/functional/concurrent/src/main/java/concurrent/executor/RemoteExecutorIT.java index 0d8e57b51d2d2..46503633bc24d 100644 --- a/prj/test/functional/concurrent/src/main/java/concurrent/executor/RemoteExecutorTestIT.java +++ b/prj/test/functional/concurrent/src/main/java/concurrent/executor/RemoteExecutorIT.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2022, Oracle and/or its affiliates. + * Copyright (c) 2000, 2024, Oracle and/or its affiliates. * * Licensed under the Universal Permissive License v 1.0 as shown at * https://oss.oracle.com/licenses/upl. @@ -20,6 +20,7 @@ import com.oracle.bedrock.runtime.java.options.ClassName; import com.oracle.bedrock.runtime.java.options.IPv4Preferred; +import com.oracle.bedrock.runtime.java.options.SystemProperty; import com.oracle.bedrock.runtime.options.DisplayName; import com.tangosol.net.Coherence; @@ -32,9 +33,13 @@ * @author rl 7.12.2021 * @since 21.12 */ -public class RemoteExecutorTestIT +public class RemoteExecutorIT extends AbstractRemoteExecutorTest { + static + { + System.setProperty("coherence.concurrent.serializer", "pof"); + } // ----- AbstractRemoteExecutorTest methods ----------------------------- @Override @@ -58,6 +63,7 @@ protected Coherence getClient() LocalHost.only(), Multicast.ttl(0), IPv4Preferred.yes(), + SystemProperty.of("coherence.concurrent.serializer", "pof"), ClusterPort.automatic()) .include(1, DisplayName.of("storage"), diff --git a/prj/test/functional/concurrent/src/main/java/concurrent/executor/RemoteExecutorPofIT.java b/prj/test/functional/concurrent/src/main/java/concurrent/executor/RemoteExecutorPofIT.java new file mode 100644 index 0000000000000..629d6bfe5f141 --- /dev/null +++ b/prj/test/functional/concurrent/src/main/java/concurrent/executor/RemoteExecutorPofIT.java @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2024, Oracle and/or its affiliates. + * + * Licensed under the Universal Permissive License v 1.0 as shown at + * https://oss.oracle.com/licenses/upl. + */ +package concurrent.executor; + +import com.oracle.bedrock.junit.CoherenceClusterExtension; + +import com.oracle.bedrock.runtime.LocalPlatform; + +import com.oracle.bedrock.runtime.coherence.options.ClusterPort; +import com.oracle.bedrock.runtime.coherence.options.LocalHost; +import com.oracle.bedrock.runtime.coherence.options.LocalStorage; +import com.oracle.bedrock.runtime.coherence.options.Logging; +import com.oracle.bedrock.runtime.coherence.options.Multicast; +import com.oracle.bedrock.runtime.coherence.options.Pof; +import com.oracle.bedrock.runtime.coherence.options.RoleName; + +import com.oracle.bedrock.runtime.java.options.ClassName; +import com.oracle.bedrock.runtime.java.options.IPv4Preferred; + +import com.oracle.bedrock.runtime.java.options.SystemProperty; +import com.oracle.bedrock.runtime.options.DisplayName; + +import com.tangosol.net.Coherence; + +import org.junit.jupiter.api.extension.RegisterExtension; + +/** + * Tests to ensure RemoteExecutor can be on another cluster member using POF. + * + * @author rl 2.28.2024 + * @since 15.1.1.0.0 + */ +public class RemoteExecutorPofIT + extends AbstractRemoteExecutorTest + { + static + { + System.setProperty("coherence.concurrent.serializer", "pof"); + } + + // ----- AbstractRemoteExecutorTest methods ----------------------------- + + @Override + protected Coherence getClient() + { + return Coherence.clusterMember(); + } + + // ----- data members --------------------------------------------------- + + /** + * A Bedrock JUnit5 extension that starts a Coherence cluster of a single + * storage-enabled member. + */ + @RegisterExtension + static CoherenceClusterExtension coherenceResource = + new CoherenceClusterExtension() + .using(LocalPlatform.get()) + .with(ClassName.of(Coherence.class), + Logging.at(9), + LocalHost.only(), + Multicast.ttl(0), + IPv4Preferred.yes(), + SystemProperty.of("coherence.concurrent.serializer", "pof"), + ClusterPort.automatic()) + .include(1, + DisplayName.of("storage"), + RoleName.of("storage"), + LocalStorage.enabled(), + Logging.at(9)); + }