/** * Sets the specified <code>DataSource</code>. * You can use this method, if your action calls * <code>Action.getDataSource(HttpServletRequest, String)</code>. * @param key the key of the <code>DataSource</code> * @param dataSource <code>DataSource</code> */ public void setDataSource(String key, DataSource dataSource) { key = key + mockFactory.getMockModuleConfig().getPrefix(); mockFactory.getMockServletContext().setAttribute(key, dataSource); }
/** * Sets the specified <code>ValidatorResources</code>. The easiest * way to create <code>ValidatorResources</code> is the method * {@link #createValidatorResources}. * @param validatorResources the <code>ValidatorResources</code> */ public void setValidatorResources(ValidatorResources validatorResources) { String key = ValidatorPlugIn.VALIDATOR_KEY + mockFactory.getMockModuleConfig().getPrefix(); mockFactory.getMockServletContext().setAttribute(key, validatorResources); }
/** * Sets the specified <code>DataSource</code>. * You can use this method, if your action calls * <code>Action.getDataSource(HttpServletRequest, String)</code>. * @param key the key of the <code>DataSource</code> * @param dataSource <code>DataSource</code> */ public void setDataSource(String key, DataSource dataSource) { key = key + mockFactory.getMockModuleConfig().getPrefix(); mockFactory.getMockServletContext().setAttribute(key, dataSource); }
/** * Sets the specified <code>DataSource</code>. * You can use this method, if your action calls * <code>Action.getDataSource(HttpServletRequest, String)</code>. * @param key the key of the <code>DataSource</code> * @param dataSource <code>DataSource</code> */ public void setDataSource(String key, DataSource dataSource) { key = key + mockFactory.getMockModuleConfig().getPrefix(); mockFactory.getMockServletContext().setAttribute(key, dataSource); }
/** * Sets the specified <code>ValidatorResources</code>. The easiest * way to create <code>ValidatorResources</code> is the method * {@link #createValidatorResources}. * @param validatorResources the <code>ValidatorResources</code> */ public void setValidatorResources(ValidatorResources validatorResources) { String key = ValidatorPlugIn.VALIDATOR_KEY + mockFactory.getMockModuleConfig().getPrefix(); mockFactory.getMockServletContext().setAttribute(key, validatorResources); }
/** * Sets the specified <code>ValidatorResources</code>. The easiest * way to create <code>ValidatorResources</code> is the method * {@link #createValidatorResources}. * @param validatorResources the <code>ValidatorResources</code> */ public void setValidatorResources(ValidatorResources validatorResources) { String key = ValidatorPlugIn.VALIDATOR_KEY + mockFactory.getMockModuleConfig().getPrefix(); mockFactory.getMockServletContext().setAttribute(key, validatorResources); }
/** * Sets the specified messages resources as a servlet context * attribute using the specified key and the module config prefix. * You can use this method, if your action calls * <code>Action.getResources(HttpServletRequest, String)</code>. * Please note that the {@link com.mockrunner.mock.web.MockModuleConfig} * is set by Mockrunner as the current module. It has the name <i>testmodule</i>. * This can be changed with <code>ModuleConfig.setPrefix</code>. * @param key the key of the messages resources * @param resources the messages resources */ public void setResources(String key, MessageResources resources) { MessageResourcesConfig config = new MessageResourcesConfig(); config.setKey(key); mockFactory.getMockModuleConfig().addMessageResourcesConfig(config); key = key + mockFactory.getMockModuleConfig().getPrefix(); mockFactory.getMockServletContext().setAttribute(key, resources); }
/** * Sets the specified messages resources as a servlet context * attribute using the specified key and the module config prefix. * You can use this method, if your action calls * <code>Action.getResources(HttpServletRequest, String)</code>. * Please note that the {@link com.mockrunner.mock.web.MockModuleConfig} * is set by Mockrunner as the current module. It has the name <i>testmodule</i>. * This can be changed with <code>ModuleConfig.setPrefix</code>. * @param key the key of the messages resources * @param resources the messages resources */ public void setResources(String key, MessageResources resources) { MessageResourcesConfig config = new MessageResourcesConfig(); config.setKey(key); mockFactory.getMockModuleConfig().addMessageResourcesConfig(config); key = key + mockFactory.getMockModuleConfig().getPrefix(); mockFactory.getMockServletContext().setAttribute(key, resources); }
/** * Sets the specified messages resources as a servlet context * attribute using the specified key and the module config prefix. * You can use this method, if your action calls * <code>Action.getResources(HttpServletRequest, String)</code>. * Please note that the {@link com.mockrunner.mock.web.MockModuleConfig} * is set by Mockrunner as the current module. It has the name <i>testmodule</i>. * This can be changed with <code>ModuleConfig.setPrefix</code>. * @param key the key of the messages resources * @param resources the messages resources */ public void setResources(String key, MessageResources resources) { MessageResourcesConfig config = new MessageResourcesConfig(); config.setKey(key); mockFactory.getMockModuleConfig().addMessageResourcesConfig(config); key = key + mockFactory.getMockModuleConfig().getPrefix(); mockFactory.getMockServletContext().setAttribute(key, resources); }
try plugIn.init(mockFactory.getMockActionServlet(), mockFactory.getMockModuleConfig()); String key = ValidatorPlugIn.VALIDATOR_KEY + mockFactory.getMockModuleConfig().getPrefix(); return (ValidatorResources)mockFactory.getMockServletContext().getAttribute(key);
try plugIn.init(mockFactory.getMockActionServlet(), mockFactory.getMockModuleConfig()); String key = ValidatorPlugIn.VALIDATOR_KEY + mockFactory.getMockModuleConfig().getPrefix(); return (ValidatorResources)mockFactory.getMockServletContext().getAttribute(key);
try plugIn.init(mockFactory.getMockActionServlet(), mockFactory.getMockModuleConfig()); String key = ValidatorPlugIn.VALIDATOR_KEY + mockFactory.getMockModuleConfig().getPrefix(); return (ValidatorResources)mockFactory.getMockServletContext().getAttribute(key);