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 Aug 8, 2024
1 parent 6cb4aaf commit a5e426e
Show file tree
Hide file tree
Showing 19 changed files with 1,014 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

Large diffs are not rendered by default.

This file was deleted.

Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Loading

0 comments on commit a5e426e

Please sign in to comment.