View Javadoc
1   /*
2    *  Copyright 2022 Red Hat
3    *
4    *  Licensed under the Apache License, Version 2.0 (the "License");
5    *  you may not use this file except in compliance with the License.
6    *  You may obtain a copy of the License at
7    *
8    *      https://www.apache.org/licenses/LICENSE-2.0
9    *
10   *  Unless required by applicable law or agreed to in writing, software
11   *  distributed under the License is distributed on an "AS IS" BASIS,
12   *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   *  See the License for the specific language governing permissions and
14   *  limitations under the License.
15   */
16  package org.jboss.hal.testsuite.test.configuration.transaction;
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.Random;
24  import org.jboss.hal.testsuite.container.WildFlyContainer;
25  import org.jboss.hal.testsuite.fixtures.PathsFixtures;
26  import org.jboss.hal.testsuite.fixtures.TransactionFixtures;
27  import org.jboss.hal.testsuite.page.configuration.TransactionPage;
28  import org.jboss.hal.testsuite.test.Manatoko;
29  import org.junit.jupiter.api.BeforeAll;
30  import org.junit.jupiter.api.BeforeEach;
31  import org.junit.jupiter.api.Test;
32  import org.testcontainers.junit.jupiter.Container;
33  import org.testcontainers.junit.jupiter.Testcontainers;
34  import org.wildfly.extras.creaper.core.online.OnlineManagementClient;
35  import org.wildfly.extras.creaper.core.online.operations.Operations;
36  import org.wildfly.extras.creaper.core.online.operations.Values;
37  
38  import static org.jboss.hal.testsuite.container.WildFlyConfiguration.DEFAULT;
39  
40  @Manatoko
41  @Testcontainers
42  class PathTest {
43  
44      @Container static WildFlyContainer wildFly = WildFlyContainer.standalone(DEFAULT);
45  
46      @BeforeAll
47      static void setupModel() throws Exception {
48          OnlineManagementClient client = wildFly.managementClient();
49          Operations operations = new Operations(client);
50          operations.add(PathsFixtures.pathAddress(TransactionFixtures.PATH_EDIT), Values.of("value", Random.name()));
51      }
52  
53      @Inject Console console;
54      @Inject CrudOperations crudOperations;
55      @Page TransactionPage page;
56  
57      @BeforeEach
58      void prepare() {
59          page.navigate();
60          console.verticalNavigation()
61                  .selectPrimary(Ids.build("tx", "path", "config", "item"));
62      }
63  
64      @Test
65      void editObjectStorePath() throws Exception {
66          crudOperations.update(TransactionFixtures.TRANSACTIONS_ADDRESS, page.getPathForm(), "object-store-path");
67      }
68  
69      @Test
70      void editObjectStoreRelativeTo() throws Exception {
71          crudOperations.update(TransactionFixtures.TRANSACTIONS_ADDRESS, page.getPathForm(),
72                  TransactionFixtures.OBJECT_STORE_RELATIVE_TO);
73      }
74  }