Skip to content

Commit

Permalink
Add*Cache commands are not compatible with WildFly 27
Browse files Browse the repository at this point in the history
  • Loading branch information
simkam committed Jan 9, 2023
1 parent 93af199 commit 8250dfc
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ abstract class AbstractAddCache implements OnlineCommand {

@Override
public final void apply(OnlineCommandContext ctx) throws Exception {
if (ctx.version.greaterThanOrEqualTo(ServerVersion.VERSION_20_0_0)) {
throw new AssertionError("This command is not compatible with WildFly 27 and above, "
+ "see https://github.com/wildfly-extras/creaper/issues/218.");
}

Values values = Values.empty()
.andOptional("jndi-name", jndiName)
.andOptional("module", module)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

import org.jboss.arquillian.junit.Arquillian;
import org.junit.After;
import org.junit.Assume;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.wildfly.extras.creaper.core.CommandFailedException;
Expand Down Expand Up @@ -32,6 +34,16 @@ public class AddDistributedCacheOnlineTest {
.and("cache-container", "hibernate")
.and("distributed-cache", TEST_CACHE_NAME);

@BeforeClass
public static void checkServerVersionIsSupported() throws Exception {
// check version is supported
ServerVersion serverVersion
= ManagementClient.online(OnlineOptions.standalone().localDefault().build()).version();
Assume.assumeFalse("The command is not compatible with WildFly 27 and above,"
+ " see https://github.com/wildfly-extras/creaper/issues/218.",
serverVersion.greaterThanOrEqualTo(ServerVersion.VERSION_20_0_0));
}

@Before
public void connect() throws Exception {
client = ManagementClient.online(OnlineOptions.standalone().localDefault().build());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@

import org.jboss.arquillian.junit.Arquillian;
import org.junit.After;
import org.junit.Assume;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.wildfly.extras.creaper.core.CommandFailedException;
import org.wildfly.extras.creaper.core.ManagementClient;
import org.wildfly.extras.creaper.core.ServerVersion;
import org.wildfly.extras.creaper.core.online.ModelNodeResult;
import org.wildfly.extras.creaper.core.online.OnlineManagementClient;
import org.wildfly.extras.creaper.core.online.OnlineOptions;
Expand All @@ -31,6 +34,16 @@ public class AddInvalidationCacheOnlineTest {
.and("cache-container", "hibernate")
.and("invalidation-cache", TEST_CACHE_NAME);

@BeforeClass
public static void checkServerVersionIsSupported() throws Exception {
// check version is supported
ServerVersion serverVersion
= ManagementClient.online(OnlineOptions.standalone().localDefault().build()).version();
Assume.assumeFalse("The command is not compatible with WildFly 27 and above,"
+ " see https://github.com/wildfly-extras/creaper/issues/218.",
serverVersion.greaterThanOrEqualTo(ServerVersion.VERSION_20_0_0));
}

@Before
public void connect() throws Exception {
client = ManagementClient.online(OnlineOptions.standalone().localDefault().build());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@

import org.jboss.arquillian.junit.Arquillian;
import org.junit.After;
import org.junit.Assume;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.wildfly.extras.creaper.core.CommandFailedException;
import org.wildfly.extras.creaper.core.ManagementClient;
import org.wildfly.extras.creaper.core.ServerVersion;
import org.wildfly.extras.creaper.core.online.ModelNodeResult;
import org.wildfly.extras.creaper.core.online.OnlineManagementClient;
import org.wildfly.extras.creaper.core.online.OnlineOptions;
Expand All @@ -31,6 +34,16 @@ public class AddLocalCacheOnlineTest {
.and("cache-container", "hibernate")
.and("local-cache", TEST_CACHE_NAME);

@BeforeClass
public static void checkServerVersionIsSupported() throws Exception {
// check version is supported
ServerVersion serverVersion
= ManagementClient.online(OnlineOptions.standalone().localDefault().build()).version();
Assume.assumeFalse("The command is not compatible with WildFly 27 and above,"
+ " see https://github.com/wildfly-extras/creaper/issues/218.",
serverVersion.greaterThanOrEqualTo(ServerVersion.VERSION_20_0_0));
}

@Before
public void connect() throws Exception {
client = ManagementClient.online(OnlineOptions.standalone().localDefault().build());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@

import org.jboss.arquillian.junit.Arquillian;
import org.junit.After;
import org.junit.Assume;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.wildfly.extras.creaper.core.CommandFailedException;
import org.wildfly.extras.creaper.core.ManagementClient;
import org.wildfly.extras.creaper.core.ServerVersion;
import org.wildfly.extras.creaper.core.online.ModelNodeResult;
import org.wildfly.extras.creaper.core.online.OnlineManagementClient;
import org.wildfly.extras.creaper.core.online.OnlineOptions;
Expand All @@ -31,6 +34,16 @@ public class AddReplicatedCacheOnlineTest {
.and("cache-container", "hibernate")
.and("replicated-cache", TEST_CACHE_NAME);

@BeforeClass
public static void checkServerVersionIsSupported() throws Exception {
// check version is supported
ServerVersion serverVersion
= ManagementClient.online(OnlineOptions.standalone().localDefault().build()).version();
Assume.assumeFalse("The command is not compatible with WildFly 27 and above,"
+ " see https://github.com/wildfly-extras/creaper/issues/218.",
serverVersion.greaterThanOrEqualTo(ServerVersion.VERSION_20_0_0));
}

@Before
public void connect() throws Exception {
client = ManagementClient.online(OnlineOptions.standalone().localDefault().build());
Expand Down

0 comments on commit 8250dfc

Please sign in to comment.