1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.jboss.hal.testsuite.test.configuration.ee;
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.Random;
23 import org.jboss.hal.testsuite.container.WildFlyContainer;
24 import org.jboss.hal.testsuite.fragment.FormFragment;
25 import org.jboss.hal.testsuite.page.configuration.EEPage;
26 import org.jboss.hal.testsuite.test.Manatoko;
27 import org.junit.jupiter.api.BeforeAll;
28 import org.junit.jupiter.api.BeforeEach;
29 import org.junit.jupiter.api.Test;
30 import org.testcontainers.junit.jupiter.Container;
31 import org.testcontainers.junit.jupiter.Testcontainers;
32 import org.wildfly.extras.creaper.core.online.OnlineManagementClient;
33 import org.wildfly.extras.creaper.core.online.operations.Operations;
34 import org.wildfly.extras.creaper.core.online.operations.Values;
35
36 import static org.jboss.hal.dmr.ModelDescriptionConstants.NAME;
37 import static org.jboss.hal.dmr.ModelDescriptionConstants.PATH;
38 import static org.jboss.hal.dmr.ModelDescriptionConstants.RELATIVE_TO;
39 import static org.jboss.hal.testsuite.container.WildFlyConfiguration.DEFAULT;
40 import static org.jboss.hal.testsuite.fixtures.EEFixtures.GLOBAL_DIRECTORY_READ;
41 import static org.jboss.hal.testsuite.fixtures.EEFixtures.globalDirectoryAddress;
42 import static org.jboss.hal.testsuite.fixtures.PathsFixtures.JBOSS_SERVER_DATA_DIR;
43 import static org.junit.jupiter.api.Assertions.assertEquals;
44
45 @Manatoko
46 @Testcontainers
47 class GlobalDirectoryReadTest {
48
49 @Container static WildFlyContainer wildFly = WildFlyContainer.standalone(DEFAULT);
50
51 @BeforeAll
52 static void setupModel() throws Exception {
53 OnlineManagementClient client = wildFly.managementClient();
54 Operations operations = new Operations(client);
55 operations.add(globalDirectoryAddress(GLOBAL_DIRECTORY_READ), Values.of(NAME, GLOBAL_DIRECTORY_READ)
56 .and(PATH, Random.name())
57 .and(RELATIVE_TO, JBOSS_SERVER_DATA_DIR));
58 }
59
60 @Inject Console console;
61 @Page EEPage page;
62 FormFragment form;
63
64 @BeforeEach
65 void prepare() {
66 page.navigate();
67 console.verticalNavigation().selectPrimary(Ids.EE_GLOBAL_MODULES_ITEM);
68 form = page.getGlobalDirectoryForm();
69 }
70
71 @Test
72 void read() {
73 assertEquals(GLOBAL_DIRECTORY_READ, form.value(NAME));
74 }
75 }