Package bear.console

Examples of bear.console.ConsoleCallback


            // to make sure there are no old start entries
            resetConsolePath($, consolePath);

            WatchDogRunnable runnable = new WatchDogRunnable($, watchDog, new WatchDogInput(
                consolePath, false, new ConsoleCallback() {
                @Override
                public ConsoleCallbackResult progress(final AbstractConsole.Terminal console, String buffer, String wholeText) {
                    //todo these parts are all common, extract!!
                    //todo add real crash messages
                    if(buffer.contains("app crashed - waiting for file") ){
View Full Code Here


            // to make sure there are no old start entries
            resetConsolePath($, consolePath);

            WatchDogRunnable runnable = new WatchDogRunnable($, watchDog, new WatchDogInput(
                consolePath, false, new ConsoleCallback() {
                @Override
                public ConsoleCallbackResult progress(final AbstractConsole.Terminal console, String buffer, String wholeText) {
                    //todo these parts are all common, extract!!
                    //todo add real crash messages
                    if(buffer.contains("app crashed - waiting for file") ){
View Full Code Here

            } else if (distrName.endsWith("zip")) {
                script.line().addRaw("unzip ../%s", distrName).build();
            } else if (distrName.endsWith("bin")) {
                script
                    .add($.sys.permissions("../" + distrName).withPermissions("u+x").asLine())
                    .line().addRaw("../%s", distrName).setCallback(new ConsoleCallback() {
                    @Nonnull
                    @Override
                    public ConsoleCallbackResult progress(AbstractConsole.Terminal console, String buffer, String wholeText) {
                        if(buffer.contains("Press Enter")) console.println("");           //a surprise from jdk 6u43-
                        return ConsoleCallbackResult.CONTINUE;
View Full Code Here

    public CaptureBuilder captureBuilder(String s) {
        return new CaptureBuilder($, s);
    }

    public CommandLineResult<?> captureResult(String s, boolean sudo) {
        ConsoleCallback callback = sudo ? sshPassword($) : null;

        return captureBuilder(s).sudo(sudo).callback(callback).run();
    }
View Full Code Here

        @Override
        public ConsoleCallback passwordCallback() {
            final String password = $(getBear().vcsPassword);

            return new ConsoleCallback() {
                @Override
                @Nonnull
                public ConsoleCallbackResult progress(AbstractConsole.Terminal console, String buffer, String wholeText) {
                    if (buffer.matches(".*\\bpassword.*:.*")) {
                        console.println(password);
View Full Code Here

        return sys.sendCommand(sys.line().stty().a("mysql", "-u", user, "-p").redirectFrom(filePath));
    }

    public static ConsoleCallback passwordCallback(final String pw) {
        return new ConsoleCallback(){
            @Override
            @Nonnull
            public ConsoleCallbackResult progress(AbstractConsole.Terminal console, String buffer, String wholeText) {
                if (buffer.contains("Enter password:")) {
                    console.println(pw);
View Full Code Here

        return timeoutMs(sys.$(sys.getBear().shortTimeoutMs));
    }

    public ConsoleCallback callback() {
        for (CommandLine<T, CHILD> line : lines) {
            ConsoleCallback callback = line.getCallback();
            if (callback != null) {
                return callback;
            }
        }
        return null;
View Full Code Here

        final boolean reportExceptions = $.var(reportJavaExceptions);


        CommandLine line = $.sys.line().timeoutMs(timeoutMs)
            .sudoOrStty(input.sudo).addSplit("tail -f -n " + input.lines + " ").a(input.path)
            .setCallback(new ConsoleCallback() {
                @Override
                @Nonnull
                public ConsoleCallbackResult progress(AbstractConsole.Terminal console, String buffer, String wholeText) {
                    if (buffer.contains("password")) {
                        console.println($.var($.bear.sshPassword));
View Full Code Here

            // to make sure there are no old start entries
            resetConsolePath($, consolePath);

            WatchDogRunnable runnable = new WatchDogRunnable($, watchDog, new WatchDogInput(
                consolePath, false, new ConsoleCallback() {
                @Override
                @Nonnull
                public ConsoleCallbackResult progress(AbstractConsole.Terminal console, String buffer, String wholeText) {
                    if (buffer.contains("Listening for HTTP on")) {
                        return startedResult($, port);
View Full Code Here

            // to make sure there are no old start entries
            resetConsolePath($, consolePath);

            WatchDogRunnable runnable = new WatchDogRunnable($, watchDog, new WatchDogInput(
                consolePath, false, new ConsoleCallback() {
                @Override
                public ConsoleCallbackResult progress(final AbstractConsole.Terminal console, String buffer, String wholeText) {
                    //todo these parts are all common, extract!!
                    //todo add real crash messages
                    if(buffer.contains("app crashed - waiting for file") ){
View Full Code Here

TOP

Related Classes of bear.console.ConsoleCallback

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.