ARTEMIS-4778: extract base class and classes from parameterized test with subclass that skips to de-parameterize itself

This commit is contained in:
Robbie Gemmell 2024-05-21 16:18:22 +01:00
parent 3c84f26413
commit 7849e2dcbf
4 changed files with 54 additions and 14 deletions

View File

@ -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);
}
}

View File

@ -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);
}
}

View File

@ -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) {

View File

@ -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());