Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add WildFly 29 #232

Merged
merged 3 commits into from
Sep 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## 2.0.3 (not yet released)

- added support for WildFly 28
- added support for WildFly 28 - 29

## 2.0.2 (2023-01-18)

Expand Down
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,29 @@ Dependencies for `creaper-commands`:
<version>20.0.2.Final</version>
</dependency>

#### WildFly 29 (29.0.1) (based on WildFly Core 21)

Dependencies for `creaper-core`:

<dependency>
<groupId>org.wildfly.core</groupId>
<artifactId>wildfly-controller-client</artifactId>
<version>21.1.1.Final</version>
</dependency>
<dependency>
<groupId>org.wildfly.core</groupId>
<artifactId>wildfly-cli</artifactId>
<version>21.1.1.Final</version>
</dependency>

Dependencies for `creaper-commands`:

<dependency>
<groupId>org.wildfly.core</groupId>
<artifactId>wildfly-patching</artifactId>
<version>21.1.1.Final</version>
</dependency>

### Transitive Dependencies

These are the dependencies that you will get transitively when you depend
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.wildfly.extras.creaper.commands.patching;

import org.wildfly.extras.creaper.core.CommandFailedException;
import org.wildfly.extras.creaper.core.ServerVersion;
import org.wildfly.extras.creaper.core.online.CliException;
import org.wildfly.extras.creaper.core.online.OnlineCommand;
import org.wildfly.extras.creaper.core.online.OnlineCommandContext;
Expand Down Expand Up @@ -31,6 +32,11 @@ private ApplyPatch(Builder builder) {

@Override
public void apply(OnlineCommandContext ctx) throws CliException, CommandFailedException, IOException {
if (ctx.options.isStandalone && ctx.version.greaterThan(ServerVersion.VERSION_21_0_0)) {
// https://issues.redhat.com/browse/WFCORE-6206
throw new AssertionError("Patching has been removed in WildFly 29.");
}

StringBuilder cmd = new StringBuilder("patch apply " + patchPath);
if (ctx.options.isDomain) {
cmd.append(" --host=");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.wildfly.extras.creaper.commands.patching;

import org.jboss.dmr.ModelNode;
import org.wildfly.extras.creaper.core.ServerVersion;
import org.wildfly.extras.creaper.core.online.ModelNodeResult;
import org.wildfly.extras.creaper.core.online.OnlineManagementClient;
import org.wildfly.extras.creaper.core.online.operations.Address;
Expand All @@ -13,10 +14,12 @@
import java.util.List;

public final class PatchingOperations {
private final OnlineManagementClient client;
private final Operations ops;
private final Address patchingAddress;

public PatchingOperations(OnlineManagementClient client) {
this.client = client;
this.ops = new Operations(client);
this.patchingAddress = Address.coreService("patching");
}
Expand All @@ -25,6 +28,7 @@ public PatchingOperations(OnlineManagementClient client) {
* @return list of history entries of all patches that have been applied; never {@code null}
*/
public List<PatchHistoryEntry> getHistory() throws IOException {
checkServerVersionIsSupported();
List<ModelNode> asList = ops.invoke("show-history", patchingAddress).listValue();
List<PatchHistoryEntry> entries = new ArrayList<PatchHistoryEntry>(asList.size());

Expand Down Expand Up @@ -59,6 +63,7 @@ public PatchHistoryEntry getHistoryEntry(String patchId) throws IOException {
* @return information about current patch state as a {@code PatchInfo} object; never {@code null}
*/
public PatchInfo getPatchInfo() throws IOException {
checkServerVersionIsSupported();
ModelNodeResult modelNodeResult = ops.readResource(patchingAddress, ReadResourceOption.RECURSIVE,
ReadResourceOption.INCLUDE_RUNTIME);
modelNodeResult.assertDefinedValue();
Expand All @@ -80,6 +85,7 @@ public PatchInfo getPatchInfo() throws IOException {
* @throws IOException when IO error occurs
*/
public String getCumulativePatchId() throws IOException {
checkServerVersionIsSupported();
return ops.readAttribute(patchingAddress, "cumulative-patch-id").stringValue(null);
}

Expand All @@ -89,6 +95,7 @@ public String getCumulativePatchId() throws IOException {
* @throws IOException when IO error occurs
*/
public String getCurrentServerVersion() throws IOException {
checkServerVersionIsSupported();
return ops.readAttribute(patchingAddress, "version").stringValue(null);
}

Expand All @@ -97,6 +104,7 @@ public String getCurrentServerVersion() throws IOException {
* @throws IOException when IO error occurs
*/
public List<String> getPatchesIds() throws IOException {
checkServerVersionIsSupported();
return ops.readAttribute(patchingAddress, "patches").stringListValue(Collections.<String>emptyList());
}

Expand Down Expand Up @@ -235,4 +243,15 @@ public String toString() {
return "PatchHistoryEntry {patchId='" + patchId + "\', type='" + type + "\', appliedAt='" + appliedAt + "\'}";
}
}

private void checkServerVersionIsSupported() {
try {
if (client.version().greaterThan(ServerVersion.VERSION_21_0_0)) {
// https://issues.redhat.com/browse/WFCORE-6206
throw new AssertionError("Patching subsystem has been removed in WildFly 29.");
}
} catch (IOException ioe) {
throw new IllegalStateException(ioe);
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.wildfly.extras.creaper.commands.patching;

import org.wildfly.extras.creaper.core.ServerVersion;
import org.wildfly.extras.creaper.core.online.OnlineCommand;
import org.wildfly.extras.creaper.core.online.OnlineCommandContext;
import org.wildfly.extras.creaper.core.online.operations.Address;
Expand Down Expand Up @@ -31,6 +32,10 @@ private RollbackLastPatch(Builder builder) {

@Override
public void apply(OnlineCommandContext ctx) throws IOException {
if (ctx.version.greaterThan(ServerVersion.VERSION_21_0_0)) {
// https://issues.redhat.com/browse/WFCORE-6206
throw new AssertionError("Patching has been removed in WildFly 29.");
}
Operations ops = new Operations(ctx.client);
ops.invoke("rollback-last", Address.coreService("patching"), Values.empty()
.andOptional("reset-configuration", resetConfiguration)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.wildfly.extras.creaper.commands.patching;

import org.wildfly.extras.creaper.core.ServerVersion;
import org.wildfly.extras.creaper.core.online.OnlineCommand;
import org.wildfly.extras.creaper.core.online.OnlineCommandContext;
import org.wildfly.extras.creaper.core.online.operations.Address;
Expand Down Expand Up @@ -35,6 +36,10 @@ private RollbackPatch(Builder builder) {

@Override
public void apply(OnlineCommandContext ctx) throws IOException {
if (ctx.version.greaterThan(ServerVersion.VERSION_21_0_0)) {
// https://issues.redhat.com/browse/WFCORE-6206
throw new AssertionError("Patching has been removed in WildFly 29.");
}
Operations ops = new Operations(ctx.client);
ops.invoke("rollback", Address.coreService("patching"), Values.empty()
.andOptional("patch-id", patchId)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ public final class ServerVersion {
public static final ServerVersion VERSION_20_0_0 = new ServerVersion(20, 0, 0);
/** WF 28.0.x.Final */
public static final ServerVersion VERSION_21_0_0 = new ServerVersion(21, 0, 0);
/** WF 29.0.x.Final */
public static final ServerVersion VERSION_22_0_0 = new ServerVersion(22, 0, 0);

private static final ServerVersion[] KNOWN_VERSIONS = {
VERSION_0_0_0,
Expand Down Expand Up @@ -134,7 +136,8 @@ public final class ServerVersion {
VERSION_18_0_0,
VERSION_19_0_0,
VERSION_20_0_0,
VERSION_21_0_0
VERSION_21_0_0,
VERSION_22_0_0
};

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public void referenceEquality() {
assertSame(ServerVersion.VERSION_19_0_0, ServerVersion.from(19, 0, 0));
assertSame(ServerVersion.VERSION_20_0_0, ServerVersion.from(20, 0, 0));
assertSame(ServerVersion.VERSION_21_0_0, ServerVersion.from(21, 0, 0));
assertSame(ServerVersion.VERSION_22_0_0, ServerVersion.from(22, 0, 0));

assertNotSame(ServerVersion.from(42, 42, 42), ServerVersion.from(42, 42, 42));
}
Expand Down Expand Up @@ -83,6 +84,7 @@ public void equality() {
assertSame(ServerVersion.VERSION_19_0_0, ServerVersion.from(19, 0, 0));
assertSame(ServerVersion.VERSION_20_0_0, ServerVersion.from(20, 0, 0));
assertSame(ServerVersion.VERSION_21_0_0, ServerVersion.from(21, 0, 0));
assertSame(ServerVersion.VERSION_22_0_0, ServerVersion.from(22, 0, 0));

assertEquals(ServerVersion.from(42, 42, 42), ServerVersion.from(42, 42, 42));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ public class OfflineServerVersionTest {
private static final String WFLY26_ROOT = "19.0";
private static final String WFLY27_ROOT = "20.0";
private static final String WFLY28_ROOT = "21.0";
private static final String WFLY29_ROOT = "22.0";

private static final String COMMUNITY = "community";
private static final String PREVIEW = "preview";
Expand Down Expand Up @@ -201,20 +202,24 @@ public void discoverStandaloneXml_wfly28() throws IOException {
}

@Test
public void discoverStandaloneXml_wfly29() throws IOException {
test(ServerVersion.VERSION_22_0_0, STANDALONE_XML, WFLY29_ROOT, EAP7_LOGGING, EAP8_EE);
}

public void discoverStandaloneXml_wfly34_community() throws IOException {
test(ServerVersion.VERSION_20_0_0, STANDALONE_XML, COMMUNITY, WFLY27_ROOT, EAP7_LOGGING, EAP8_EE);
test(ServerVersion.VERSION_20_0_0, STANDALONE_XML, COMMUNITY, WFLY27_ROOT, EAP7_LOGGING, EAP8_EE);
}

@Test
public void discoverStandaloneXml_wfly34_experimental() throws IOException {
// Doesn't currently exist but verify it can be parsed correctly.
test(ServerVersion.VERSION_20_0_0, STANDALONE_XML, EXPERIMENTAL, WFLY27_ROOT, EAP7_LOGGING, EAP8_EE);
test(ServerVersion.VERSION_20_0_0, STANDALONE_XML, EXPERIMENTAL, WFLY27_ROOT, EAP7_LOGGING, EAP8_EE);
}

@Test
public void discoverStandaloneXml_wfly34_preview() throws IOException {
// Doesn't currently exist but verify it can be parsed correctly.
test(ServerVersion.VERSION_20_0_0, STANDALONE_XML, PREVIEW, WFLY27_ROOT, EAP7_LOGGING, EAP8_EE);
test(ServerVersion.VERSION_20_0_0, STANDALONE_XML, PREVIEW, WFLY27_ROOT, EAP7_LOGGING, EAP8_EE);
}

@Test
Expand Down Expand Up @@ -318,6 +323,10 @@ public void discoverHostXml_wfly28() throws IOException {
}

@Test
public void discoverHostXml_wfly29() throws IOException {
test(ServerVersion.VERSION_22_0_0, HOST_XML, WFLY29_ROOT, EAP7_LOGGING, EAP8_EE);
}

public void discoverHostXml_wfly34_community() throws IOException {
test(ServerVersion.VERSION_20_0_0, HOST_XML, COMMUNITY, WFLY27_ROOT, EAP7_LOGGING, EAP8_EE);
}
Expand Down Expand Up @@ -435,6 +444,10 @@ public void discoverDomainXml_wfly28() throws IOException {
}

@Test
public void discoverDomainXml_wfly29() throws IOException {
test(ServerVersion.VERSION_22_0_0, DOMAIN_XML, WFLY29_ROOT, EAP7_LOGGING, EAP8_EE);
}

public void discoverDomainXml_wfly34_community() throws IOException {
test(ServerVersion.VERSION_20_0_0, DOMAIN_XML, COMMUNITY, WFLY27_ROOT, EAP7_LOGGING, EAP8_EE);
}
Expand Down
65 changes: 61 additions & 4 deletions testsuite/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@
<version.wildfly28>28.0.1.Final</version.wildfly28>
<version.wildfly28.core>20.0.2.Final</version.wildfly28.core>
<version.wildfly28.arquillian>5.0.0.Alpha6</version.wildfly28.arquillian>
<version.wildfly29>29.0.1.Final</version.wildfly29>
<version.wildfly29.core>21.1.1.Final</version.wildfly29.core>
<version.wildfly29.arquillian>5.0.0.Final</version.wildfly29.arquillian>


<managementPort.wildfly>9990</managementPort.wildfly>
Expand Down Expand Up @@ -217,6 +220,13 @@
<wildfly28.arquillianContainer.artifactId>wildfly-arquillian-container-managed</wildfly28.arquillianContainer.artifactId>
<wildfly28.arquillianContainer.version>${version.wildfly28.arquillian}</wildfly28.arquillianContainer.version>

<wildfly29.applicationServer.groupId>org.wildfly</wildfly29.applicationServer.groupId>
<wildfly29.applicationServer.artifactId>wildfly-dist</wildfly29.applicationServer.artifactId>
<wildfly29.applicationServer.version>${version.wildfly29}</wildfly29.applicationServer.version>
<wildfly29.arquillianContainer.groupId>org.wildfly.arquillian</wildfly29.arquillianContainer.groupId>
<wildfly29.arquillianContainer.artifactId>wildfly-arquillian-container-managed</wildfly29.arquillianContainer.artifactId>
<wildfly29.arquillianContainer.version>${version.wildfly29.arquillian}</wildfly29.arquillianContainer.version>

<!-- defined in profiles "wildfly10", "wildfly11", "wildfly12", "wildfly13", "wildfly14", "wildfly15",
"wildfly16", "wildfly17", "wildfly18", "wildfly19" and "wildfly20" below -->
<applicationServer.groupId>MUST-BE-DEFINED</applicationServer.groupId>
Expand Down Expand Up @@ -1260,10 +1270,6 @@

<profile>
<id>wildfly28</id>
<activation>
<!-- Note: WildFly 27+ doesn't support JDK 1.8 anymore -->
<activeByDefault>true</activeByDefault>
</activation>

<properties>
<version.java>1.8</version.java>
Expand Down Expand Up @@ -1309,5 +1315,56 @@
</dependencies>
</profile>

<profile>
<id>wildfly29</id>
<activation>
<!-- Note: WildFly 27+ doesn't support JDK 1.8 anymore -->
<activeByDefault>true</activeByDefault>
</activation>

<properties>
<version.java>1.8</version.java>

<applicationServer.groupId>${wildfly29.applicationServer.groupId}</applicationServer.groupId>
<applicationServer.artifactId>${wildfly29.applicationServer.artifactId}</applicationServer.artifactId>
<applicationServer.version>${wildfly29.applicationServer.version}</applicationServer.version>
<applicationServer.managementPort>${managementPort.wildfly}</applicationServer.managementPort>

<arquillianContainer.groupId>${wildfly29.arquillianContainer.groupId}</arquillianContainer.groupId>
<arquillianContainer.artifactId>${wildfly29.arquillianContainer.artifactId}</arquillianContainer.artifactId>
<arquillianContainer.version>${wildfly29.arquillianContainer.version}</arquillianContainer.version>

<tests.ignoredCategory>${ignoredCategory.wildfly11}</tests.ignoredCategory>
<tests.specialJvmArgs />
</properties>

<dependencies>
<dependency>
<groupId>org.wildfly.extras.creaper</groupId>
<artifactId>creaper-core</artifactId>
</dependency>
<dependency>
<groupId>org.wildfly.extras.creaper</groupId>
<artifactId>creaper-commands</artifactId>
</dependency>

<dependency>
<groupId>org.wildfly.core</groupId>
<artifactId>wildfly-controller-client</artifactId>
<version>${version.wildfly29.core}</version>
</dependency>
<dependency>
<groupId>org.wildfly.core</groupId>
<artifactId>wildfly-cli</artifactId>
<version>${version.wildfly29.core}</version>
</dependency>
<dependency>
<groupId>org.wildfly.core</groupId>
<artifactId>wildfly-patching</artifactId>
<version>${version.wildfly29.core}</version>
</dependency>
</dependencies>
</profile>

</profiles>
</project>
Loading
Loading