Skip to content

Commit

Permalink
[WFCORE-6893] Add standalone mode tests for installation manager inte…
Browse files Browse the repository at this point in the history
…gration
  • Loading branch information
spyrkob committed Jul 17, 2024
1 parent bd81049 commit 8b38f17
Show file tree
Hide file tree
Showing 11 changed files with 808 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,18 @@ public void testHistoryChannels() throws Exception {
Assert.assertTrue(entry.hasDefined(InstMgrConstants.HISTORY_RESULT_TIMESTAMP));
Assert.assertTrue(entry.hasDefined(InstMgrConstants.HISTORY_RESULT_TYPE));
Assert.assertTrue(entry.hasDefined(InstMgrConstants.HISTORY_RESULT_DESCRIPTION));

// verify the channel version information is available (only "update" in test collection contains it)
if (entry.get(InstMgrConstants.HISTORY_RESULT_HASH).asString().equals("update")) {
Assert.assertTrue(entry.hasDefined(InstMgrConstants.HISTORY_RESULT_CHANNEL_VERSIONS));
final List<ModelNode> versions = entry.get(InstMgrConstants.HISTORY_RESULT_CHANNEL_VERSIONS).asList();
Assert.assertEquals(1, versions.size());
Assert.assertEquals("Update 1", versions.get(0).asString());
} else {
Assert.assertFalse(entry.hasDefined(InstMgrConstants.HISTORY_RESULT_CHANNEL_VERSIONS));
}
}

}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import org.jboss.as.test.integration.domain.management.util.DomainTestSupport;
import org.jboss.as.test.integration.management.base.AbstractCliTestBase;
import org.jboss.as.test.module.util.TestModule;
import org.jboss.dmr.ModelNode;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Assert;
Expand Down Expand Up @@ -786,6 +787,28 @@ public void uploadAndRemoveMultipleCustomPatches() throws IOException {
removeCustomPatch(patchManifestGA_2, host, hostCustomPatchDir_2);
}

@Test
public void testProductInfoIncludesInstallerInfo() throws Exception {
cli.sendLine(":product-info");

ModelNode res = cli.readAllAsOpResult().getResponseNode();

final List<ModelNode> hostResults = res.get("result").asList();
for (ModelNode host : hostResults) {
final List<ModelNode> summaries = host.get("result").asList();
for (ModelNode summary : summaries) {
summary = summary.get("summary");
if (!summary.hasDefined("instance-identifier")) {
continue;
}

Assert.assertTrue(summary.toString(), summary.hasDefined("last-update-date"));
Assert.assertTrue(summary.hasDefined("channel-versions"));
Assert.assertEquals(List.of(new ModelNode("Update 1")), summary.get("channel-versions").asList());
}
}
}

public void createAndUploadCustomPatch(String customPatchManifest, String host, Path hostCustomPatchDir, String mavenDirToZip, String expectedArtifact) throws IOException {
Path target = TARGET_DIR.resolve("installation-manager.zip");
File source = new File(getClass().getResource(mavenDirToZip).getFile());
Expand Down
Loading

0 comments on commit 8b38f17

Please sign in to comment.