Package com.volantis.mcs.runtime.configuration

Examples of com.volantis.mcs.runtime.configuration.MarkupPluginConfiguration


    private String createMarkupPlugins(List plugins) {
        String result = new String();
        if (plugins != null) {
            for (int i = 0; i < plugins.size(); i++) {
                MarkupPluginConfiguration configuration =
                        (MarkupPluginConfiguration) plugins.get(i);
                result += "<markup-plugin " +
                        attr("name", configuration.getName()) +
                        attr("class", configuration.getClassName()) +
                        attr("scope", configuration.getScope()) +
                        "> \n" +
                        "<initialize> \n" +
                        createArguments(configuration.getArguments()) +
                        "</initialize> \n" +
                        "</markup-plugin> \n";
            }
        }
        return result;
View Full Code Here


                new TestXmlConfigurationBuilder(doc.toString());
        MarinerConfiguration config = configBuilder.buildConfiguration();
        assertNotNull(config);
        Iterator plugins = config.getMarkupPluginsListIterator();
        if (plugins.hasNext()) {
            MarkupPluginConfiguration mpc =
                    (MarkupPluginConfiguration) plugins.next();
            assertEquals("Name should be the same as specified.",
                    values.getName(), mpc.getName());
            assertEquals("Class name should be the same as specified.",
                    values.getClassName(), mpc.getClassName());
            if (values.getScope() != null) {
                assertEquals("Scope should be the same as specified.",
                        values.getScope(), mpc.getScope());
            } else {
                assertEquals("Scope should be the default - canvas.",
                        "canvas", mpc.getScope());   
            }
        } else {
            if (values != null) {
                fail("Should have been a MarkupPluginConfiguration created.");
            }
View Full Code Here

        doMarkupPluginTest(null);
    }

    public void testEmpty() throws Exception {
        try {
            MarkupPluginConfiguration values = new MarkupPluginConfiguration();
            values.setName("");
            values.setClassName("x");
            doMarkupPluginTest(values);

            fail("Expected exception to be thrown");
        } catch (ConfigurationException e) {
            final Throwable cause = e.getCause();
View Full Code Here

            }
        }
    }

    public void testFull() throws Exception {
        MarkupPluginConfiguration values = new MarkupPluginConfiguration();
        values.setClassName("com.volantis.MyClass");
        values.setName("myPlugin");
        values.setScope("application");
        doMarkupPluginTest(values);
    }
View Full Code Here

    private List makePluginConfigurationList(String name, String className,
                                             String scope, List args,
                                             int count) {
        List result = new ArrayList(count);
        for (int i = 0; i < count; i++) {
            MarkupPluginConfiguration mpc = new MarkupPluginConfiguration();
            mpc.setName(name + i);
            mpc.setClassName(className);
            mpc.setScope(scope);
            for (int j = 0; j < args.size(); j++) {
                ArgumentConfiguration argumentConfiguration =
                        (ArgumentConfiguration) args.get(j);
               
                mpc.addArgument(argumentConfiguration);   
            }
            result.add(mpc);
        }
        return result;
    }
View Full Code Here

                ac.setName("argName");
                ac.setValue("argValue");
                ArrayList argsList = new ArrayList(1);
                argsList.add(ac);
               
                MarkupPluginConfiguration mpc =
                        new MarkupPluginConfiguration();
                mpc.setName("myPlugin");
                mpc.setClassName("com.volantis.mcs.integration.iapi." +
                        "InvokeElementTestCase$InvokeTestMarkupPlugin");
                mpc.setScope("application");               
                ArrayList pluginList = new ArrayList(1);
                pluginList.add(mpc);
               
                config.markupPlugins = pluginList;
            }
View Full Code Here

    // Javadoc inherited.
    protected Entry createEntry(IntegrationPluginConfiguration config,
                                MarinerApplication application) {

        MarkupPluginConfiguration cfg = (MarkupPluginConfiguration) config;
        String pluginName = cfg.getName();
        IntegrationPluginFactory factory;
        MarkupPluginScope scope = MarkupPluginScope.literal(cfg.getScope());
        if (scope == null) {
            IntegrationPlugin errorPlugin = createErrorPlugin(
                    MarkupPlugin.class,
                    pluginName,
                    messageLocalizer.format("plugin-scope-invalid",
View Full Code Here

    public MarkupPluginFactoryTestCase(String name) {
        super(name);
    }

    public void testGetPluginInstance() throws Exception {
        MarkupPluginConfiguration config = new MarkupPluginConfiguration();

        final String pluginName = "myPlugin";
        final String pluginClassName = FactoryTestMarkupPlugin.class.getName();
        final String pluginScope = "application";

        config.setName(pluginName);
        config.setClassName(pluginClassName);
        config.setScope(pluginScope);

        final ArgumentConfiguration ac = new ArgumentConfiguration();
        final String argName = "argName";
        final String argValue = "argValue";
        ac.setName(argName);
        ac.setValue(argValue);

        config.addArgument(ac);

        MarinerApplication application = null;
        MarkupPluginFactoryImpl factory
                = new MarkupPluginFactoryImpl(config, application);
View Full Code Here

        assertEquals("Unexpected object class",
                     FactoryTestMarkupPlugin.class, plugin.getClass());
    }

    public void testGetPluginInstanceWithError() throws Exception {
        MarkupPluginConfiguration config = new MarkupPluginConfiguration();

        final String pluginName = "myPlugin";
        final String pluginClassName = "not.markup.plugin";
        final String pluginScope = "application";

        config.setName(pluginName);
        config.setClassName(pluginClassName);
        config.setScope(pluginScope);

        final ArgumentConfiguration ac = new ArgumentConfiguration();
        final String argName = "argName";
        final String argValue = "argValue";
        ac.setName(argName);
        ac.setValue(argValue);

        config.addArgument(ac);

        MarinerApplication application = null;
        MarkupPluginFactoryImpl factory
                = new MarkupPluginFactoryImpl(config, application);
View Full Code Here

    /**
     * Test the method addMarkupPlugin
     */
    public void testAddMarkupPlugin() throws Exception {
        MarkupPluginConfiguration config = new MarkupPluginConfiguration();

        final String pluginName = "myPlugin";
        final String pluginClassName = ManagerTestMarkupPlugin.class.getName();
        final String pluginScope = "application";

        config.setName(pluginName);
        config.setClassName(pluginClassName);
        config.setScope(pluginScope);

        final ArgumentConfiguration ac = new ArgumentConfiguration();
        final String argName = "argName";
        final String argValue = "argValue";
        ac.setName(argName);
        ac.setValue(argValue);
        config.addArgument(ac);

        MarkupPluginManagerImpl manager = createManagerForOnePlugin(config);

        IntegrationPluginFactory factory = manager.getFactory(pluginName);

View Full Code Here

TOP

Related Classes of com.volantis.mcs.runtime.configuration.MarkupPluginConfiguration

Copyright © 2018 www.massapicom. 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.