diff --git a/domain-http/interface/pom.xml b/domain-http/interface/pom.xml
index 46e16e1f49fd..a616facbe068 100644
--- a/domain-http/interface/pom.xml
+++ b/domain-http/interface/pom.xml
@@ -95,5 +95,10 @@
org.jboss.sasl
jboss-sasl
+
+ junit
+ junit
+ test
+
diff --git a/domain-http/interface/src/main/java/org/jboss/as/domain/http/server/ConsoleMode.java b/domain-http/interface/src/main/java/org/jboss/as/domain/http/server/ConsoleMode.java
index dd2c814e4f58..685243c63ad7 100644
--- a/domain-http/interface/src/main/java/org/jboss/as/domain/http/server/ConsoleMode.java
+++ b/domain-http/interface/src/main/java/org/jboss/as/domain/http/server/ConsoleMode.java
@@ -22,7 +22,6 @@
package org.jboss.as.domain.http.server;
import java.io.File;
-import java.util.HashSet;
import java.util.Set;
import java.util.SortedSet;
import java.util.TreeSet;
@@ -31,7 +30,9 @@
import org.jboss.as.domain.management.SecurityRealm;
import org.jboss.com.sun.net.httpserver.HttpContext;
import org.jboss.com.sun.net.httpserver.HttpServer;
+import org.jboss.modules.Module;
import org.jboss.modules.ModuleLoadException;
+import org.jboss.modules.ModuleLoader;
/**
* Different modes for showing the admin console
@@ -116,7 +117,7 @@ public boolean hasConsole() {
*
* @author Darran Lofthouse
*/
- private static class ConsoleHandler extends ResourceHandler {
+ static class ConsoleHandler extends ResourceHandler {
private static final String NOCACHE_JS = ".nocache.js";
private static final String INDEX_HTML = "index.html";
@@ -127,7 +128,7 @@ private static class ConsoleHandler extends ResourceHandler {
private static final String DEFAULT_RESOURCE = "/" + INDEX_HTML;
ConsoleHandler(String skin) throws ModuleLoadException {
- super(CONTEXT, DEFAULT_RESOURCE, findConsoleClassLoader(skin));
+ super(CONTEXT, DEFAULT_RESOURCE, findConsoleClassLoader(Module.getCallerModuleLoader(), skin));
}
@Override
@@ -149,14 +150,14 @@ public void start(HttpServer httpServer, SecurityRealm securityRealm) {
}
}
- private static ClassLoader findConsoleClassLoader(String consoleSkin) throws ModuleLoadException {
+ static ClassLoader findConsoleClassLoader(ModuleLoader moduleLoader, String consoleSkin) throws ModuleLoadException {
final String moduleName = CONSOLE_MODULE + "." + (consoleSkin == null ? "main" : consoleSkin);
// Find all console versions on the filesystem, sorted by version
SortedSet consoleVersions = findConsoleVersions(moduleName);
for (ConsoleVersion consoleVersion : consoleVersions) {
try {
- return getClassLoader(moduleName, consoleVersion.getName());
+ return getClassLoader(moduleLoader, moduleName, consoleVersion.getName());
} catch (ModuleLoadException mle) {
// ignore
}
@@ -164,7 +165,7 @@ private static ClassLoader findConsoleClassLoader(String consoleSkin) throws Mod
// No joy. Fall back to the AS 7.1 approach where the module id is org.jboss.as.console:
try {
- return getClassLoader(CONSOLE_MODULE, consoleSkin);
+ return getClassLoader(moduleLoader, CONSOLE_MODULE, consoleSkin);
} catch (ModuleLoadException mle) {
// ignore
}
@@ -184,7 +185,7 @@ static class DisabledConsoleHandler extends ResourceHandler {
private static final String NO_CONSOLE_FOR_ADMIN_MODE = "/noConsoleForAdminModeError.html";
private DisabledConsoleHandler(String slot, String resource) throws ModuleLoadException {
- super(CONTEXT, resource, getClassLoader(ERROR_MODULE, slot));
+ super(CONTEXT, resource, getClassLoader(Module.getCallerModuleLoader(), ERROR_MODULE, slot));
}
static DisabledConsoleHandler createNoConsoleForSlave(String slot) throws ModuleLoadException {
diff --git a/domain-http/interface/src/main/java/org/jboss/as/domain/http/server/ErrorHandler.java b/domain-http/interface/src/main/java/org/jboss/as/domain/http/server/ErrorHandler.java
index cb2930e0dada..abf5a6877a7d 100644
--- a/domain-http/interface/src/main/java/org/jboss/as/domain/http/server/ErrorHandler.java
+++ b/domain-http/interface/src/main/java/org/jboss/as/domain/http/server/ErrorHandler.java
@@ -24,6 +24,7 @@
import java.util.Locale;
+import org.jboss.modules.Module;
import org.jboss.modules.ModuleLoadException;
/**
@@ -50,7 +51,7 @@ class ErrorHandler extends ResourceHandler {
}
ErrorHandler(String slot) throws ModuleLoadException {
- super(ERROR_CONTEXT, DEFAULT_RESOURCE, getClassLoader(ERROR_MODULE, slot));
+ super(ERROR_CONTEXT, DEFAULT_RESOURCE, getClassLoader(Module.getCallerModuleLoader(), ERROR_MODULE, slot));
}
@Override
diff --git a/domain-http/interface/src/main/java/org/jboss/as/domain/http/server/ResourceHandler.java b/domain-http/interface/src/main/java/org/jboss/as/domain/http/server/ResourceHandler.java
index bcf48b8f1695..668c6950a0d9 100644
--- a/domain-http/interface/src/main/java/org/jboss/as/domain/http/server/ResourceHandler.java
+++ b/domain-http/interface/src/main/java/org/jboss/as/domain/http/server/ResourceHandler.java
@@ -66,6 +66,7 @@
import org.jboss.modules.Module;
import org.jboss.modules.ModuleIdentifier;
import org.jboss.modules.ModuleLoadException;
+import org.jboss.modules.ModuleLoader;
/**
* A generic handler to server up resources requested using a GET request.
@@ -321,9 +322,9 @@ public void stop(HttpServer httpServer) {
httpServer.removeContext(context);
}
- protected static ClassLoader getClassLoader(final String module, final String slot) throws ModuleLoadException {
+ protected static ClassLoader getClassLoader(final ModuleLoader moduleLoader, final String module, final String slot) throws ModuleLoadException {
ModuleIdentifier id = ModuleIdentifier.create(module, slot);
- ClassLoader cl = Module.getCallerModuleLoader().loadModule(id).getClassLoader();
+ ClassLoader cl = moduleLoader.loadModule(id).getClassLoader();
return cl;
}
diff --git a/domain-http/interface/src/test/java/org/jboss/as/domain/http/server/ConsoleModeTestCase.java b/domain-http/interface/src/test/java/org/jboss/as/domain/http/server/ConsoleModeTestCase.java
new file mode 100644
index 000000000000..2d8acba56f21
--- /dev/null
+++ b/domain-http/interface/src/test/java/org/jboss/as/domain/http/server/ConsoleModeTestCase.java
@@ -0,0 +1,133 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2013, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.as.domain.http.server;
+
+import static junit.framework.Assert.assertEquals;
+import static junit.framework.Assert.assertNotNull;
+import static junit.framework.Assert.assertTrue;
+
+import java.io.File;
+
+import org.jboss.modules.LocalModuleLoader;
+import org.jboss.modules.ModuleClassLoader;
+import org.jboss.modules.ModuleIdentifier;
+import org.jboss.modules.ModuleLoader;
+import org.junit.Test;
+
+
+/**
+ *
+ * @author Kabir Khan
+ */
+public class ConsoleModeTestCase {
+
+
+ @Test
+ public void testDefaultModules() throws Exception {
+ checkModule(null, ModuleIdentifier.create("org.jboss.as.console"), "modules-default");
+ }
+
+
+ @Test
+ public void testVersionedNoSlot() throws Exception {
+ checkModule(null, ModuleIdentifier.create("org.jboss.as.console.main", "1.2.1"), "modules-versioned");
+ }
+
+ @Test
+ public void testVersionedAndMainSlot() throws Exception {
+ checkModule("main", ModuleIdentifier.create("org.jboss.as.console.main", "1.2.1"), "modules-versioned");
+ }
+
+ @Test
+ public void testVersionedLayersNoSlot() throws Exception {
+ checkModule(null, ModuleIdentifier.create("org.jboss.as.console.main", "1.2.1"), "modules-base-and-layer1");
+ }
+
+ @Test
+ public void testVersionedLayersAndMainSlot() throws Exception {
+ checkModule("main", ModuleIdentifier.create("org.jboss.as.console.main", "1.2.1"), "modules-base-and-layer1");
+ }
+
+ @Test
+ public void testSeveralRootsVersionedLayersNoSlot() throws Exception {
+ checkModule(null, ModuleIdentifier.create("org.jboss.as.console.main", "3.0.0"), "modules-base-and-layer1", "modules-layer2");
+ }
+
+ @Test
+ public void testSeveralRootsVersionedLayersAndMainSlot() throws Exception {
+ checkModule("main", ModuleIdentifier.create("org.jboss.as.console.main", "3.0.0"), "modules-base-and-layer1", "modules-layer2");
+ }
+
+ @Test
+ public void testSeveralRootsDifferentOrderVersionedLayersNoSlot() throws Exception {
+ checkModule(null, ModuleIdentifier.create("org.jboss.as.console.main", "3.0.0"), "modules-layer2", "modules-base-and-layer1");
+ }
+
+ @Test
+ public void testSeveralRootsDifferentOrderVersionedLayersAndMainSlot() throws Exception {
+ checkModule("main", ModuleIdentifier.create("org.jboss.as.console.main", "3.0.0"), "modules-layer2", "modules-base-and-layer1");
+ }
+
+ @Test
+ public void testAddonsAndLayersAddon1WinsNoSlot() throws Exception {
+ checkModule(null, ModuleIdentifier.create("org.jboss.as.console.main", "2.0.0"), "modules-base-and-layer1", "modules-addons1");
+ }
+
+ @Test
+ public void testAddonsAndLayersLayer2WinsNoSlot() throws Exception {
+ checkModule(null, ModuleIdentifier.create("org.jboss.as.console.main", "3.0.0"), "modules-base-and-layer1", "modules-layer2", "modules-addons1");
+ }
+
+ @Test
+ public void testAddonsAndLayersAddon2WinsNoSlot() throws Exception {
+ checkModule(null, ModuleIdentifier.create("org.jboss.as.console.main", "4.0.0"), "modules-base-and-layer1", "modules-layer2", "modules-addons1", "modules-addons2");
+ }
+
+ @Test
+ public void testAddonsOnly() throws Exception {
+ checkModule(null, ModuleIdentifier.create("org.jboss.as.console.main", "4.0.0"), "modules-addons1", "modules-addons2");
+ }
+
+ private void checkModule(String slot, ModuleIdentifier expected, String...moduleDirNames) throws Exception {
+ ModuleLoader loader = createModuleLoader(moduleDirNames);
+ ClassLoader classLoader = ConsoleMode.ConsoleHandler.findConsoleClassLoader(loader, slot);
+ assertNotNull(classLoader);
+ assertTrue(classLoader instanceof ModuleClassLoader);
+ ModuleClassLoader moduleClassLoader = (ModuleClassLoader)classLoader;
+ assertEquals(expected, moduleClassLoader.getModule().getIdentifier());
+ }
+
+ private ModuleLoader createModuleLoader(String...moduleDirNames) {
+ StringBuilder sb = new StringBuilder();
+ for (String moduleDirName : moduleDirNames) {
+ File file = new File("target/test-classes", moduleDirName);
+ assertTrue(file.exists());
+ if (sb.length() > 0) {
+ sb.append(File.pathSeparatorChar);
+ }
+ sb.append(file.getAbsolutePath());
+ }
+ System.setProperty("module.path", sb.toString());
+ LocalModuleLoader loader = new LocalModuleLoader();
+ return loader;
+ }
+}
diff --git a/domain-http/interface/src/test/java/org/jboss/as/domain/http/server/ConsoleVersionTestCase.java b/domain-http/interface/src/test/java/org/jboss/as/domain/http/server/ConsoleVersionTestCase.java
new file mode 100644
index 000000000000..9564eaae8de3
--- /dev/null
+++ b/domain-http/interface/src/test/java/org/jboss/as/domain/http/server/ConsoleVersionTestCase.java
@@ -0,0 +1,109 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2013, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.as.domain.http.server;
+
+import static junit.framework.Assert.assertTrue;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.TreeSet;
+
+import junit.framework.Assert;
+
+import org.junit.Test;
+
+/**
+ *
+ * @author Kabir Khan
+ */
+public class ConsoleVersionTestCase {
+
+ @Test
+ public void testSortConsoleVersions() {
+ ConsoleVersion versionMain = new ConsoleVersion("main");
+ ConsoleVersion version001 = new ConsoleVersion("0.0.1");
+ ConsoleVersion version002 = new ConsoleVersion("0.0.2");
+ ConsoleVersion version010 = new ConsoleVersion("0.1.0");
+ ConsoleVersion version020 = new ConsoleVersion("0.2.0");
+ ConsoleVersion version100 = new ConsoleVersion("1.0.0");
+ ConsoleVersion version101 = new ConsoleVersion("1.0.1");
+ ConsoleVersion version102 = new ConsoleVersion("1.0.2");
+ ConsoleVersion version110 = new ConsoleVersion("1.1.0");
+ ConsoleVersion version111 = new ConsoleVersion("1.1.1");
+ ConsoleVersion version120 = new ConsoleVersion("1.2.0");
+ ConsoleVersion version122 = new ConsoleVersion("1.2.2");
+ ConsoleVersion version200 = new ConsoleVersion("2.0.0");
+ ConsoleVersion version201 = new ConsoleVersion("2.0.1");
+ ConsoleVersion version210 = new ConsoleVersion("2.1.0");
+
+ TreeSet set = new TreeSet();
+ set.add(versionMain);
+ set.add(version001);
+ set.add(version002);
+ set.add(version010);
+ set.add(version020);
+ set.add(version100);
+ set.add(version101);
+ set.add(version102);
+ set.add(version110);
+ set.add(version111);
+ set.add(version120);
+ set.add(version122);
+ set.add(version200);
+ set.add(version201);
+ set.add(version210);
+
+ Iterator it = set.iterator();
+ Assert.assertEquals(version210, it.next());
+ Assert.assertEquals(version201, it.next());
+ Assert.assertEquals(version200, it.next());
+ Assert.assertEquals(version122, it.next());
+ Assert.assertEquals(version120, it.next());
+ Assert.assertEquals(version111, it.next());
+ Assert.assertEquals(version110, it.next());
+ Assert.assertEquals(version102, it.next());
+ Assert.assertEquals(version101, it.next());
+ Assert.assertEquals(version100, it.next());
+ Assert.assertEquals(version020, it.next());
+ Assert.assertEquals(version010, it.next());
+ Assert.assertEquals(version002, it.next());
+ Assert.assertEquals(version001, it.next());
+ Assert.assertEquals(versionMain, it.next());
+ Assert.assertFalse(it.hasNext());
+
+ ArrayList list = new ArrayList(set);
+ for (int i = 1 ; i < list.size() - 1; i++) {
+ final ConsoleVersion current = list.get(i);
+ for (int j = 0 ; j < i ; j++) {
+ final ConsoleVersion higher = list.get(j);
+ assertTrue(higher.compareTo(current) < 0);
+ assertTrue(current.compareTo(higher) > 0);
+ }
+
+ for (int j = i + 1 ; j < list.size() ; j++) {
+ final ConsoleVersion lower = list.get(j);
+ assertTrue(current.compareTo(lower) < 0);
+ assertTrue(lower.compareTo(current) > 0);
+ }
+ }
+ }
+}
diff --git a/domain-http/interface/src/test/resources/modules-addons1/system/add-ons/add-on1/org/jboss/as/console/main/2.0.0/module.xml b/domain-http/interface/src/test/resources/modules-addons1/system/add-ons/add-on1/org/jboss/as/console/main/2.0.0/module.xml
new file mode 100644
index 000000000000..5bcbd47124d4
--- /dev/null
+++ b/domain-http/interface/src/test/resources/modules-addons1/system/add-ons/add-on1/org/jboss/as/console/main/2.0.0/module.xml
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/domain-http/interface/src/test/resources/modules-addons1/system/add-ons/add-on1/org/jboss/as/console/main/module.xml b/domain-http/interface/src/test/resources/modules-addons1/system/add-ons/add-on1/org/jboss/as/console/main/module.xml
new file mode 100644
index 000000000000..159773a6a2f8
--- /dev/null
+++ b/domain-http/interface/src/test/resources/modules-addons1/system/add-ons/add-on1/org/jboss/as/console/main/module.xml
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/domain-http/interface/src/test/resources/modules-addons1/system/layers/base/marker.txt b/domain-http/interface/src/test/resources/modules-addons1/system/layers/base/marker.txt
new file mode 100644
index 000000000000..30eca44163b2
--- /dev/null
+++ b/domain-http/interface/src/test/resources/modules-addons1/system/layers/base/marker.txt
@@ -0,0 +1 @@
+This is needed since the layer fails to initialize if there is no 'base' directory
\ No newline at end of file
diff --git a/domain-http/interface/src/test/resources/modules-addons2/system/add-ons/add-on1/org/jboss/as/console/main/4.0.0/module.xml b/domain-http/interface/src/test/resources/modules-addons2/system/add-ons/add-on1/org/jboss/as/console/main/4.0.0/module.xml
new file mode 100644
index 000000000000..2adce6d9dbc7
--- /dev/null
+++ b/domain-http/interface/src/test/resources/modules-addons2/system/add-ons/add-on1/org/jboss/as/console/main/4.0.0/module.xml
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/domain-http/interface/src/test/resources/modules-addons2/system/add-ons/add-on1/org/jboss/as/console/main/module.xml b/domain-http/interface/src/test/resources/modules-addons2/system/add-ons/add-on1/org/jboss/as/console/main/module.xml
new file mode 100644
index 000000000000..159773a6a2f8
--- /dev/null
+++ b/domain-http/interface/src/test/resources/modules-addons2/system/add-ons/add-on1/org/jboss/as/console/main/module.xml
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/domain-http/interface/src/test/resources/modules-addons2/system/layers/base/marker.txt b/domain-http/interface/src/test/resources/modules-addons2/system/layers/base/marker.txt
new file mode 100644
index 000000000000..30eca44163b2
--- /dev/null
+++ b/domain-http/interface/src/test/resources/modules-addons2/system/layers/base/marker.txt
@@ -0,0 +1 @@
+This is needed since the layer fails to initialize if there is no 'base' directory
\ No newline at end of file
diff --git a/domain-http/interface/src/test/resources/modules-base-and-layer1/layers.conf b/domain-http/interface/src/test/resources/modules-base-and-layer1/layers.conf
new file mode 100644
index 000000000000..da77fb261179
--- /dev/null
+++ b/domain-http/interface/src/test/resources/modules-base-and-layer1/layers.conf
@@ -0,0 +1 @@
+layers=layer1,base
\ No newline at end of file
diff --git a/domain-http/interface/src/test/resources/modules-base-and-layer1/system/layers/base/org/jboss/as/console/main/1.0.0/module.xml b/domain-http/interface/src/test/resources/modules-base-and-layer1/system/layers/base/org/jboss/as/console/main/1.0.0/module.xml
new file mode 100644
index 000000000000..b1ac7fcb353c
--- /dev/null
+++ b/domain-http/interface/src/test/resources/modules-base-and-layer1/system/layers/base/org/jboss/as/console/main/1.0.0/module.xml
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/domain-http/interface/src/test/resources/modules-base-and-layer1/system/layers/base/org/jboss/as/console/main/module.xml b/domain-http/interface/src/test/resources/modules-base-and-layer1/system/layers/base/org/jboss/as/console/main/module.xml
new file mode 100644
index 000000000000..159773a6a2f8
--- /dev/null
+++ b/domain-http/interface/src/test/resources/modules-base-and-layer1/system/layers/base/org/jboss/as/console/main/module.xml
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/domain-http/interface/src/test/resources/modules-base-and-layer1/system/layers/layer1/org/jboss/as/console/main/1.0.0/module.xml b/domain-http/interface/src/test/resources/modules-base-and-layer1/system/layers/layer1/org/jboss/as/console/main/1.0.0/module.xml
new file mode 100644
index 000000000000..b1ac7fcb353c
--- /dev/null
+++ b/domain-http/interface/src/test/resources/modules-base-and-layer1/system/layers/layer1/org/jboss/as/console/main/1.0.0/module.xml
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/domain-http/interface/src/test/resources/modules-base-and-layer1/system/layers/layer1/org/jboss/as/console/main/1.2.1/module.xml b/domain-http/interface/src/test/resources/modules-base-and-layer1/system/layers/layer1/org/jboss/as/console/main/1.2.1/module.xml
new file mode 100644
index 000000000000..b339d82f9082
--- /dev/null
+++ b/domain-http/interface/src/test/resources/modules-base-and-layer1/system/layers/layer1/org/jboss/as/console/main/1.2.1/module.xml
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/domain-http/interface/src/test/resources/modules-base-and-layer1/system/layers/layer1/org/jboss/as/console/main/module.xml b/domain-http/interface/src/test/resources/modules-base-and-layer1/system/layers/layer1/org/jboss/as/console/main/module.xml
new file mode 100644
index 000000000000..159773a6a2f8
--- /dev/null
+++ b/domain-http/interface/src/test/resources/modules-base-and-layer1/system/layers/layer1/org/jboss/as/console/main/module.xml
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/domain-http/interface/src/test/resources/modules-default/system/layers/base/org/jboss/as/console/main/module.xml b/domain-http/interface/src/test/resources/modules-default/system/layers/base/org/jboss/as/console/main/module.xml
new file mode 100644
index 000000000000..159773a6a2f8
--- /dev/null
+++ b/domain-http/interface/src/test/resources/modules-default/system/layers/base/org/jboss/as/console/main/module.xml
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/domain-http/interface/src/test/resources/modules-layer2/layers.conf b/domain-http/interface/src/test/resources/modules-layer2/layers.conf
new file mode 100644
index 000000000000..44cc22648d21
--- /dev/null
+++ b/domain-http/interface/src/test/resources/modules-layer2/layers.conf
@@ -0,0 +1 @@
+layers=layer2
\ No newline at end of file
diff --git a/domain-http/interface/src/test/resources/modules-layer2/system/layers/base/marker.txt b/domain-http/interface/src/test/resources/modules-layer2/system/layers/base/marker.txt
new file mode 100644
index 000000000000..30eca44163b2
--- /dev/null
+++ b/domain-http/interface/src/test/resources/modules-layer2/system/layers/base/marker.txt
@@ -0,0 +1 @@
+This is needed since the layer fails to initialize if there is no 'base' directory
\ No newline at end of file
diff --git a/domain-http/interface/src/test/resources/modules-layer2/system/layers/layer2/org/jboss/as/console/main/3.0.0/module.xml b/domain-http/interface/src/test/resources/modules-layer2/system/layers/layer2/org/jboss/as/console/main/3.0.0/module.xml
new file mode 100644
index 000000000000..b1fa8572a10f
--- /dev/null
+++ b/domain-http/interface/src/test/resources/modules-layer2/system/layers/layer2/org/jboss/as/console/main/3.0.0/module.xml
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/domain-http/interface/src/test/resources/modules-layer2/system/layers/layer2/org/jboss/as/console/main/module.xml b/domain-http/interface/src/test/resources/modules-layer2/system/layers/layer2/org/jboss/as/console/main/module.xml
new file mode 100644
index 000000000000..159773a6a2f8
--- /dev/null
+++ b/domain-http/interface/src/test/resources/modules-layer2/system/layers/layer2/org/jboss/as/console/main/module.xml
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/domain-http/interface/src/test/resources/modules-versioned/system/layers/base/org/jboss/as/console/main/1.0.0/module.xml b/domain-http/interface/src/test/resources/modules-versioned/system/layers/base/org/jboss/as/console/main/1.0.0/module.xml
new file mode 100644
index 000000000000..b1ac7fcb353c
--- /dev/null
+++ b/domain-http/interface/src/test/resources/modules-versioned/system/layers/base/org/jboss/as/console/main/1.0.0/module.xml
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/domain-http/interface/src/test/resources/modules-versioned/system/layers/base/org/jboss/as/console/main/1.2.1/module.xml b/domain-http/interface/src/test/resources/modules-versioned/system/layers/base/org/jboss/as/console/main/1.2.1/module.xml
new file mode 100644
index 000000000000..b339d82f9082
--- /dev/null
+++ b/domain-http/interface/src/test/resources/modules-versioned/system/layers/base/org/jboss/as/console/main/1.2.1/module.xml
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/domain-http/interface/src/test/resources/modules-versioned/system/layers/base/org/jboss/as/console/main/module.xml b/domain-http/interface/src/test/resources/modules-versioned/system/layers/base/org/jboss/as/console/main/module.xml
new file mode 100644
index 000000000000..159773a6a2f8
--- /dev/null
+++ b/domain-http/interface/src/test/resources/modules-versioned/system/layers/base/org/jboss/as/console/main/module.xml
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+