Skip to content

Commit

Permalink
Merge pull request #6322 from soul2zimate/WFCORE-7135-main
Browse files Browse the repository at this point in the history
[WFCORE-7135] Remove ModuleIdentifier use in the testsuite
  • Loading branch information
bstansberry authored Jan 17, 2025
2 parents 7485f9c + 97aa9ff commit 18f5412
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import org.jboss.byteman.rule.helper.Helper;
import org.jboss.modules.Module;
import org.jboss.modules.ModuleClassLoader;
import org.jboss.modules.ModuleIdentifier;
import org.jboss.modules.ModuleLoader;

/**
Expand Down Expand Up @@ -64,7 +63,7 @@ private void executeOperation(Object deploymentOperations, String operation) thr
Field instance = defaultBootModuleLoaderHolder.getDeclaredField("INSTANCE");
instance.setAccessible(true);
ModuleLoader loader = (ModuleLoader) instance.get(null);
Module module = loader.loadModule(ModuleIdentifier.fromString("org.jboss.as.deployment-scanner"));
Module module = loader.loadModule("org.jboss.as.deployment-scanner");
traceln("ServerLoaderhelper", "Module " + module.toString() + " loaded.");
ModuleClassLoader cl = module.getClassLoader();
Class modelNodeClass = cl.loadClassLocal("org.jboss.dmr.ModelNode");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

package org.wildfly.core.test.standalone.mgmt.api.core;

import org.jboss.as.controller.ModuleIdentifierUtil;
import org.jboss.as.controller.PathAddress;
import org.jboss.as.controller.PathElement;
import org.jboss.as.controller.operations.common.Util;
Expand All @@ -13,7 +14,6 @@
import org.jboss.modules.LocalModuleLoader;
import org.jboss.modules.Module;
import org.jboss.modules.ModuleDependencySpec;
import org.jboss.modules.ModuleIdentifier;
import org.jboss.modules.ModuleLoadException;
import org.junit.Assert;
import org.junit.Test;
Expand Down Expand Up @@ -101,7 +101,7 @@ public void testModuleInfo() throws Exception {
}*/

// load module.xml
ModuleIdentifier identifier = ModuleIdentifier.fromString(TARGET_MODULE_NAME + ":main");
String identifier = ModuleIdentifierUtil.canonicalModuleIdentifier(TARGET_MODULE_NAME + ":main");
Module module = loadModule(identifier);

// run module-info operation
Expand Down Expand Up @@ -147,7 +147,7 @@ public void testModuleInfo() throws Exception {
Assert.assertTrue(module.getClassLoader().getLocalPaths().containsAll(paths));
}

private Module loadModule(ModuleIdentifier identifier) throws IOException, ModuleLoadException {
private Module loadModule(String identifier) throws IOException, ModuleLoadException {
File[] roots = new File[]{new File(LAYERS_BASE)};
LocalModuleLoader moduleLoader = new LocalModuleLoader(roots);
return moduleLoader.loadModule(identifier);
Expand Down

0 comments on commit 18f5412

Please sign in to comment.