Package org.apache.cxf.tools.plugin

Examples of org.apache.cxf.tools.plugin.Plugin


    @Test
    public void testLoadPlugins() throws Exception {
        PluginLoader loader = PluginLoader.getInstance();
        assertEquals(3, loader.getPlugins().size());

        Plugin plugin = getPlugin(loader, 0);
        assertNotNull(plugin.getName());
       
        Map<String, FrontEnd> frontends = loader.getFrontEnds();
        assertNotNull(frontends);
        assertEquals(2, frontends.size());
View Full Code Here


        assertNotNull(loader);

        loader.loadPlugin("/org/apache/cxf/tools/wsdlto/frontend/jaxws/jaxws-plugin.xml");
       
        assertEquals(2, loader.getPlugins().size());
        Plugin plugin = getPlugin(loader, 1);
        assertEquals("tools-jaxws-frontend", plugin.getName());
        assertEquals("2.0", plugin.getVersion());
        assertEquals("apache cxf", plugin.getProvider());

        Map<String, FrontEnd> frontends = loader.getFrontEnds();
        assertNotNull(frontends);
        assertEquals(2, frontends.size());
View Full Code Here

            databindings.put(databinding.getName(), databinding);
        }
    }

    protected Plugin getPlugin(URL url) throws IOException, JAXBException, FileNotFoundException {
        Plugin plugin = plugins.get(url.toString());
        InputStream is = null;
        if (plugin == null) {
            is = url.openStream();
            plugin = getPlugin(is);
            if (plugin == null || StringUtils.isEmpty(plugin.getName())) {
                Message msg = new Message("PLUGIN_LOAD_FAIL", LOG, url);
                LOG.log(Level.SEVERE, msg.toString());
                throw new ToolException(msg);
            }
            plugins.put(url.toString(), plugin);
View Full Code Here

        }
        return plugin;
    }

    protected Plugin getPlugin(String resource) throws JAXBException, FileNotFoundException {
        Plugin plugin = plugins.get(resource);
        if (plugin == null) {
            InputStream is = null;
            if (new File(resource).exists()) {
                is = new BufferedInputStream(new FileInputStream(new File(resource)));
            } else {
                is = getClass().getResourceAsStream(resource);
            }

            if (is == null) {
                Message msg = new Message("PLUGIN_MISSING", LOG, resource);
                LOG.log(Level.SEVERE, msg.toString());
                throw new ToolException(msg);
            }
            plugin = getPlugin(is);
            if (plugin == null || StringUtils.isEmpty(plugin.getName())) {
                Message msg = new Message("PLUGIN_LOAD_FAIL", LOG, resource);
                LOG.log(Level.SEVERE, msg.toString());
                throw new ToolException(msg);
            }
            plugins.put(resource, plugin);
View Full Code Here

            databindings.put(databinding.getName(), databinding);
        }
    }

    protected Plugin getPlugin(URL url) throws IOException, JAXBException, FileNotFoundException {
        Plugin plugin = plugins.get(url.toString());
        InputStream is = null;
        if (plugin == null) {
            is = url.openStream();
            plugin = getPlugin(is);
            if (plugin == null || StringUtils.isEmpty(plugin.getName())) {
                Message msg = new Message("PLUGIN_LOAD_FAIL", LOG, url);
                LOG.log(Level.SEVERE, msg.toString());
                throw new ToolException(msg);
            }
            plugins.put(url.toString(), plugin);
View Full Code Here

        }
        return plugin;
    }
   
    protected Plugin getPlugin(String resource) throws JAXBException, FileNotFoundException {
        Plugin plugin = plugins.get(resource);
        if (plugin == null) {
            InputStream is = null;
            if (new File(resource).exists()) {
                is = new BufferedInputStream(new FileInputStream(new File(resource)));
            } else {
                is = getClass().getResourceAsStream(resource);               
            }

            if (is == null) {
                Message msg = new Message("PLUGIN_MISSING", LOG, resource);
                LOG.log(Level.SEVERE, msg.toString());
                throw new ToolException(msg);
            }
            plugin = getPlugin(is);
            if (plugin == null || StringUtils.isEmpty(plugin.getName())) {
                Message msg = new Message("PLUGIN_LOAD_FAIL", LOG, resource);
                LOG.log(Level.SEVERE, msg.toString());
                throw new ToolException(msg);
            }
            plugins.put(resource, plugin);
View Full Code Here

   
    public void testLoadPlugins() throws Exception {
        PluginLoader loader = PluginLoader.getInstance();
        assertEquals(2, loader.getPlugins().size());

        Plugin plugin = getPlugin(loader, 0);
        assertNotNull(plugin.getName());
       
        Map<String, FrontEnd> frontends = loader.getFrontEnds();
        assertNotNull(frontends);
        assertEquals(1, frontends.size());
View Full Code Here

        assertNotNull(loader);

        loader.loadPlugin("/org/apache/cxf/tools/wsdlto/frontend/jaxws/jaxws-plugin.xml");
       
        assertEquals(2, loader.getPlugins().size());
        Plugin plugin = getPlugin(loader, 1);
        assertEquals("tools-jaxws-frontend", plugin.getName());
        assertEquals("2.0", plugin.getVersion());
        assertEquals("apache cxf", plugin.getProvider());

        Map<String, FrontEnd> frontends = loader.getFrontEnds();
        assertNotNull(frontends);
        assertEquals(1, frontends.size());
View Full Code Here

            databindings.put(databinding.getName(), databinding);
        }
    }

    protected Plugin getPlugin(URL url) throws IOException, JAXBException, FileNotFoundException {
        Plugin plugin = plugins.get(url.toString());
        InputStream is = null;
        if (plugin == null) {
            is = url.openStream();
            plugin = getPlugin(is);
            if (plugin == null || StringUtils.isEmpty(plugin.getName())) {
                Message msg = new Message("PLUGIN_LOAD_FAIL", LOG, url);
                LOG.log(Level.SEVERE, msg.toString());
                throw new ToolException(msg);
            }
            plugins.put(url.toString(), plugin);
View Full Code Here

        }
        return plugin;
    }

    protected Plugin getPlugin(String resource) throws JAXBException, FileNotFoundException {
        Plugin plugin = plugins.get(resource);
        if (plugin == null) {
            InputStream is = null;
            if (new File(resource).exists()) {
                is = new BufferedInputStream(new FileInputStream(new File(resource)));
            } else {
                is = getClass().getResourceAsStream(resource);
            }

            if (is == null) {
                Message msg = new Message("PLUGIN_MISSING", LOG, resource);
                LOG.log(Level.SEVERE, msg.toString());
                throw new ToolException(msg);
            }
            plugin = getPlugin(is);
            if (plugin == null || StringUtils.isEmpty(plugin.getName())) {
                Message msg = new Message("PLUGIN_LOAD_FAIL", LOG, resource);
                LOG.log(Level.SEVERE, msg.toString());
                throw new ToolException(msg);
            }
            plugins.put(resource, plugin);
View Full Code Here

TOP

Related Classes of org.apache.cxf.tools.plugin.Plugin

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.