⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 xmlconfigurationproviderglobalresultinheritencetest.java

📁 在Struts2中的jar包xwork的源代码.版本为2.0.7
💻 JAVA
字号:
package com.opensymphony.xwork2.config.providers;import com.opensymphony.xwork2.config.Configuration;import com.opensymphony.xwork2.config.ConfigurationManager;import com.opensymphony.xwork2.config.ConfigurationProvider;import com.opensymphony.xwork2.config.entities.ActionConfig;import com.opensymphony.xwork2.config.entities.ResultConfig;/** * <code>XmlConfigurationProviderGlobalResultInheritenceTest</code> * * @author <a href="mailto:hermanns@aixcept.de">Rainer Hermanns</a> * @author tm_jee * @version $Id: XmlConfigurationProviderGlobalResultInheritenceTest.java,v 1.1.2.1 2006/06/26 21:00:10 rainerh Exp $ */public class XmlConfigurationProviderGlobalResultInheritenceTest extends ConfigurationTestBase {    public void testGlobalResultInheritenceTest() throws Exception {        ConfigurationProvider provider = buildConfigurationProvider("com/opensymphony/xwork2/config/providers/xwork-test-global-result-inheritence.xml");        ConfigurationManager configurationManager = new ConfigurationManager();        configurationManager.addConfigurationProvider(provider);        Configuration configuration = configurationManager.getConfiguration();        ActionConfig parentActionConfig = configuration.getRuntimeConfiguration().getActionConfig("/base", "parentAction");        ActionConfig anotherActionConfig = configuration.getRuntimeConfiguration().getActionConfig("/base", "anotherAction");        ActionConfig childActionConfig = configuration.getRuntimeConfiguration().getActionConfig("/base", "childAction");        ResultConfig parentResultConfig1 = (ResultConfig) parentActionConfig.getResults().get("mockResult1");        ResultConfig parentResultConfig2 = (ResultConfig) parentActionConfig.getResults().get("mockResult2");        ResultConfig anotherResultConfig1 = (ResultConfig) anotherActionConfig.getResults().get("mockResult1");        ResultConfig anotherResultConfig2 = (ResultConfig) anotherActionConfig.getResults().get("mockResult2");        ResultConfig childResultConfig1 = (ResultConfig) childActionConfig.getResults().get("mockResult1");        ResultConfig childResultConfig2 = (ResultConfig) childActionConfig.getResults().get("mockResult2");        System.out.println(parentResultConfig1.getParams().get("identity"));        System.out.println(parentResultConfig2.getParams().get("identity"));        System.out.println(anotherResultConfig1.getParams().get("identity"));        System.out.println(anotherResultConfig2.getParams().get("identity"));        System.out.println(childResultConfig1.getParams().get("identity"));        System.out.println(childResultConfig2.getParams().get("identity"));        assertFalse(parentResultConfig1 == anotherResultConfig1);        assertFalse(parentResultConfig2 == anotherResultConfig2);        assertFalse(parentResultConfig1 == childResultConfig1);        assertTrue(parentResultConfig2 == childResultConfig2);    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -