1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.jboss.hal.testsuite.test.configuration.logging.profile;
17
18 import org.jboss.arquillian.core.api.annotation.Inject;
19 import org.jboss.arquillian.graphene.page.Page;
20 import org.jboss.hal.testsuite.Console;
21 import org.jboss.hal.testsuite.Random;
22 import org.jboss.hal.testsuite.command.AddRemoteSocketBinding;
23 import org.jboss.hal.testsuite.container.WildFlyContainer;
24 import org.jboss.hal.testsuite.fixtures.LoggingFixtures;
25 import org.jboss.hal.testsuite.model.AvailablePortFinder;
26 import org.jboss.hal.testsuite.page.configuration.LoggingConfigurationPage;
27 import org.jboss.hal.testsuite.page.configuration.LoggingProfileConfigurationPage;
28 import org.jboss.hal.testsuite.test.Manatoko;
29 import org.jboss.hal.testsuite.test.configuration.logging.AbstractRootLoggerTest;
30 import org.junit.jupiter.api.BeforeAll;
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.Address;
35 import org.wildfly.extras.creaper.core.online.operations.Operations;
36
37 import static org.jboss.hal.dmr.ModelDescriptionConstants.OUTBOUND_SOCKET_BINDING_REF;
38 import static org.jboss.hal.testsuite.container.WildFlyConfiguration.DEFAULT;
39 import static org.jboss.hal.testsuite.fixtures.LoggingFixtures.NAME;
40
41 @Manatoko
42 @Testcontainers
43 class RootLoggerTest extends AbstractRootLoggerTest {
44
45 @Container static WildFlyContainer wildFly = WildFlyContainer.standalone(DEFAULT);
46 static final String LOGGING_PROFILE = "logger-profile-" + Random.name();
47
48 @BeforeAll
49 static void setupModel() throws Exception {
50 OnlineManagementClient client = wildFly.managementClient();
51 Operations ops = new Operations(client);
52
53 AddRemoteSocketBinding addRemoteSocketBinding = new AddRemoteSocketBinding(OUTBOUND_SOCKET_BINDING_REF,
54 Random.name(), AvailablePortFinder.getNextAvailableTCPPort());
55 client.apply(addRemoteSocketBinding);
56 ops.add(LoggingFixtures.LoggingProfile.loggingProfileAddress(LOGGING_PROFILE)).assertSuccess();
57 ops.add(LoggingFixtures.LoggingProfile.rootLoggerAddress(LOGGING_PROFILE)).assertSuccess();
58 }
59
60 @Inject Console console;
61 @Page LoggingProfileConfigurationPage page;
62
63 @Override
64 protected Address rootLoggerAddress() {
65 return LoggingFixtures.LoggingProfile.rootLoggerAddress(LOGGING_PROFILE);
66 }
67
68 @Override
69 protected void navigateToPage() {
70 page.navigate(NAME, LOGGING_PROFILE);
71 console.verticalNavigation().selectPrimary("logging-profile-root-logger-item");
72 }
73
74 @Override
75 protected LoggingConfigurationPage getPage() {
76 return page;
77 }
78 }