Skip to content
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
12 changes: 8 additions & 4 deletions .github/workflows/gh-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,15 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Setup Java 17 for quickstarts
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- name: Setup Java ${{ matrix.java }}
uses: actions/setup-java@v1
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java }}
java-package: jdk # (jre, jdk, or jdk+fx) - defaults to jdk
architecture: x64
distribution: 'temurin'
- name: Build & Verify using Maven
run: mvn clean verify -Pintegration-tests -U -fae -e -B
run: mvn clean verify -Pintegration-tests -Dinvoker.javaHome=$JAVA_HOME_17_X64 -Dserver.vm.install.path=$JAVA_HOME_17_X64 -U -fae -e -B
20 changes: 12 additions & 8 deletions distribution/integration-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,20 @@

<properties>
<skipITests>true</skipITests>
<server.id>install-wildfly-30.0.1.Final</server.id>
<server.url>https://github.com/wildfly/wildfly/releases/download/30.0.1.Final/wildfly-30.0.1.Final.zip</server.url>
<server.sha1>cd9c13350d775abcc728259b24b8bfabdf2b90a3</server.sha1>
<server.type.id>org.jboss.ide.eclipse.as.wildfly.270</server.type.id>
<server.version>30.0.1.Final</server.version>
<server.id>install-wildfly-38.0.1.Final</server.id>
<server.url>https://github.com/wildfly/wildfly/releases/download/38.0.1.Final/wildfly-38.0.1.Final.zip</server.url>
<server.sha1>c684d79e60de3222924a4ca5fecf2e21daa4e3ab</server.sha1>
<server.type.id>org.jboss.ide.eclipse.as.wildfly.380</server.type.id>
<server.version>38.0.1.Final</server.version>
<server.path>${project.build.directory}/wildfly-${server.version}</server.path>
<!-- Sonar report property for code coverage -->
<sonar.coverage.jacoco.xmlReportPaths>target/site/jacoco-aggregate/jacoco.xml</sonar.coverage.jacoco.xmlReportPaths>
<!-- Quickstarts properties -->
<quickstarts.server>wildfly</quickstarts.server>
<quickstarts.url>https://github.com/wildfly/quickstart/archive/30.0.1.Final.zip</quickstarts.url>
<quickstarts.dir>quickstart-30.0.1.Final</quickstarts.dir>
<quickstarts.url>https://github.com/wildfly/quickstart/archive/38.0.1.Final.zip</quickstarts.url>
<quickstarts.dir>quickstart-38.0.1.Final</quickstarts.dir>
<invoker.javaHome>${java.home}</invoker.javaHome>
<server.vm.install.path></server.vm.install.path>
</properties>

<name>Runtime Server Protocol : Integration Tests</name>
Expand All @@ -44,6 +46,7 @@
<server.version>${server.version}</server.version>
<server.path>${server.path}</server.path>
<quickstarts.server>${quickstarts.server}</quickstarts.server>
<server.vm.install.path>${server.vm.install.path}</server.vm.install.path>
</systemPropertyVariables>
</configuration>
</plugin>
Expand Down Expand Up @@ -122,11 +125,12 @@
</plugin>
<plugin>
<artifactId>maven-invoker-plugin</artifactId>
<version>3.2.0</version>
<version>3.8.1</version>
<configuration>
<cloneProjectsTo>${project.build.directory}/quickstarts</cloneProjectsTo>
<projectsDirectory>target/${quickstarts.dir}/</projectsDirectory>
<streamLogs>true</streamLogs>
<javaHome>${invoker.javaHome}</javaHome>
<pomIncludes>
<pomInclude>kitchensink/pom.xml</pomInclude>
<pomInclude>helloworld/pom.xml</pomInclude>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ public abstract class RSPCase {
protected static String WILDFLY_PATH;
protected static String WILDFLY_VERSION;
protected static String WILDFLY_ROOT;
protected static String VM_INSTALL_PATH;
protected static ServerType wildflyType;
protected static final String INVALID_PARAM = "Parameter is invalid. It may be null, missing required fields, or unacceptable values.";
protected static final String MISSING_SERVER_ID = "Invalid Request: Request must include server id.";
Expand All @@ -78,6 +79,7 @@ public static void initializeProperties() {
WILDFLY_PATH = getProperty("server.path");
WILDFLY_VERSION = getProperty("server.version");
WILDFLY_ROOT = Paths.get(WILDFLY_PATH).toAbsolutePath().toString();
VM_INSTALL_PATH = System.getProperty("server.vm.install.path");
wildflyType = RSPServerUtility.getServerType(WILDFLY_SERVER_ID);
}

Expand Down Expand Up @@ -159,6 +161,9 @@ public static void dispose() throws Exception {
protected void startServer(DummyClient client, String id) throws Exception {
Map<String, Object> attr = new HashMap<>();
attr.put("server.home.dir", WILDFLY_ROOT);
if (VM_INSTALL_PATH != null && !VM_INSTALL_PATH.isEmpty()) {
attr.put("vm.install.path", VM_INSTALL_PATH);
}
LaunchParameters params = new LaunchParameters(new ServerAttributes(wildflyType.getId(), id, attr), MODE_RUN);

StartServerResponse response = timeConsumption(new Callable<StartServerResponse>() {
Expand Down Expand Up @@ -198,6 +203,9 @@ protected Status createServer(String location, String id) throws Exception {
Map<String, Object> attr = new HashMap<>();
attr.put("server.home.dir", bean.getLocation());
attr.put("server.autopublish.inactivity.limit", 5000);
if (VM_INSTALL_PATH != null && !VM_INSTALL_PATH.isEmpty()) {
attr.put("vm.install.path", VM_INSTALL_PATH);
}
ServerAttributes serverAttr = new ServerAttributes(bean.getServerAdapterTypeId(), id, attr);
return timeConsumption(new Callable<Status>() {
public Status call() throws InterruptedException, ExecutionException, TimeoutException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ public static ServerType getServerType(String serverID) {
return createServerType(serverID, ServerTypeStringConstants.WF24_NAME, ServerTypeStringConstants.WF24_DESC);
case IServerConstants.SERVER_WILDFLY_270:
return createServerType(serverID, ServerTypeStringConstants.WF27_NAME, ServerTypeStringConstants.WF27_DESC);
case IServerConstants.SERVER_WILDFLY_350:
return createServerType(serverID, ServerTypeStringConstants.WF35_NAME, ServerTypeStringConstants.WF35_DESC);
case IServerConstants.SERVER_WILDFLY_380:
return createServerType(serverID, ServerTypeStringConstants.WF38_NAME, ServerTypeStringConstants.WF38_DESC);
default:
return createServerType(IServerConstants.SERVER_WILDFLY_120, ServerTypeStringConstants.WF12_NAME, ServerTypeStringConstants.WF12_DESC);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,15 +233,18 @@ public void testStartServer() throws Exception {
createServer(WILDFLY_ROOT, "wildfly3");
Map<String, Object> attr = new HashMap<>();
attr.put("server.home.dir", WILDFLY_ROOT);
if (VM_INSTALL_PATH != null && !VM_INSTALL_PATH.isEmpty()) {
attr.put("vm.install.path", VM_INSTALL_PATH);
}
LaunchParameters params = new LaunchParameters(
new ServerAttributes(wildflyType.getId(), "wildfly3", attr), MODE_RUN);

StartServerResponse response = serverProxy.startServerAsync(params).get(SERVER_OPERATION_TIMEOUT, TimeUnit.MILLISECONDS);

assertEquals(0, response.getStatus().getSeverity());
assertEquals(STATUS_MESSAGE_OK, response.getStatus().getMessage());
waitForServerState(ServerManagementAPIConstants.STATE_STARTED, 10, client);

serverProxy.stopServerAsync(new StopServerAttributes("wildfly3", true)).get();
waitForServerState(ServerManagementAPIConstants.STATE_STOPPED, 10, client);
}
Expand All @@ -252,15 +255,18 @@ public void testStartServerTwice() throws Exception {

Map<String, Object> attr = new HashMap<>();
attr.put("server.home.dir", WILDFLY_ROOT);
if (VM_INSTALL_PATH != null && !VM_INSTALL_PATH.isEmpty()) {
attr.put("vm.install.path", VM_INSTALL_PATH);
}
LaunchParameters params = new LaunchParameters(
new ServerAttributes(wildflyType.getId(), "wildfly4", attr), MODE_RUN);

serverProxy.startServerAsync(params).get(SERVER_OPERATION_TIMEOUT, TimeUnit.MILLISECONDS);
waitForServerState(ServerManagementAPIConstants.STATE_STARTED, 10, client);
StartServerResponse response = serverProxy.startServerAsync(params).get(SERVER_OPERATION_TIMEOUT, TimeUnit.MILLISECONDS);

assertEquals(Status.CANCEL, response.getStatus().getSeverity());

serverProxy.stopServerAsync(new StopServerAttributes("wildfly4", true)).get(SERVER_OPERATION_TIMEOUT, TimeUnit.MILLISECONDS);
waitForServerState(ServerManagementAPIConstants.STATE_STOPPED, 10, client);
}
Expand All @@ -271,6 +277,9 @@ public void testStopServer() throws Exception {
assertEquals(Status.OK, status.getSeverity());
Map<String, Object> attr = new HashMap<>();
attr.put("server.home.dir", WILDFLY_ROOT);
if (VM_INSTALL_PATH != null && !VM_INSTALL_PATH.isEmpty()) {
attr.put("vm.install.path", VM_INSTALL_PATH);
}
LaunchParameters params = new LaunchParameters(
new ServerAttributes(wildflyType.getId(), "wildfly5", attr), MODE_RUN);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
import org.junit.Test;

public class WildflyDownloadRuntimesTest extends RSPCase {
private static final String WILDFLY_RUNTIME_ID = "wildfly-1801finalruntime";
private static final String WILDFLY_DOWNLOADED_ID = "wildfly-18.0.1.Final";
private static final String WILDFLY_RUNTIME_ID = "wildfly-3801finalruntime";
private static final String WILDFLY_DOWNLOADED_ID = "wildfly-38.0.1.Final";

private static final String DOWNLOAD_REQUEST_EMPTY = "Unable to find an executor for the given download runtime";
private static final String INFO_REQUIRED_MESSAGE = "Please fill the requried information";
Expand Down Expand Up @@ -65,7 +65,7 @@ public void testElementFromDownloadableRuntimes() throws InterruptedException, E
assertNotNull(response);
List<DownloadRuntimeDescription> runtimes = response.getRuntimes();
DownloadRuntimeDescription rtm = getRuntimeById(runtimes, WILDFLY_RUNTIME_ID);
assertTrue(rtm.getName().contains("WildFly 18.0.1 Final"));
assertTrue(rtm.getName().contains("WildFly 38.0.1 Final"));
assertTrue(rtm.getHumanUrl().contains("http"));
assertTrue(rtm.getSize().equals("?"));
}
Expand Down Expand Up @@ -148,6 +148,6 @@ public boolean test() {
}

private DownloadRuntimeDescription getRuntimeById(List<DownloadRuntimeDescription> runtimes, String id) {
return runtimes.stream().filter(runtime -> runtime.getId().equals("wildfly-1801finalruntime")).findAny().orElse(null);
return runtimes.stream().filter(runtime -> runtime.getId().equals(id)).findAny().orElse(null);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@ public void setUp() {
expected.put(MockServerCreationUtilities.TEST_SERVER_TYPE_JPP_60, new Data(JBossServerBeanTypeProvider.JPP6, "6.0."));
expected.put(MockServerCreationUtilities.TEST_SERVER_TYPE_JPP_61, new Data(JBossServerBeanTypeProvider.JPP61, "6.1.", "JPP"));
expected.put(MockServerCreationUtilities.TEST_SERVER_TYPE_WONKA_1, new Data(JBossServerBeanTypeProvider.UNKNOWN_AS72_PRODUCT, "1.0.", "WONKA"));
expected.put(MockServerCreationUtilities.TEST_SERVER_TYPE_WILDFLY_390, new Data(JBossServerBeanTypeProvider.WILDFLY380, "39.0."));
expected.put(MockServerCreationUtilities.TEST_SERVER_TYPE_WILDFLY_400, new Data(JBossServerBeanTypeProvider.WILDFLY380, "40.0."));
expected.put(MockServerCreationUtilities.TEST_SERVER_TYPE_WILDFLY_410, new Data(JBossServerBeanTypeProvider.WILDFLY380, "41.0."));
// NEW_SERVER_ADAPTER
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,16 +97,22 @@ public class MockServerCreationUtilities extends Assert {
public static final String TEST_SERVER_TYPE_EAP_65 = "TEST_SERVER_TYPE_EAP_65";

public static final String TEST_SERVER_TYPE_WONKA_1 = "TEST_SERVER_TYPE_WONKA_1_MISMATCH";


public static final String[] TEST_SERVER_TYPES_TO_MOCK = new String[] {
TEST_SERVER_TYPE_GATEIN_34,

public static final String TEST_SERVER_TYPE_WILDFLY_390 = "TEST_SERVER_TYPE_WILDFLY_390";
public static final String TEST_SERVER_TYPE_WILDFLY_400 = "TEST_SERVER_TYPE_WILDFLY_400";
public static final String TEST_SERVER_TYPE_WILDFLY_410 = "TEST_SERVER_TYPE_WILDFLY_410";

public static final String[] TEST_SERVER_TYPES_TO_MOCK = new String[] {
TEST_SERVER_TYPE_GATEIN_34,
TEST_SERVER_TYPE_GATEIN_35,
TEST_SERVER_TYPE_GATEIN_36,
TEST_SERVER_TYPE_JPP_60,
TEST_SERVER_TYPE_JPP_61,
TEST_SERVER_TYPE_EAP_65,
TEST_SERVER_TYPE_WONKA_1
TEST_SERVER_TYPE_WONKA_1,
TEST_SERVER_TYPE_WILDFLY_390,
TEST_SERVER_TYPE_WILDFLY_400,
TEST_SERVER_TYPE_WILDFLY_410
};

static {
Expand Down Expand Up @@ -153,6 +159,9 @@ public class MockServerCreationUtilities extends Assert {
asSystemJar.put(TEST_SERVER_TYPE_JPP_61, jpp_server_6_1_jar);
asSystemJar.put(TEST_SERVER_TYPE_WONKA_1, eap_server_6_1_jar);
asSystemJar.put(TEST_SERVER_TYPE_GATEIN_34, gatein_3_4_0_jar);
asSystemJar.put(TEST_SERVER_TYPE_WILDFLY_390, wildfly_20_0_jar);
asSystemJar.put(TEST_SERVER_TYPE_WILDFLY_400, wildfly_20_0_jar);
asSystemJar.put(TEST_SERVER_TYPE_WILDFLY_410, wildfly_20_0_jar);
// NEW_SERVER_ADAPTER Add the new runtime constant above this line
}

Expand Down Expand Up @@ -282,6 +291,12 @@ public static File createMockServerLayout(String serverType) {
serverDir = createAS72EAP65StyleMockServerDirectory(name, serverType, asSystemJar.get(serverType));
} else if (TEST_SERVER_TYPE_WONKA_1.equals(serverType)) {
serverDir = createAS72Wonka1MockServerDirectory(name, serverType, asSystemJar.get(serverType));
} else if (TEST_SERVER_TYPE_WILDFLY_390.equals(serverType)) {
serverDir = createWildfly390MockServerDirectory(name, serverType, asSystemJar.get(serverType));
} else if (TEST_SERVER_TYPE_WILDFLY_400.equals(serverType)) {
serverDir = createWildfly400MockServerDirectory(name, serverType, asSystemJar.get(serverType));
} else if (TEST_SERVER_TYPE_WILDFLY_410.equals(serverType)) {
serverDir = createWildfly410MockServerDirectory(name, serverType, asSystemJar.get(serverType));
}
// NEW_SERVER_ADAPTER add mock folder structure above
return serverDir;
Expand Down Expand Up @@ -445,6 +460,18 @@ private static File createWildfly380MockServerDirectory(String name, String serv
return createWildflyServerDirectory(name, serverTypeId, serverJar, "main",
"JBoss-Product-Release-Name: WildFly Full\nJBoss-Product-Release-Version: 38.0.0.Final\n");
}
private static File createWildfly390MockServerDirectory(String name, String serverTypeId, String serverJar) {
return createWildflyServerDirectory(name, serverTypeId, serverJar, "main",
"JBoss-Product-Release-Name: WildFly Full\nJBoss-Product-Release-Version: 39.0.1.Final\n");
}
private static File createWildfly400MockServerDirectory(String name, String serverTypeId, String serverJar) {
return createWildflyServerDirectory(name, serverTypeId, serverJar, "main",
"JBoss-Product-Release-Name: WildFly Full\nJBoss-Product-Release-Version: 40.0.1.Final\n");
}
private static File createWildfly410MockServerDirectory(String name, String serverTypeId, String serverJar) {
return createWildflyServerDirectory(name, serverTypeId, serverJar, "main",
"JBoss-Product-Release-Name: WildFly Full\nJBoss-Product-Release-Version: 41.0.0.Final\n");
}

private static File createWildflyServerDirectory(String name, String serverTypeId, String serverJar, String manString) {
return createWildflyServerDirectory(name, serverTypeId, serverJar, "wildfly-full", manString);
Expand Down
Loading