Examples of ConfigurationProvider


Examples of com.opensymphony.xwork2.config.ConfigurationProvider

     *
     * @throws Exception
     */
    public void testMultiLevelInheritance() throws Exception {
        final String filename = "com/opensymphony/xwork2/config/providers/xwork-test-multilevel.xml";
        ConfigurationProvider provider = buildConfigurationProvider(filename);
        provider.init(configuration);
        provider.loadPackages();

        /**
         * for this test, we expect the action named, action3, in the namespace, namespace3, to have a single
         * ParameterInterceptor.  The ParameterInterceptor, param, has been defined far up namespace3's parentage ...
         * namespace3 -> namespace2 -> namespace1 -> default
View Full Code Here

Examples of com.opensymphony.xwork2.config.ConfigurationProvider

        if (configProvs != null) {
            String[] classes = configProvs.split("\\s*[,]\\s*");
            for (String cname : classes) {
                try {
                    Class cls = ClassLoaderUtil.loadClass(cname, this.getClass());
                    ConfigurationProvider prov = (ConfigurationProvider)cls.newInstance();
                    configurationManager.addContainerProvider(prov);
                } catch (InstantiationException e) {
                    throw new ConfigurationException("Unable to instantiate provider: "+cname, e);
                } catch (IllegalAccessException e) {
                    throw new ConfigurationException("Unable to access provider: "+cname, e);
View Full Code Here

Examples of com.opensymphony.xwork2.config.ConfigurationProvider

            }
        }
    }

    private void init_FilterInitParameters() {
        configurationManager.addContainerProvider(new ConfigurationProvider() {
            public void destroy() {
            }

            public void init(Configuration configuration) throws ConfigurationException {
            }
View Full Code Here

Examples of com.opensymphony.xwork2.config.ConfigurationProvider

        assertEquals(false, validator.isCaseSensitive());
        assertTrue(Arrays.equals(new String[]{"one", "two", "three"}, validator.getMessageParameters()));
    }

    private AnnotationActionValidatorManager createValidationManager(final Class<? extends ActionSupport> actionClass, Locale locale) throws Exception {
        loadConfigurationProviders(new ConfigurationProvider() {
            public void destroy() {

            }

            public void init(Configuration configuration) throws ConfigurationException {
View Full Code Here

Examples of com.opensymphony.xwork2.config.ConfigurationProvider

    private static void initXWork() {
        String configFilePath = configDir + "/struts.xml";
        File configFile = new File(configFilePath);
        try {
            ConfigurationProvider configProvider = new StrutsXmlConfigurationProvider(configFile.getCanonicalPath(), true, null);
            cm = new ConfigurationManager();
            cm.addContainerProvider(new DefaultPropertiesProvider());
            cm.addContainerProvider(new StrutsXmlConfigurationProvider("struts-default.xml", false, null));
            cm.addContainerProvider(configProvider);
            cm.addContainerProvider(new PropertiesConfigurationProvider());
View Full Code Here

Examples of com.opensymphony.xwork2.config.ConfigurationProvider

        if (configProvs != null) {
            String[] classes = configProvs.split("\\s*[,]\\s*");
            for (String cname : classes) {
                try {
                    Class cls = ClassLoaderUtil.loadClass(cname, this.getClass());
                    ConfigurationProvider prov = (ConfigurationProvider)cls.newInstance();
                    configurationManager.addContainerProvider(prov);
                } catch (InstantiationException e) {
                    throw new ConfigurationException("Unable to instantiate provider: "+cname, e);
                } catch (IllegalAccessException e) {
                    throw new ConfigurationException("Unable to access provider: "+cname, e);
View Full Code Here

Examples of com.opensymphony.xwork2.config.ConfigurationProvider

            }
        }
    }

    private void init_FilterInitParameters() {
        configurationManager.addContainerProvider(new ConfigurationProvider() {
            public void destroy() {
            }

            public void init(Configuration configuration) throws ConfigurationException {
            }
View Full Code Here

Examples of com.opensymphony.xwork2.config.ConfigurationProvider

    }

    public void testNeedsReload() throws Exception {
        container.getInstance(FileManager.class).setReloadingConfigs(true);
        final String filename = "com/opensymphony/xwork2/config/providers/xwork-test-actions.xml";
        ConfigurationProvider provider = buildConfigurationProvider(filename);

        assertTrue(!provider.needsReload());

        File file = new File(getClass().getResource("/" + filename).toURI());
        assertTrue("not exists: " + file.toString(), file.exists());
        changeFileTime(file);

        assertTrue(provider.needsReload());
    }
View Full Code Here

Examples of com.opensymphony.xwork2.config.ConfigurationProvider

        assertTrue(provider.needsReload());
    }

    public void testInheritence() throws Exception {
        final String filename = "com/opensymphony/xwork2/config/providers/xwork-include-parent.xml";
        ConfigurationProvider provider = buildConfigurationProvider(filename);

        provider.init(configuration);
        provider.loadPackages();

        // test expectations
        assertEquals(6, configuration.getPackageConfigs().size());

View Full Code Here

Examples of com.opensymphony.xwork2.config.ConfigurationProvider

    public void testEmptySpaces() throws Exception {
        final String filename = "com/opensymphony/xwork2/config/providers/xwork- test.xml";
        container.getInstance(FileManager.class).setReloadingConfigs(true);

        ConfigurationProvider provider = buildConfigurationProvider(filename);
        assertTrue(!provider.needsReload());

        URI uri = ClassLoaderUtil.getResource(filename, ConfigurationProvider.class).toURI();

        File file = new File(uri);

        assertTrue(file.exists());
        changeFileTime(file);

        assertTrue(provider.needsReload());
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.