protected boolean isDebugMode() { if (this.isDebugMode == null) { Boolean debugValue = false; if (configService != null) { Config global = configService.getGlobalConfig(); if (global != null) { ConfigElement flags = global.getConfigElement("flags"); if (flags != null) { ConfigElement clientDebug = flags.getChild("client-debug"); if (clientDebug != null) { debugValue = Boolean.valueOf(clientDebug.getValue()); } } } } this.isDebugMode = debugValue; } return this.isDebugMode; }
ConfigElement userMappings = params.getChild("userMappings"); if ( userMappings != null)
ConfigElement childTwo = children.getChild("child-two"); assertNotNull("Child two config element should not be null", childTwo); assertEquals("Child two value should be 'child two value'", "child two value", ConfigElement noChild = children.getChild("not-there"); assertNull("The noChild config element should be null", noChild); ConfigElement childThree = children.getChild("child-three"); assertNotNull("Child three config element should not be null", childThree); ConfigElement grandKids = childThree.getChild("grand-children"); assertNotNull("Grand child config element should not be null", grandKids); assertEquals("There should be 2 grand child config elements", 2, grandKids.getChildCount()); ConfigElement grandKidOne = grandKids.getChild("grand-child-one"); assertNotNull("Grand child one config element should not be null", grandKidOne); assertEquals("The number of attributes for grand child one should be 1",
ConfigElement userMappings = params.getChild("userMappings"); if ( userMappings != null)
protected boolean isDebugMode() { if (this.isDebugMode == null) { Boolean debugValue = false; if (configService != null) { Config global = configService.getGlobalConfig(); if (global != null) { ConfigElement flags = global.getConfigElement("flags"); if (flags != null) { ConfigElement clientDebug = flags.getChild("client-debug"); if (clientDebug != null) { debugValue = Boolean.valueOf(clientDebug.getValue()); } } } } this.isDebugMode = debugValue; } return this.isDebugMode; }
protected boolean isDebugMode() { if (this.isDebugMode == null) { Boolean debugValue = false; if (configService != null) { Config global = configService.getGlobalConfig(); if (global != null) { ConfigElement flags = global.getConfigElement("flags"); if (flags != null) { ConfigElement clientDebug = flags.getChild("client-debug"); if (clientDebug != null) { debugValue = Boolean.valueOf(clientDebug.getValue()); } } } } this.isDebugMode = debugValue; } return this.isDebugMode; }
protected boolean isDebugMode() { if (this.isDebugMode == null) { Boolean debugValue = false; if (configService != null) { Config global = configService.getGlobalConfig(); if (global != null) { ConfigElement flags = global.getConfigElement("flags"); if (flags != null) { ConfigElement clientDebug = flags.getChild("client-debug"); if (clientDebug != null) { debugValue = Boolean.valueOf(clientDebug.getValue()); } } } } this.isDebugMode = debugValue; } return this.isDebugMode; }
ConfigElement storeElement = cfg.getChild(KEY_STORE); if (storeElement == null || storeElement.getValue() == null || storeElement.getValue().length() == 0) ConfigElement rootPathElement = cfg.getChild(KEY_ROOT_PATH); if (rootPathElement == null || rootPathElement.getValue() == null || rootPathElement.getValue().length() == 0) ConfigElement relativePathElement = cfg.getChild(KEY_RELATIVE_PATH); ConfigElement urlFileElem = cfg.getChild( "urlFile"); if ( urlFileElem != null) ConfigElement pseudoName = urlFileElem.getChild( "filename"); ConfigElement offlineFiles = cfg.getChild( "offlineFiles"); if ( offlineFiles != null) if ( cfg.getChild("disableNodeMonitor") == null) { if ( cfg.getChild("disableOplocks") != null) { context.setDisableOplocks( true);
ConfigElement storeElement = cfg.getChild(KEY_STORE); if (storeElement == null || storeElement.getValue() == null || storeElement.getValue().length() == 0) ConfigElement rootPathElement = cfg.getChild(KEY_ROOT_PATH); if (rootPathElement == null || rootPathElement.getValue() == null || rootPathElement.getValue().length() == 0) ConfigElement relativePathElement = cfg.getChild(KEY_RELATIVE_PATH); ConfigElement urlFileElem = cfg.getChild( "urlFile"); if ( urlFileElem != null) ConfigElement pseudoName = urlFileElem.getChild( "filename"); ConfigElement offlineFiles = cfg.getChild( "offlineFiles"); if ( offlineFiles != null) if ( cfg.getChild("disableNodeMonitor") == null) { if ( cfg.getChild("disableOplocks") != null) { context.setDisableOplocks( true);
ConfigElement fromAddressElem = clientElem.getChild("from-email-address"); assertNotNull(fromAddressElem); String fromAddress = fromAddressElem.getValue();
/** * Tests loading config from a known JAR file */ public void testJarSource() { String resDir = this.getResourcesDir(); String jarFile = "jar:file:" + resDir + "custom-config.jar!/META-INF/web-client-config-custom.xml"; JarConfigSource source = new JarConfigSource(jarFile); XMLConfigService svc = new XMLConfigService(source); svc.initConfig(); // make sure the global config is present Config config = svc.getGlobalConfig(); assertNotNull(config); // make sure the from address is present and correct ConfigElement clientElem = config.getConfigElement("client"); assertNotNull(clientElem); ConfigElement fromAddressElem = clientElem.getChild("from-email-address"); assertNotNull(fromAddressElem); String fromAddress = fromAddressElem.getValue(); assertEquals("From address should be 'me@somewhere.net'", "me@somewhere.net", fromAddress); }