1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.jboss.hal.testsuite.test.configuration.logging;
17
18 import org.jboss.arquillian.core.api.annotation.Inject;
19 import org.jboss.hal.testsuite.CrudOperations;
20 import org.jboss.hal.testsuite.fragment.FormFragment;
21 import org.jboss.hal.testsuite.page.configuration.LoggingConfigurationPage;
22 import org.junit.jupiter.api.BeforeEach;
23 import org.junit.jupiter.api.Test;
24 import org.wildfly.extras.creaper.core.online.operations.Address;
25
26 import static org.jboss.hal.dmr.ModelDescriptionConstants.LEVEL;
27
28 public abstract class AbstractRootLoggerTest {
29
30 @Inject CrudOperations crud;
31
32 protected abstract Address rootLoggerAddress();
33
34 protected abstract void navigateToPage();
35
36 protected abstract LoggingConfigurationPage getPage();
37
38 @BeforeEach
39 void prepare() {
40 navigateToPage();
41 }
42
43 @Test
44 void updateRootLogger() throws Exception {
45 FormFragment form = getPage().getRootLoggerForm();
46 crud.update(rootLoggerAddress(), form,
47 f -> f.select(LEVEL, "ERROR"),
48 resourceVerifier -> resourceVerifier.verifyAttribute(LEVEL, "ERROR"));
49 }
50
51 @Test
52 void resetRootLogger() throws Exception {
53 FormFragment form = getPage().getRootLoggerForm();
54 crud.reset(rootLoggerAddress(), form);
55 }
56 }