1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.jboss.hal.testsuite.test.configuration.socketbinding;
17
18 import org.jboss.arquillian.core.api.annotation.Inject;
19 import org.jboss.arquillian.graphene.page.Page;
20 import org.jboss.hal.resources.Ids;
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.SocketBindingPage;
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.commands.socketbindings.AddSocketBinding;
34 import org.wildfly.extras.creaper.core.online.OnlineManagementClient;
35
36 import static org.jboss.hal.dmr.ModelDescriptionConstants.NAME;
37 import static org.jboss.hal.dmr.ModelDescriptionConstants.PORT;
38 import static org.jboss.hal.testsuite.container.WildFlyConfiguration.DEFAULT;
39 import static org.jboss.hal.testsuite.fixtures.SocketBindingFixtures.INBOUND_CREATE;
40 import static org.jboss.hal.testsuite.fixtures.SocketBindingFixtures.INBOUND_DELETE;
41 import static org.jboss.hal.testsuite.fixtures.SocketBindingFixtures.INBOUND_UPDATE;
42 import static org.jboss.hal.testsuite.fixtures.SocketBindingFixtures.STANDARD_SOCKETS;
43 import static org.jboss.hal.testsuite.fixtures.SocketBindingFixtures.inboundAddress;
44
45 @Manatoko
46 @Testcontainers
47 class InboundTest {
48
49 @Container static WildFlyContainer wildFly = WildFlyContainer.standalone(DEFAULT);
50
51 @BeforeAll
52 static void setupModel() throws Exception {
53 OnlineManagementClient client = wildFly.managementClient();
54 client.apply(
55 new AddSocketBinding.Builder(INBOUND_UPDATE).build(),
56 new AddSocketBinding.Builder(INBOUND_DELETE).build());
57 }
58
59 @Inject Console console;
60 @Inject CrudOperations crud;
61 @Page SocketBindingPage page;
62 TableFragment table;
63 FormFragment form;
64
65 @BeforeEach
66 void setUp() {
67 page.navigate(NAME, STANDARD_SOCKETS);
68 console.verticalNavigation().selectPrimary(Ids.SOCKET_BINDING_GROUP_INBOUND + "-" + Ids.ITEM);
69
70 table = page.getInboundTable();
71 form = page.getInboundForm();
72 table.bind(form);
73 }
74
75 @Test
76 void create() throws Exception {
77 crud.create(inboundAddress(STANDARD_SOCKETS, INBOUND_CREATE), table, INBOUND_CREATE);
78 }
79
80 @Test
81 void update() throws Exception {
82 table.select(INBOUND_UPDATE);
83 crud.update(inboundAddress(STANDARD_SOCKETS, INBOUND_UPDATE), form, PORT, 1234);
84 }
85
86 @Test
87 void updateInvalidPort() {
88 table.select(INBOUND_UPDATE);
89 crud.updateWithError(form, PORT, -1);
90 }
91
92 @Test
93 void reset() throws Exception {
94 table.select(INBOUND_UPDATE);
95 crud.reset(inboundAddress(STANDARD_SOCKETS, INBOUND_UPDATE), form);
96 }
97
98 @Test
99 void delete() throws Exception {
100 crud.delete(inboundAddress(STANDARD_SOCKETS, INBOUND_DELETE), table, INBOUND_DELETE);
101 }
102 }