1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.jboss.hal.testsuite.test.configuration.jgroups;
17
18 import org.jboss.arquillian.core.api.annotation.Inject;
19 import org.jboss.arquillian.graphene.page.Page;
20 import org.jboss.hal.resources.Names;
21 import org.jboss.hal.testsuite.Console;
22 import org.jboss.hal.testsuite.CrudOperations;
23 import org.jboss.hal.testsuite.container.WildFlyContainer;
24 import org.jboss.hal.testsuite.fragment.FormFragment;
25 import org.jboss.hal.testsuite.fragment.TableFragment;
26 import org.jboss.hal.testsuite.page.configuration.JGroupsPage;
27 import org.jboss.hal.testsuite.test.Manatoko;
28 import org.junit.jupiter.api.BeforeAll;
29 import org.junit.jupiter.api.BeforeEach;
30 import org.junit.jupiter.api.Test;
31 import org.testcontainers.junit.jupiter.Container;
32 import org.testcontainers.junit.jupiter.Testcontainers;
33 import org.wildfly.extras.creaper.core.online.OnlineManagementClient;
34 import org.wildfly.extras.creaper.core.online.operations.Operations;
35 import org.wildfly.extras.creaper.core.online.operations.Values;
36
37 import static org.jboss.arquillian.graphene.Graphene.waitGui;
38 import static org.jboss.hal.dmr.ModelDescriptionConstants.STACK;
39 import static org.jboss.hal.testsuite.container.WildFlyConfiguration.HA;
40 import static org.jboss.hal.testsuite.fixtures.JGroupsFixtures.CHANNEL_CREATE;
41 import static org.jboss.hal.testsuite.fixtures.JGroupsFixtures.FORK_CREATE;
42 import static org.jboss.hal.testsuite.fixtures.JGroupsFixtures.FORK_PROTOCOL_DELETE;
43 import static org.jboss.hal.testsuite.fixtures.JGroupsFixtures.TCP;
44 import static org.jboss.hal.testsuite.fixtures.JGroupsFixtures.channelAddress;
45 import static org.jboss.hal.testsuite.fixtures.JGroupsFixtures.forkAddress;
46 import static org.jboss.hal.testsuite.fixtures.JGroupsFixtures.forkProtocolAddress;
47
48 @Manatoko
49 @Testcontainers
50 class ChannelForkProtocolRemoveTest {
51
52 @Container static WildFlyContainer wildFly = WildFlyContainer.standalone(HA);
53
54 @BeforeAll
55 static void setupModel() throws Exception {
56 OnlineManagementClient client = wildFly.managementClient();
57 Operations operations = new Operations(client);
58 operations.add(channelAddress(CHANNEL_CREATE), Values.of(STACK, TCP));
59 operations.add(forkAddress(CHANNEL_CREATE, FORK_CREATE));
60 operations.add(forkProtocolAddress(CHANNEL_CREATE, FORK_CREATE, FORK_PROTOCOL_DELETE));
61 }
62
63 @Inject Console console;
64 @Inject CrudOperations crud;
65 @Page JGroupsPage page;
66 TableFragment channelTable;
67 TableFragment forkTable;
68 TableFragment forkProtocolTable;
69 FormFragment forkProtocolForm;
70
71 @BeforeEach
72 void setUp() {
73 page.navigate();
74 console.verticalNavigation().selectPrimary("jgroups-channel-item");
75
76 channelTable = page.getChannelTable();
77 forkTable = page.getChannelForkTable();
78 forkProtocolTable = page.getForkProtocolTable();
79 forkProtocolForm = page.getForkProtocolForm();
80 }
81
82 @Test
83 void remove() throws Exception {
84 channelTable.action(CHANNEL_CREATE, Names.FORK);
85 waitGui().until().element(forkTable.getRoot()).is().visible();
86
87 forkTable.select(FORK_CREATE);
88 forkTable.action(FORK_CREATE, Names.PROTOCOL);
89 waitGui().until().element(forkProtocolTable.getRoot()).is().visible();
90
91 crud.delete(forkProtocolAddress(CHANNEL_CREATE, FORK_CREATE, FORK_PROTOCOL_DELETE), forkProtocolTable,
92 FORK_PROTOCOL_DELETE);
93 }
94 }