Package org.apache.tuscany.sca.node.osgi.launcher

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


        //        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

Related Classes of org.apache.tuscany.sca.node.osgi.launcher.FelixOSGiHost

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.