This is an automated email from the ASF dual-hosted git repository.

robbie pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/activemq-artemis.git

commit 7849e2dcbff19da774f3027b619c56516d8ac628
Author: Robbie Gemmell <[email protected]>
AuthorDate: Tue May 21 16:18:22 2024 +0100

    ARTEMIS-4778: extract base class and classes from parameterized test with 
subclass that skips to de-parameterize itself
---
 .../cluster/failover/NettyFailoverInVMTest.java    | 24 ++++++++++++++++++++++
 .../cluster/failover/NettyFailoverJdbcTest.java    | 24 ++++++++++++++++++++++
 ...ailoverTest.java => NettyFailoverTestBase.java} | 18 +++++-----------
 .../failover/NettyReplicatedFailoverTest.java      |  2 +-
 4 files changed, 54 insertions(+), 14 deletions(-)

diff --git 
a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/NettyFailoverInVMTest.java
 
b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/NettyFailoverInVMTest.java
new file mode 100644
index 0000000000..947048c8e3
--- /dev/null
+++ 
b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/NettyFailoverInVMTest.java
@@ -0,0 +1,24 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.activemq.artemis.tests.integration.cluster.failover;
+
+public class NettyFailoverInVMTest extends NettyFailoverTestBase {
+
+   public NettyFailoverInVMTest() {
+      super(NodeManagerType.InVM);
+   }
+}
diff --git 
a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/NettyFailoverJdbcTest.java
 
b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/NettyFailoverJdbcTest.java
new file mode 100644
index 0000000000..2d2469694c
--- /dev/null
+++ 
b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/NettyFailoverJdbcTest.java
@@ -0,0 +1,24 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.activemq.artemis.tests.integration.cluster.failover;
+
+public class NettyFailoverJdbcTest extends NettyFailoverTestBase {
+
+   public NettyFailoverJdbcTest() {
+      super(NodeManagerType.Jdbc);
+   }
+}
diff --git 
a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/NettyFailoverTest.java
 
b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/NettyFailoverTestBase.java
similarity index 93%
rename from 
tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/NettyFailoverTest.java
rename to 
tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/NettyFailoverTestBase.java
index c07949ed7f..3bef6a4c1a 100644
--- 
a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/NettyFailoverTest.java
+++ 
b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/NettyFailoverTestBase.java
@@ -17,7 +17,6 @@
 package org.apache.activemq.artemis.tests.integration.cluster.failover;
 
 import java.util.ArrayList;
-import java.util.Arrays;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -52,25 +51,18 @@ import org.junit.After;
 import org.junit.Assert;
 import org.junit.Assume;
 import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
 
-@RunWith(Parameterized.class)
-public class NettyFailoverTest extends FailoverTest {
+public class NettyFailoverTestBase extends FailoverTest {
 
    public enum NodeManagerType {
       InVM, Jdbc
    }
 
-   @Parameterized.Parameters(name = "{0} Node Manager")
-   public static Iterable<? extends Object> nodeManagerTypes() {
-      return Arrays.asList(new Object[][]{
-         {NodeManagerType.Jdbc},
-         {NodeManagerType.InVM}});
-   }
+   public final NodeManagerType nodeManagerType;
 
-   @Parameterized.Parameter(0)
-   public NodeManagerType nodeManagerType;
+   public NettyFailoverTestBase(NodeManagerType nodeManagerType) {
+      this.nodeManagerType = nodeManagerType;
+   }
 
    @Override
    protected TransportConfiguration getAcceptorTransportConfiguration(final 
boolean primary) {
diff --git 
a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/NettyReplicatedFailoverTest.java
 
b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/NettyReplicatedFailoverTest.java
index 65277e97e1..a2770d0107 100644
--- 
a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/NettyReplicatedFailoverTest.java
+++ 
b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/NettyReplicatedFailoverTest.java
@@ -40,7 +40,7 @@ import org.junit.Test;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-public class NettyReplicatedFailoverTest extends NettyFailoverTest {
+public class NettyReplicatedFailoverTest extends NettyFailoverInVMTest {
 
    private static final Logger logger = 
LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
 

Reply via email to