Package org.apache.geronimo.gshell.shell

Examples of org.apache.geronimo.gshell.shell.Shell


    public Application getApplication() {
        return application;
    }

    public Shell create() throws Exception {
        final Shell shell = (Shell) applicationContext.getBean("shell");

        log.debug("Created shell instance: {}", shell);

        eventPublisher.publish(new ShellCreatedEvent(shell));
View Full Code Here


                                   "META-INF/spring/gshell-vfs.xml",
                                   "META-INF/spring/gshell-commands.xml",
                                   "org/apache/servicemix/kernel/gshell/core/gshell-test.xml" });
            ApplicationManager appMgr = (ApplicationManager) context.getBean("applicationManager");
            assertNotNull(appMgr);
            Shell shell = appMgr.create();
            assertNotNull(shell);
            shell.execute("help");
        } finally {
            if (context != null) {
                context.destroy();
            }
        }
View Full Code Here

                                   "META-INF/spring/gshell-vfs.xml",
                                   "META-INF/spring/gshell-commands.xml",
                                   "org/apache/servicemix/kernel/gshell/core/gshell-test.xml"});
            ApplicationManager appMgr = (ApplicationManager) context.getBean("applicationManager");
            assertNotNull(appMgr);
            Shell shell = appMgr.create();
            ServiceMixBranding smxBrandng = (ServiceMixBranding)appMgr.getApplication().getModel().getBranding();
            assertNotNull(smxBrandng.getWelcomeMessage());
            System.out.println(smxBrandng.getWelcomeMessage());
            assertNotNull(shell);
            shell.execute("about");
        } finally {
            if (context != null) {
                context.destroy();
            }
        }
View Full Code Here

                                   "META-INF/spring/gshell-vfs.xml",
                                   "org/apache/servicemix/kernel/gshell/core/gshell-test-commands.xml",
                                   "org/apache/servicemix/kernel/gshell/core/gshell-test.xml"});
            ApplicationManager appMgr = (ApplicationManager) context.getBean("applicationManager");
            assertNotNull(appMgr);
            Shell shell = appMgr.create();
            ServiceMixBranding smxBrandng = (ServiceMixBranding)appMgr.getApplication().getModel().getBranding();
            assertNotNull(smxBrandng.getWelcomeMessage());
            System.out.println(smxBrandng.getWelcomeMessage());
            assertNotNull(shell);
            shell.execute("vfs/ls meta:/commands/");
        } finally {
            if (context != null) {
                context.destroy();
            }
        }
View Full Code Here

                                   "META-INF/spring/gshell-vfs.xml",
                                   "org/apache/servicemix/kernel/gshell/core/gshell-test-commands.xml",
                                   "org/apache/servicemix/kernel/gshell/core/gshell-test.xml"});
            ApplicationManager appMgr = (ApplicationManager) context.getBean("applicationManager");
            assertNotNull(appMgr);
            Shell shell = appMgr.create();
            ServiceMixBranding smxBrandng = (ServiceMixBranding)appMgr.getApplication().getModel().getBranding();
            assertNotNull(smxBrandng.getWelcomeMessage());
            System.out.println(smxBrandng.getWelcomeMessage());
            assertNotNull(shell);

            shell.execute("vfs");
            shell.execute("help");
            shell.execute("..");
        } finally {
            if (context != null) {
                context.destroy();
            }
        }
View Full Code Here

                                   "META-INF/spring/gshell-vfs.xml",
                                   "org/apache/servicemix/kernel/gshell/core/gshell-test-commands.xml",
                                   "org/apache/servicemix/kernel/gshell/core/gshell-test.xml"});
            ApplicationManager appMgr = (ApplicationManager) context.getBean("applicationManager");
            assertNotNull(appMgr);
            Shell shell = appMgr.create();           
            assertNotNull(shell);
            shell.execute("optional/cat src/test/resources/org/apache/servicemix/kernel/gshell/core/gshell-test.xml");
            shell.execute("optional/find src/test/resources/org/apache/servicemix/kernel/gshell/core/gshell-test.xml");
        } finally {
            if (context != null) {
                context.destroy();
            }
        }
View Full Code Here

                }
            }

            log.debug("Executing alias: {}", buff);

            final Shell shell = ShellContextHolder.get().getShell();
            ShellContext shellContext = new ShellContext() {
                public Shell getShell() {
                    return shell;
                }
                public IO getIo() {
View Full Code Here

            getBundle("org.apache.servicemix.kernel.gshell", "org.apache.servicemix.kernel.gshell.osgi")
        };
    }

    public void testHelp() throws Exception {
        Shell shell = getOsgiService(Shell.class);
        shell.execute("help");
    }
View Full Code Here

        Shell shell = getOsgiService(Shell.class);
        shell.execute("help");
    }

    public void testInstallCommand() throws Exception {
        Shell shell = getOsgiService(Shell.class);

        try {
            shell.execute("log/display");
            fail("command should not exist");
        } catch (CommandLineExecutionFailed e) {
            assertNotNull(e.getCause());
            assertTrue(e.getCause() instanceof NoSuchCommandException);
        }

        Bundle b = installBundle("org.apache.servicemix.kernel.gshell", "org.apache.servicemix.kernel.gshell.log", null, "jar");

        shell.execute("log/display");

        b.uninstall();

        try {
            shell.execute("log/display");
            fail("command should not exist");
        } catch (CommandLineExecutionFailed e) {
            assertNotNull(e.getCause());
            assertTrue(e.getCause() instanceof NoSuchCommandException);
        }
View Full Code Here

            assertTrue(e.getCause() instanceof NoSuchCommandException);
        }
    }

    public void testCommandGroup() throws Exception {
        Shell shell = getOsgiService(Shell.class);
        shell.execute("osgi");
        shell.execute("help");
        shell.execute("..");
    }
View Full Code Here

TOP

Related Classes of org.apache.geronimo.gshell.shell.Shell

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.