Skip to content

Commit

Permalink
Extracting common code in InstallationManagerTestCase
Browse files Browse the repository at this point in the history
  • Loading branch information
spyrkob committed Nov 19, 2024
1 parent 7001ef9 commit 5d35afc
Show file tree
Hide file tree
Showing 20 changed files with 1,017 additions and 1,502 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
package org.wildfly.core.instmgr;

import java.nio.file.Path;
import java.text.DateFormat;
import java.util.Date;
import java.util.List;
import java.util.Locale;

Expand Down Expand Up @@ -53,7 +55,10 @@ public void execute(OperationContext context, ModelNode operation) throws Operat
for (HistoryResult hr : history) {
ModelNode entry = new ModelNode();
entry.get(InstMgrConstants.HISTORY_RESULT_HASH).set(hr.getName());
entry.get(InstMgrConstants.HISTORY_RESULT_TIMESTAMP).set(hr.timestamp().toString());
if (hr.timestamp() != null) {
final java.util.Date timestamp = Date.from(hr.timestamp());
entry.get(InstMgrConstants.HISTORY_RESULT_TIMESTAMP).set(DateFormat.getInstance().format(timestamp));
}
entry.get(InstMgrConstants.HISTORY_RESULT_TYPE).set(hr.getType().toLowerCase(Locale.ENGLISH));
if (hr.getVersions() != null && !hr.getVersions().isEmpty()) {
final ModelNode versions = entry.get(InstMgrConstants.HISTORY_RESULT_CHANNEL_VERSIONS);
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
package org.jboss.as.test.integration.domain.suites;

import java.io.IOException;
import java.net.URL;

import org.jboss.as.test.integration.domain.extension.ExtensionSetup;
import org.jboss.as.test.integration.domain.management.util.DomainTestSupport;
Expand Down Expand Up @@ -125,10 +126,12 @@ public static boolean isTestSuiteEnabled() {

private static void createTestModule() throws IOException {
testModule = new TestModule(MODULE_NAME, "org.wildfly.installation-manager.api");
final URL serviceLoader = SimpleRbacProviderTestSuite.class.getClassLoader()
.getResource("org/wildfly/test/installationmanager/services/org.wildfly.installationmanager.spi.InstallationManagerFactory");
testModule.addResource("test-mock-installation-manager.jar")
.addClass(TestInstallationManager.class)
.addClass(TestInstallationManagerFactory.class)
.addAsManifestResource("META-INF/services/org.wildfly.installationmanager.spi.InstallationManagerFactory",
.addAsManifestResource(serviceLoader,
"services/org.wildfly.installationmanager.spi.InstallationManagerFactory");
testModule.create(true);
}
Expand Down
3 changes: 3 additions & 0 deletions testsuite/manualmode/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -634,6 +634,9 @@
<exclude>org.wildfly.core.test.standalone.mgmt.events.*TestCase</exclude>
<!-- Requires modification of the process-uuid file inside the Jar -->
<exclude>org.jboss.as.test.manualmode.logging.ProcessUuidTestCase</exclude>

<!-- installation manager is not supported in the bootstrap jar -->
<exclude>org.jboss.as.test.manualmode.installationmanager.InstallationManagerIntegrationTestCase</exclude>
</excludes>
</configuration>
</execution>
Expand Down
Loading

0 comments on commit 5d35afc

Please sign in to comment.