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.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  import org.wildfly.extras.creaper.core.online.operations.admin.Administration;
35  
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 CreateTracerTest {
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          operations.removeIfExists(TRACER_ADDRESS);
50          Administration administration = new Administration(client);
51      }
52  
53      @Inject Console console;
54      @Inject CrudOperations crud;
55      @Page JcaPage page;
56      FormFragment form;
57  
58      @BeforeEach
59      void setUp() {
60          page.navigate();
61          console.verticalNavigation().selectPrimary(Ids.JCA_TRACER_ITEM);
62          form = page.getTracerForm();
63      }
64  
65      @Test
66      void create() throws Exception {
67          console.verticalNavigation().selectPrimary(Ids.JCA_TRACER_ITEM);
68          crud.createSingleton(TRACER_ADDRESS, form);
69      }
70  }