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