*/
protected void setUp() throws Exception {
super.setUp();
registry = new StoreRegistry();
desc = new StoreDescription();
desc.setTag("Context");
desc.setTagClass("org.apache.catalina.core.StandardContext");
desc.setStandard(true);
desc
.setStoreFactoryClass("org.apache.catalina.storeconfig.StandardContextSF");
String exceptions[] = { "available", "configFile", "configured",
"distributable", "domain", "engineName", "name", "override",
"publicId", "replaceWelcomeFiles", "sessionTimeout",
"startupTime", "tldScanTime" };
for (int i = 0; i < exceptions.length; i++)
desc.addTransientAttribute(exceptions[i]);
registry.registerDescription(desc);
factory = new StandardContextSF();
desc.setStoreFactory(factory);
factory.setRegistry(registry);
StoreDescription listenerdesc = registerDescriptor("Listener",
LifecycleListener.class);
String listenerskippables[] = {
"org.apache.catalina.core.NamingContextListener",
"org.apache.catalina.startup.ContextConfig", };
for (int i = 0; i < listenerskippables.length; i++)
listenerdesc.addTransientChild(listenerskippables[i]);
StoreDescription realmdesc = registerDescriptor("Realm",
JAASRealm.class,
"org.apache.catalina.storeconfig.StoreFactoryBase", false,
false);
StoreDescription managerdesc = registerDescriptor("Manager",
StandardManager.class,
"org.apache.catalina.storeconfig.ManagerSF", false, false);
managerdesc.addTransientAttribute("entropy");
managerdesc.addTransientAttribute("distributable");
StoreDescription pmanagerdesc = registerDescriptor("Manager",
PersistentManager.class,
"org.apache.catalina.storeconfig.PersistentManagerSF", false,
false);
pmanagerdesc.addTransientAttribute("entropy");
pmanagerdesc.addTransientAttribute("distributable");
DescriptorHelper.registerDescriptor(pmanagerdesc, registry,
FileStore.class.getName(), "Store", FileStore.class.getName(),
"org.apache.catalina.storeconfig.StoreFactoryBase", false,
false);
DescriptorHelper.registerDescriptor(pmanagerdesc, registry,
JDBCStore.class.getName(), "Store", JDBCStore.class.getName(),
"org.apache.catalina.storeconfig.StoreFactoryBase", false,
false);
DescriptorHelper.registerNamingDescriptor(desc, registry);
StoreDescription valvedesc = registerDescriptor("Valve", Valve.class,
"org.apache.catalina.storeconfig.StoreFactoryBase", false,
false);
String skippables[] = {
"org.apache.catalina.authenticator.BasicAuthenticator",
"org.apache.catalina.authenticator.DigestAuthenticator",
"org.apache.catalina.authenticator.FormAuthenticator",
"org.apache.catalina.authenticator.NonLoginAuthenticator",
"org.apache.catalina.authenticator.SSLAuthenticator",
"org.apache.catalina.core.StandardContextValve",
"org.apache.catalina.valves.CertificatesValve" };
for (int i = 0; i < skippables.length; i++)
valvedesc.addTransientChild(skippables[i]);
StoreDescription resdesc = registerDescriptor("Resources",
DirContext.class,
"org.apache.catalina.storeconfig.StoreFactoryBase", false,
false);
resdesc.addTransientAttribute("docBase");
resdesc.addTransientAttribute("allowLinking");
resdesc.addTransientAttribute("cacheMaxSize");
resdesc.addTransientAttribute("cacheTTL");
resdesc.addTransientAttribute("caseSensitive");
resdesc.addTransientChild(FileDirContext.class.getName());
resdesc.addTransientChild(ProxyDirContext.class.getName());
resdesc.addTransientChild(WARDirContext.class.getName());
standardContext = new StandardContext();
standardContext.setPath("/myapps");
standardContext.setDocBase("myapps");
}