diff --git a/fixture/src/main/java/org/jboss/hal/testsuite/fixtures/JGroupsFixtures.java b/fixture/src/main/java/org/jboss/hal/testsuite/fixtures/JGroupsFixtures.java index dc026cb1..a2ece88c 100644 --- a/fixture/src/main/java/org/jboss/hal/testsuite/fixtures/JGroupsFixtures.java +++ b/fixture/src/main/java/org/jboss/hal/testsuite/fixtures/JGroupsFixtures.java @@ -35,6 +35,7 @@ public final class JGroupsFixtures { public static final String TCP = "tcp"; public static final String JGROUPS_TCP = "jgroups-tcp"; public static final String CLUSTER = "cluster"; + public static final String RELAY2 = "relay.RELAY2"; public static final String SITE = "site"; public static final String KEEPALIVE_TIME = "keepalive-time"; public static final String REMOTE_SITE = "remote-site"; @@ -54,7 +55,7 @@ public static Address stackAddress(String name) { // ------------------------------------------------------ stack / relay public static Address relayAddress(String stack) { - return stackAddress(stack).and(RELAY, RELAY.toUpperCase()); + return stackAddress(stack).and(RELAY, RELAY2); } // ------------------------------------------------------ stack / remote site @@ -113,7 +114,7 @@ public static Address forkAddress(String channel, String name) { // protocol names are specific to jgroups domain public static final String FORK_PROTOCOL_CREATE = "COUNTER"; public static final String FORK_PROTOCOL_UPDATE = "CENTRAL_LOCK"; - public static final String FORK_PROTOCOL_DELETE = "S3_PING"; + public static final String FORK_PROTOCOL_DELETE = "TCP"; public static Address forkProtocolAddress(String channel, String fork, String protocol) { return forkAddress(channel, fork).and(PROTOCOL, protocol); diff --git a/test-configuration-jgroups/src/test/java/org/jboss/hal/testsuite/test/configuration/jgroups/ChannelForkProtocolCreateTest.java b/test-configuration-jgroups/src/test/java/org/jboss/hal/testsuite/test/configuration/jgroups/ChannelForkProtocolCreateTest.java new file mode 100644 index 00000000..65ff891a --- /dev/null +++ b/test-configuration-jgroups/src/test/java/org/jboss/hal/testsuite/test/configuration/jgroups/ChannelForkProtocolCreateTest.java @@ -0,0 +1,93 @@ +/* + * Copyright 2022 Red Hat + * + * Licensed 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 + * + * https://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.jboss.hal.testsuite.test.configuration.jgroups; + +import org.jboss.arquillian.core.api.annotation.Inject; +import org.jboss.arquillian.graphene.page.Page; +import org.jboss.hal.resources.Names; +import org.jboss.hal.testsuite.Console; +import org.jboss.hal.testsuite.CrudOperations; +import org.jboss.hal.testsuite.container.WildFlyContainer; +import org.jboss.hal.testsuite.fragment.FormFragment; +import org.jboss.hal.testsuite.fragment.TableFragment; +import org.jboss.hal.testsuite.page.configuration.JGroupsPage; +import org.jboss.hal.testsuite.test.Manatoko; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.testcontainers.junit.jupiter.Container; +import org.testcontainers.junit.jupiter.Testcontainers; +import org.wildfly.extras.creaper.core.online.OnlineManagementClient; +import org.wildfly.extras.creaper.core.online.operations.Operations; +import org.wildfly.extras.creaper.core.online.operations.Values; + +import static org.jboss.arquillian.graphene.Graphene.waitGui; +import static org.jboss.hal.dmr.ModelDescriptionConstants.STACK; +import static org.jboss.hal.testsuite.container.WildFlyConfiguration.HA; +import static org.jboss.hal.testsuite.fixtures.JGroupsFixtures.CHANNEL_CREATE; +import static org.jboss.hal.testsuite.fixtures.JGroupsFixtures.FORK_CREATE; +import static org.jboss.hal.testsuite.fixtures.JGroupsFixtures.FORK_PROTOCOL_CREATE; +import static org.jboss.hal.testsuite.fixtures.JGroupsFixtures.TCP; +import static org.jboss.hal.testsuite.fixtures.JGroupsFixtures.channelAddress; +import static org.jboss.hal.testsuite.fixtures.JGroupsFixtures.forkAddress; +import static org.jboss.hal.testsuite.fixtures.JGroupsFixtures.forkProtocolAddress; + +@Manatoko +@Testcontainers +class ChannelForkProtocolCreateTest { + + @Container static WildFlyContainer wildFly = WildFlyContainer.standalone(HA); + + @BeforeAll + static void setupModel() throws Exception { + OnlineManagementClient client = wildFly.managementClient(); + Operations operations = new Operations(client); + operations.add(channelAddress(CHANNEL_CREATE), Values.of(STACK, TCP)); + operations.add(forkAddress(CHANNEL_CREATE, FORK_CREATE)); + } + + @Inject Console console; + @Inject CrudOperations crud; + @Page JGroupsPage page; + TableFragment channelTable; + TableFragment forkTable; + TableFragment forkProtocolTable; + FormFragment forkProtocolForm; + + @BeforeEach + void setUp() { + page.navigate(); + console.verticalNavigation().selectPrimary("jgroups-channel-item"); + + channelTable = page.getChannelTable(); + forkTable = page.getChannelForkTable(); + forkProtocolTable = page.getForkProtocolTable(); + forkProtocolForm = page.getForkProtocolForm(); + } + + @Test + void create() throws Exception { + channelTable.action(CHANNEL_CREATE, Names.FORK); + waitGui().until().element(forkTable.getRoot()).is().visible(); + + forkTable.select(FORK_CREATE); + forkTable.action(FORK_CREATE, Names.PROTOCOL); + waitGui().until().element(forkProtocolTable.getRoot()).is().visible(); + + crud.create(forkProtocolAddress(CHANNEL_CREATE, FORK_CREATE, FORK_PROTOCOL_CREATE), forkProtocolTable, + FORK_PROTOCOL_CREATE); + } +} diff --git a/test-configuration-jgroups/src/test/java/org/jboss/hal/testsuite/test/configuration/jgroups/ChannelForkProtocolTest.java b/test-configuration-jgroups/src/test/java/org/jboss/hal/testsuite/test/configuration/jgroups/ChannelForkProtocolEditTest.java similarity index 75% rename from test-configuration-jgroups/src/test/java/org/jboss/hal/testsuite/test/configuration/jgroups/ChannelForkProtocolTest.java rename to test-configuration-jgroups/src/test/java/org/jboss/hal/testsuite/test/configuration/jgroups/ChannelForkProtocolEditTest.java index 5ee5543f..c91df05d 100644 --- a/test-configuration-jgroups/src/test/java/org/jboss/hal/testsuite/test/configuration/jgroups/ChannelForkProtocolTest.java +++ b/test-configuration-jgroups/src/test/java/org/jboss/hal/testsuite/test/configuration/jgroups/ChannelForkProtocolEditTest.java @@ -41,8 +41,6 @@ import static org.jboss.hal.testsuite.container.WildFlyConfiguration.HA; import static org.jboss.hal.testsuite.fixtures.JGroupsFixtures.CHANNEL_CREATE; import static org.jboss.hal.testsuite.fixtures.JGroupsFixtures.FORK_CREATE; -import static org.jboss.hal.testsuite.fixtures.JGroupsFixtures.FORK_PROTOCOL_CREATE; -import static org.jboss.hal.testsuite.fixtures.JGroupsFixtures.FORK_PROTOCOL_DELETE; import static org.jboss.hal.testsuite.fixtures.JGroupsFixtures.FORK_PROTOCOL_UPDATE; import static org.jboss.hal.testsuite.fixtures.JGroupsFixtures.TCP; import static org.jboss.hal.testsuite.fixtures.JGroupsFixtures.channelAddress; @@ -51,7 +49,7 @@ @Manatoko @Testcontainers -class ChannelForkProtocolTest { +class ChannelForkProtocolEditTest { @Container static WildFlyContainer wildFly = WildFlyContainer.standalone(HA); @@ -62,7 +60,6 @@ static void setupModel() throws Exception { operations.add(channelAddress(CHANNEL_CREATE), Values.of(STACK, TCP)); operations.add(forkAddress(CHANNEL_CREATE, FORK_CREATE)); operations.add(forkProtocolAddress(CHANNEL_CREATE, FORK_CREATE, FORK_PROTOCOL_UPDATE)); - operations.add(forkProtocolAddress(CHANNEL_CREATE, FORK_CREATE, FORK_PROTOCOL_DELETE)); } @Inject Console console; @@ -84,19 +81,6 @@ void setUp() { forkProtocolForm = page.getForkProtocolForm(); } - @Test - void create() throws Exception { - channelTable.action(CHANNEL_CREATE, Names.FORK); - waitGui().until().element(forkTable.getRoot()).is().visible(); - - forkTable.select(FORK_CREATE); - forkTable.action(FORK_CREATE, Names.PROTOCOL); - waitGui().until().element(forkProtocolTable.getRoot()).is().visible(); - - crud.create(forkProtocolAddress(CHANNEL_CREATE, FORK_CREATE, FORK_PROTOCOL_CREATE), forkProtocolTable, - FORK_PROTOCOL_CREATE); - } - @Test void update() throws Exception { channelTable.action(CHANNEL_CREATE, Names.FORK); @@ -110,17 +94,4 @@ void update() throws Exception { crud.update(forkProtocolAddress(CHANNEL_CREATE, FORK_CREATE, FORK_PROTOCOL_UPDATE), forkProtocolForm, PROPERTIES, Random.properties()); } - - @Test - void remove() throws Exception { - channelTable.action(CHANNEL_CREATE, Names.FORK); - waitGui().until().element(forkTable.getRoot()).is().visible(); - - forkTable.select(FORK_CREATE); - forkTable.action(FORK_CREATE, Names.PROTOCOL); - waitGui().until().element(forkProtocolTable.getRoot()).is().visible(); - - crud.delete(forkProtocolAddress(CHANNEL_CREATE, FORK_CREATE, FORK_PROTOCOL_DELETE), forkProtocolTable, - FORK_PROTOCOL_DELETE); - } } diff --git a/test-configuration-jgroups/src/test/java/org/jboss/hal/testsuite/test/configuration/jgroups/ChannelForkProtocolRemoveTest.java b/test-configuration-jgroups/src/test/java/org/jboss/hal/testsuite/test/configuration/jgroups/ChannelForkProtocolRemoveTest.java new file mode 100644 index 00000000..b89f2127 --- /dev/null +++ b/test-configuration-jgroups/src/test/java/org/jboss/hal/testsuite/test/configuration/jgroups/ChannelForkProtocolRemoveTest.java @@ -0,0 +1,94 @@ +/* + * Copyright 2022 Red Hat + * + * Licensed 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 + * + * https://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.jboss.hal.testsuite.test.configuration.jgroups; + +import org.jboss.arquillian.core.api.annotation.Inject; +import org.jboss.arquillian.graphene.page.Page; +import org.jboss.hal.resources.Names; +import org.jboss.hal.testsuite.Console; +import org.jboss.hal.testsuite.CrudOperations; +import org.jboss.hal.testsuite.container.WildFlyContainer; +import org.jboss.hal.testsuite.fragment.FormFragment; +import org.jboss.hal.testsuite.fragment.TableFragment; +import org.jboss.hal.testsuite.page.configuration.JGroupsPage; +import org.jboss.hal.testsuite.test.Manatoko; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.testcontainers.junit.jupiter.Container; +import org.testcontainers.junit.jupiter.Testcontainers; +import org.wildfly.extras.creaper.core.online.OnlineManagementClient; +import org.wildfly.extras.creaper.core.online.operations.Operations; +import org.wildfly.extras.creaper.core.online.operations.Values; + +import static org.jboss.arquillian.graphene.Graphene.waitGui; +import static org.jboss.hal.dmr.ModelDescriptionConstants.STACK; +import static org.jboss.hal.testsuite.container.WildFlyConfiguration.HA; +import static org.jboss.hal.testsuite.fixtures.JGroupsFixtures.CHANNEL_CREATE; +import static org.jboss.hal.testsuite.fixtures.JGroupsFixtures.FORK_CREATE; +import static org.jboss.hal.testsuite.fixtures.JGroupsFixtures.FORK_PROTOCOL_DELETE; +import static org.jboss.hal.testsuite.fixtures.JGroupsFixtures.TCP; +import static org.jboss.hal.testsuite.fixtures.JGroupsFixtures.channelAddress; +import static org.jboss.hal.testsuite.fixtures.JGroupsFixtures.forkAddress; +import static org.jboss.hal.testsuite.fixtures.JGroupsFixtures.forkProtocolAddress; + +@Manatoko +@Testcontainers +class ChannelForkProtocolRemoveTest { + + @Container static WildFlyContainer wildFly = WildFlyContainer.standalone(HA); + + @BeforeAll + static void setupModel() throws Exception { + OnlineManagementClient client = wildFly.managementClient(); + Operations operations = new Operations(client); + operations.add(channelAddress(CHANNEL_CREATE), Values.of(STACK, TCP)); + operations.add(forkAddress(CHANNEL_CREATE, FORK_CREATE)); + operations.add(forkProtocolAddress(CHANNEL_CREATE, FORK_CREATE, FORK_PROTOCOL_DELETE)); + } + + @Inject Console console; + @Inject CrudOperations crud; + @Page JGroupsPage page; + TableFragment channelTable; + TableFragment forkTable; + TableFragment forkProtocolTable; + FormFragment forkProtocolForm; + + @BeforeEach + void setUp() { + page.navigate(); + console.verticalNavigation().selectPrimary("jgroups-channel-item"); + + channelTable = page.getChannelTable(); + forkTable = page.getChannelForkTable(); + forkProtocolTable = page.getForkProtocolTable(); + forkProtocolForm = page.getForkProtocolForm(); + } + + @Test + void remove() throws Exception { + channelTable.action(CHANNEL_CREATE, Names.FORK); + waitGui().until().element(forkTable.getRoot()).is().visible(); + + forkTable.select(FORK_CREATE); + forkTable.action(FORK_CREATE, Names.PROTOCOL); + waitGui().until().element(forkProtocolTable.getRoot()).is().visible(); + + crud.delete(forkProtocolAddress(CHANNEL_CREATE, FORK_CREATE, FORK_PROTOCOL_DELETE), forkProtocolTable, + FORK_PROTOCOL_DELETE); + } +}