1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.jboss.hal.testsuite.test.configuration.jca;
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.page.configuration.JcaPage;
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
35 import static org.jboss.hal.dmr.ModelDescriptionConstants.ENABLED;
36 import static org.jboss.hal.testsuite.container.WildFlyConfiguration.DEFAULT;
37 import static org.jboss.hal.testsuite.fixtures.JcaFixtures.TRACER_ADDRESS;
38
39 @Manatoko
40 @Testcontainers
41 class ModifyTracerTest {
42
43 @Container static WildFlyContainer wildFly = WildFlyContainer.standalone(DEFAULT);
44
45 @BeforeAll
46 static void setupModel() throws Exception {
47 OnlineManagementClient client = wildFly.managementClient();
48 Operations operations = new Operations(client);
49 if (!operations.exists(TRACER_ADDRESS)) {
50 operations.add(TRACER_ADDRESS);
51 }
52 }
53
54 @Inject Console console;
55 @Inject CrudOperations crud;
56 @Page JcaPage page;
57 FormFragment form;
58
59 @BeforeEach
60 void setUp() {
61 page.navigate();
62 console.verticalNavigation().selectPrimary(Ids.JCA_TRACER_ITEM);
63 form = page.getTracerForm();
64 }
65
66 @Test
67 @SuppressWarnings("Duplicates")
68 void update() throws Exception {
69 crud.update(TRACER_ADDRESS, form, ENABLED, true);
70 }
71
72 @Test
73 void reset() throws Exception {
74 crud.reset(TRACER_ADDRESS, form);
75 }
76 }