-
Notifications
You must be signed in to change notification settings - Fork 466
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[WFCORE-6728] Setup tasks to reload to a server stability level
- Loading branch information
Showing
6 changed files
with
209 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
...java/org/wildfly/core/test/standalone/stability/AbstractStabilityServerSetupTaskTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* | ||
* JBoss, Home of Professional Open Source. | ||
* Copyright 2024 Red Hat, Inc., and individual contributors | ||
* as indicated by the @author tags. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
*/ | ||
|
||
package org.wildfly.core.test.standalone.stability; | ||
|
||
import jakarta.inject.Inject; | ||
import org.jboss.as.controller.PathAddress; | ||
import org.jboss.as.controller.operations.common.Util; | ||
import org.jboss.as.test.integration.management.ManagementOperations; | ||
import org.jboss.as.version.Stability; | ||
import org.jboss.dmr.ModelNode; | ||
import org.junit.Assert; | ||
import org.junit.Test; | ||
import org.wildfly.core.testrunner.ManagementClient; | ||
|
||
import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.CORE_SERVICE; | ||
import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.STABILITY; | ||
import static org.jboss.as.server.controller.descriptions.ServerDescriptionConstants.SERVER_ENVIRONMENT; | ||
|
||
public abstract class AbstractStabilityServerSetupTaskTest { | ||
private final Stability desiredStability; | ||
|
||
@Inject | ||
private ManagementClient managementClient; | ||
|
||
public AbstractStabilityServerSetupTaskTest(Stability desiredStability) { | ||
this.desiredStability = desiredStability; | ||
} | ||
|
||
@Test | ||
public void testStabilityMatchesSetupTask() throws Exception { | ||
ModelNode op = Util.getReadAttributeOperation(PathAddress.pathAddress(CORE_SERVICE, SERVER_ENVIRONMENT), STABILITY); | ||
ModelNode result = ManagementOperations.executeOperation(managementClient.getControllerClient(), op); | ||
Stability stability = Stability.fromString(result.asString()); | ||
Assert.assertEquals(desiredStability, stability); | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
...ava/org/wildfly/core/test/standalone/stability/StabilityCommunityServerSetupTestCase.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* JBoss, Home of Professional Open Source. | ||
* Copyright 2024 Red Hat, Inc., and individual contributors | ||
* as indicated by the @author tags. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
*/ | ||
|
||
package org.wildfly.core.test.standalone.stability; | ||
|
||
import org.jboss.as.version.Stability; | ||
import org.junit.runner.RunWith; | ||
import org.wildfly.core.testrunner.ServerSetup; | ||
import org.wildfly.core.testrunner.WildFlyRunner; | ||
import org.wildfly.test.stability.StabilityServerSetupTasks; | ||
|
||
@ServerSetup(StabilityServerSetupTasks.Community.class) | ||
@RunWith(WildFlyRunner.class) | ||
public class StabilityCommunityServerSetupTestCase extends AbstractStabilityServerSetupTaskTest { | ||
public StabilityCommunityServerSetupTestCase() { | ||
super(Stability.COMMUNITY); | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
.../java/org/wildfly/core/test/standalone/stability/StabilityDefaultServerSetupTestCase.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* JBoss, Home of Professional Open Source. | ||
* Copyright 2024 Red Hat, Inc., and individual contributors | ||
* as indicated by the @author tags. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
*/ | ||
|
||
package org.wildfly.core.test.standalone.stability; | ||
|
||
import org.jboss.as.version.Stability; | ||
import org.junit.runner.RunWith; | ||
import org.wildfly.core.testrunner.ServerSetup; | ||
import org.wildfly.core.testrunner.WildFlyRunner; | ||
import org.wildfly.test.stability.StabilityServerSetupTasks; | ||
|
||
@ServerSetup(StabilityServerSetupTasks.Default.class) | ||
@RunWith(WildFlyRunner.class) | ||
public class StabilityDefaultServerSetupTestCase extends AbstractStabilityServerSetupTaskTest { | ||
public StabilityDefaultServerSetupTestCase() { | ||
super(Stability.DEFAULT); | ||
} | ||
|
||
} |
34 changes: 34 additions & 0 deletions
34
.../org/wildfly/core/test/standalone/stability/StabilityExperimentalServerSetupTestCase.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* JBoss, Home of Professional Open Source. | ||
* Copyright 2024 Red Hat, Inc., and individual contributors | ||
* as indicated by the @author tags. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
*/ | ||
|
||
package org.wildfly.core.test.standalone.stability; | ||
|
||
import org.jboss.as.version.Stability; | ||
import org.junit.runner.RunWith; | ||
import org.wildfly.core.testrunner.ServerSetup; | ||
import org.wildfly.core.testrunner.WildFlyRunner; | ||
import org.wildfly.test.stability.StabilityServerSetupTasks; | ||
|
||
@ServerSetup(StabilityServerSetupTasks.Experimental.class) | ||
@RunWith(WildFlyRunner.class) | ||
public class StabilityExperimentalServerSetupTestCase extends AbstractStabilityServerSetupTaskTest { | ||
public StabilityExperimentalServerSetupTestCase() { | ||
super(Stability.EXPERIMENTAL); | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
.../java/org/wildfly/core/test/standalone/stability/StabilityPreviewServerSetupTestCase.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* JBoss, Home of Professional Open Source. | ||
* Copyright 2024 Red Hat, Inc., and individual contributors | ||
* as indicated by the @author tags. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
*/ | ||
|
||
package org.wildfly.core.test.standalone.stability; | ||
|
||
import org.jboss.as.version.Stability; | ||
import org.junit.runner.RunWith; | ||
import org.wildfly.core.testrunner.ServerSetup; | ||
import org.wildfly.core.testrunner.WildFlyRunner; | ||
import org.wildfly.test.stability.StabilityServerSetupTasks; | ||
|
||
@ServerSetup(StabilityServerSetupTasks.Preview.class) | ||
@RunWith(WildFlyRunner.class) | ||
public class StabilityPreviewServerSetupTestCase extends AbstractStabilityServerSetupTaskTest { | ||
public StabilityPreviewServerSetupTestCase() { | ||
super(Stability.PREVIEW); | ||
} | ||
} |