Examples of FelixOSGiHost


Examples of org.apache.struts2.osgi.host.FelixOsgiHost

    public static OsgiHost createOsgiHost(String platform) {
        if (GLASSFISH.equalsIgnoreCase(platform)) {
            return new GlassfishOSGiHost();
        }
        return new FelixOsgiHost();
    }
View Full Code Here

Examples of org.apache.tuscany.sca.node.osgi.launcher.FelixOSGiHost

        //        String home = new File(basedir, "target/tuscany").toString();
        //        System.setProperty("TUSCANY_HOME", home);
        //        getLog().info(home);
        try {
            FelixOSGiHost host = new FelixOSGiHost();
            host.setActivator(new LauncherBundleActivator(jarFiles));
            BundleContext context = host.start();

            for (Bundle b : context.getBundles()) {
                if (getLog().isDebugEnabled()) {
                    getLog().debug(LauncherBundleActivator.toString(b, false));
                }
            }

            ClassLoader tccl = Thread.currentThread().getContextClassLoader();
            URL[] urls =
                new URL[] {new File(project.getBuild().getOutputDirectory()).toURI().toURL(),
                           new File(project.getBuild().getTestOutputDirectory()).toURI().toURL()};

            URLClassLoader cl = new URLClassLoader(urls, tccl);
            Thread.currentThread().setContextClassLoader(cl);
            try {
                runAllTestsFromDirs(cl, project.getBuild().getTestOutputDirectory());
            } finally {
                Thread.currentThread().setContextClassLoader(tccl);
            }
            host.stop();
        } catch (Throwable e) {
            throw new MojoExecutionException(e.getMessage(), e);
        }
        //        finally {
        //            System.clearProperty("TUSCANY_HOME");
View Full Code Here

Examples of org.apache.tuscany.sca.node.osgi.launcher.FelixOSGiHost

        //        String home = new File(basedir, "target/tuscany").toString();
        //        System.setProperty("TUSCANY_HOME", home);
        //        getLog().info(home);
        try {
            FelixOSGiHost host = new FelixOSGiHost();
            host.setActivator(new LauncherBundleActivator(jarFiles));
            BundleContext context = host.start();

            for (Bundle b : context.getBundles()) {
                if (getLog().isDebugEnabled()) {
                    getLog().debug(LauncherBundleActivator.toString(b, false));
                }
            }

            ClassLoader tccl = Thread.currentThread().getContextClassLoader();
            URL[] urls =
                new URL[] {new File(project.getBuild().getOutputDirectory()).toURI().toURL(),
                           new File(project.getBuild().getTestOutputDirectory()).toURI().toURL()};

            URLClassLoader cl = new URLClassLoader(urls, tccl);
            Thread.currentThread().setContextClassLoader(cl);
            try {
                runAllTestsFromDirs(cl, project.getBuild().getTestOutputDirectory());
            } finally {
                Thread.currentThread().setContextClassLoader(tccl);
            }
            host.stop();
        } catch (Throwable e) {
            throw new MojoExecutionException(e.getMessage(), e);
        }
        //        finally {
        //            System.clearProperty("TUSCANY_HOME");
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.