Skip to content

Commit 2f17da0

Browse files
committed
Extracting common code in InstallationManagerTestCase
1 parent 4a3fda6 commit 2f17da0

File tree

19 files changed

+1014
-1502
lines changed

19 files changed

+1014
-1502
lines changed

installation-manager/src/main/java/org/wildfly/core/instmgr/InstMgrHistoryHandler.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
package org.wildfly.core.instmgr;
77

88
import java.nio.file.Path;
9+
import java.text.DateFormat;
10+
import java.util.Date;
911
import java.util.List;
1012
import java.util.Locale;
1113

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

testsuite/domain/src/test/java/org/jboss/as/test/integration/domain/installationmanager/InstallationManagerIntegrationTestCase.java

Lines changed: 15 additions & 805 deletions
Large diffs are not rendered by default.

testsuite/domain/src/test/java/org/jboss/as/test/integration/domain/suites/SimpleRbacProviderTestSuite.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
package org.jboss.as.test.integration.domain.suites;
77

88
import java.io.IOException;
9+
import java.net.URL;
910

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

126127
private static void createTestModule() throws IOException {
127128
testModule = new TestModule(MODULE_NAME, "org.wildfly.installation-manager.api");
129+
final URL serviceLoader = SimpleRbacProviderTestSuite.class.getClassLoader()
130+
.getResource("org/wildfly/test/installationmanager/services/org.wildfly.installationmanager.spi.InstallationManagerFactory");
128131
testModule.addResource("test-mock-installation-manager.jar")
129132
.addClass(TestInstallationManager.class)
130133
.addClass(TestInstallationManagerFactory.class)
131-
.addAsManifestResource("META-INF/services/org.wildfly.installationmanager.spi.InstallationManagerFactory",
134+
.addAsManifestResource(serviceLoader,
132135
"services/org.wildfly.installationmanager.spi.InstallationManagerFactory");
133136
testModule.create(true);
134137
}

testsuite/manualmode/src/test/java/org/jboss/as/test/manualmode/installationmanager/InstallationManagerIntegrationTestCase.java

Lines changed: 14 additions & 689 deletions
Large diffs are not rendered by default.

testsuite/manualmode/src/test/resources/META-INF/services/org.wildfly.installationmanager.spi.InstallationManagerFactory

Lines changed: 0 additions & 6 deletions
This file was deleted.

testsuite/manualmode/src/test/resources/org/jboss/as/test/manualmode/installationmanager/test-repo-one/dummy_file_one.txt

Whitespace-only changes.

testsuite/manualmode/src/test/resources/org/jboss/as/test/manualmode/installationmanager/test-repo-one/maven-repository/artifact-one

Whitespace-only changes.

testsuite/manualmode/src/test/resources/org/jboss/as/test/manualmode/installationmanager/test-repo-one/other-directory-one/dummy_file_one.txt

Whitespace-only changes.

testsuite/manualmode/src/test/resources/org/jboss/as/test/manualmode/installationmanager/test-repo-two/dummy_file_two.txt

Whitespace-only changes.

testsuite/manualmode/src/test/resources/org/jboss/as/test/manualmode/installationmanager/test-repo-two/maven-repository/artifact-two

Whitespace-only changes.

0 commit comments

Comments
 (0)