outputPath.mkdirs();
File path = new File(BASEDIR, "src/test/resources/deployables/" + warName);
File dest = new File(BASEDIR, "target/test-resources/deployables/" + warName + "/war");
recursiveCopy(path, dest);
UnpackedJarFile jarFile = new UnpackedJarFile(path);
Module module = builder.createModule(null, jarFile, kernel.getNaming(), new ModuleIDBuilder());
Repository repository = null;
AbstractName moduleName = module.getModuleName();
EARContext earContext = createEARContext(outputPath, defaultEnvironment, repository, configStore, moduleName);
AbstractName jaccBeanName = kernel.getNaming().createChildName(moduleName, "foo", NameFactory.JACC_MANAGER);
GBeanData jaccBeanData = new GBeanData(jaccBeanName, ApplicationPolicyConfigurationManager.GBEAN_INFO);
PermissionCollection excludedPermissions= new Permissions();
PermissionCollection uncheckedPermissions= new Permissions();
ComponentPermissions componentPermissions = new ComponentPermissions(excludedPermissions, uncheckedPermissions, new HashMap());
Map contextIDToPermissionsMap = new HashMap();
contextIDToPermissionsMap.put("test_J2EEApplication=null_J2EEServer=bar_j2eeType=WebModule_name=geronimo/test/1.0/war", componentPermissions);
jaccBeanData.setAttribute("contextIdToPermissionsMap", contextIDToPermissionsMap);
// jaccBeanData.setAttribute("principalRoleMap", new HashMap());
jaccBeanData.setAttribute("roleDesignates", new HashMap());
earContext.addGBean(jaccBeanData);
earContext.setJaccManagerName(jaccBeanName);
module.setEarContext(earContext);
module.setRootEarContext(earContext);
builder.initContext(earContext, module, cl);
builder.addGBeans(earContext, module, cl, null);
ConfigurationData configurationData = earContext.getConfigurationData();
earContext.close();
module.close();
Artifact configurationId = configurationData.getId();
configurationManager.loadConfiguration(configurationData);
Configuration configuration = configurationManager.getConfiguration(configurationId);
configurationManager.startConfiguration(configurationId);