1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.jboss.hal.testsuite.configuration.batch;
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.CrudOperations;
22 import org.jboss.hal.testsuite.container.WildFlyContainer;
23 import org.jboss.hal.testsuite.fragment.FormFragment;
24 import org.jboss.hal.testsuite.page.configuration.BatchPage;
25 import org.jboss.hal.testsuite.test.Manatoko;
26 import org.junit.jupiter.api.BeforeAll;
27 import org.junit.jupiter.api.BeforeEach;
28 import org.junit.jupiter.api.Test;
29 import org.testcontainers.junit.jupiter.Container;
30 import org.testcontainers.junit.jupiter.Testcontainers;
31 import org.wildfly.extras.creaper.core.online.operations.Operations;
32
33 import static org.jboss.hal.dmr.ModelDescriptionConstants.RESTART_JOBS_ON_RESUME;
34 import static org.jboss.hal.testsuite.container.WildFlyConfiguration.DEFAULT;
35 import static org.jboss.hal.testsuite.fixtures.BatchFixtures.SUBSYSTEM_ADDRESS;
36
37 @Manatoko
38 @Testcontainers
39 class BatchConfigurationTest {
40
41 @Container static WildFlyContainer wildFly = WildFlyContainer.standalone(DEFAULT);
42 static boolean restart;
43
44 @BeforeAll
45 static void setupModel() throws Exception {
46 Operations operations = new Operations(wildFly.managementClient());
47 restart = operations.readAttribute(SUBSYSTEM_ADDRESS, RESTART_JOBS_ON_RESUME).booleanValue();
48 }
49
50 @Page BatchPage page;
51 @Inject Console console;
52 @Inject CrudOperations crud;
53 FormFragment form;
54
55 @BeforeEach
56 void prepare() {
57 page.navigate();
58 console.verticalNavigation().selectPrimary("batch-configuration-item");
59 form = page.getConfigurationForm();
60 }
61
62 @Test
63 void update() throws Exception {
64 crud.update(SUBSYSTEM_ADDRESS, form, RESTART_JOBS_ON_RESUME, !restart);
65 }
66
67 @Test
68 void reset() throws Exception {
69 crud.reset(SUBSYSTEM_ADDRESS, form);
70 }
71 }