Package org.gradle.gradleplugin.foundation.request

Examples of org.gradle.gradleplugin.foundation.request.Request


               complete.countDown();
           }
        };

        gradlePluginLord.addRequestObserver( observer, false );   //add the observer before we add the request due to timing issues. It's possible for it to completely execute before we return from addRefreshRequestToQueue.
        Request request = gradlePluginLord.addRefreshRequestToQueue();

        //make sure we've got a request
        Assert.assertNotNull(request);

        //now wait until we're complete, but bail if we wait too long
        boolean completed;
        try {
            completed = complete.await(maximumWaitValue, maximumWaitUnits);
        } catch (InterruptedException e) {
            throw UncheckedException.asUncheckedException(e);
        }

        gradlePluginLord.removeRequestObserver( observer );

        if (!completed) //its still running. Something is wrong.
        {
            request.cancel(); //just to clean up after ourselves a little, cancel the request.
            throw new AssertionFailedError("Failed to complete refresh in alotted time: " + maximumWaitValue + " " + maximumWaitUnits + ". Considering this failed.");
        }
    }
View Full Code Here


               isComplete.set(true);
           }
        };

        gradlePluginLord.addRequestObserver( observer, false );   //add the observer before we add the request due to timing issues. It's possible for it to completely execute before we return from addExecutionRequestToQueue.
        Request request = gradlePluginLord.addExecutionRequestToQueue( fullCommandLine, displayName );

        //make sure we've got a request
        Assert.assertNotNull(request);

        //now sleep until we're complete, but bail if we wait too long
        int totalWaitTime = 0;
        while (!isComplete.get() && totalWaitTime <= maximumWaitSeconds) {
            try {
                Thread.sleep(1000);
            }
            catch (InterruptedException e) {
                e.printStackTrace();
            }

            totalWaitTime += 1;
        }

        gradlePluginLord.removeRequestObserver( observer );

        if (!isComplete.get()) //its still running. Something is wrong.
        {
            request.cancel(); //just to clean up after ourselves a little, cancel the request.
            throw new AssertionFailedError("Failed to comlete execution in alotted time: " + maximumWaitSeconds + " seconds. Considering this failed.");
        }
    }
View Full Code Here

                complete.countDown();
            }
        };

        gradlePluginLord.addRequestObserver(observer, false);   //add the observer before we add the request due to timing issues. It's possible for it to completely execute before we return from addRefreshRequestToQueue.
        Request request = gradlePluginLord.addRefreshRequestToQueue();

        //make sure we've got a request
        Assert.assertNotNull(request);

        //now wait until we're complete, but bail if we wait too long
        boolean completed;
        try {
            completed = complete.await(maximumWaitValue, maximumWaitUnits);
        } catch (InterruptedException e) {
            throw UncheckedException.throwAsUncheckedException(e);
        }

        gradlePluginLord.removeRequestObserver(observer);

        if (!completed) {
            //its still running. Something is wrong.
            request.cancel(); //just to clean up after ourselves a little, cancel the request.
            throw new AssertionError("Failed to complete refresh in alotted time: " + maximumWaitValue + " " + maximumWaitUnits + ". Considering this failed.");
        }
        if (errorOutput.get() != null) {
            throw new AssertionError(String.format("Command failed with output:%n%s", errorOutput.get()));
        }
View Full Code Here

            }
        };

        gradlePluginLord.addRequestObserver(observer,
                false);   //add the observer before we add the request due to timing issues. It's possible for it to completely execute before we return from addExecutionRequestToQueue.
        Request request = gradlePluginLord.addExecutionRequestToQueue(fullCommandLine, displayName);

        //make sure we've got a request
        Assert.assertNotNull(request);

        //now sleep until we're complete, but bail if we wait too long
        boolean timeout;
        try {
            timeout = !complete.await(maximumWaitSeconds, TimeUnit.SECONDS);
        } catch (InterruptedException e) {
            throw UncheckedException.throwAsUncheckedException(e);
        }

        gradlePluginLord.removeRequestObserver(observer);

        if (timeout) {
            //its still running. Something is wrong.
            request.cancel(); //just to clean up after ourselves a little, cancel the request.
            throw new AssertionError("Failed to comlete execution in alotted time: " + maximumWaitSeconds + " seconds. Considering this failed.");
        }
    }
View Full Code Here

TOP

Related Classes of org.gradle.gradleplugin.foundation.request.Request

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.