Package org.netbeans.gradle.model

Examples of org.netbeans.gradle.model.BuilderResult


    public static <T> T fetchSingleProjectInfo(
            ProjectConnection connection,
            ProjectInfoBuilder<T> infoBuilder) throws IOException {

        BuilderResult builderResult = fetchSingleProjectInfoWithError(connection, infoBuilder);

        @SuppressWarnings("unchecked")
        T result = builderResult != null
                ? (T)builderResult.getResultIfNoIssue()
                : null;
        return result;
    }
View Full Code Here


    public static <T> T fetchSingleBuildInfo(
            ProjectConnection connection,
            BuildInfoBuilder<T> infoBuilder) throws IOException {

        BuilderResult builderResult = fetchSingleBuildInfoWithError(connection, infoBuilder);

        @SuppressWarnings("unchecked")
        T result = builderResult != null
                ? (T)builderResult.getResultIfNoIssue()
                : null;
        return result;
    }
View Full Code Here

    public void testFailingProjectQuery() throws IOException {
        runTestForSubProject("", new ProjectConnectionTask() {
            public void doTask(ProjectConnection connection) throws Exception {
                String message = "testFailingProjectQuery-message";
                ProjectInfoBuilder<?> builder = TestBuilders.failingProjectInfoBuilder(message);
                BuilderResult result = fetchSingleProjectInfoWithError(connection, builder);
                assertNotNull("Required result for FailingProjectInfoBuilder.", result);

                BuilderIssue issue = result.getIssue();
                assertNotNull("Required issue for FailingProjectInfoBuilder", issue);

                assertEquals("Expected approriate builder name.", builder.getName(), issue.getName());
                String issueMessage = issue.getException().getMessage();
                if (!issueMessage.contains(message)) {
View Full Code Here

        runTestForSubProject("", new ProjectConnectionTask() {
            public void doTask(ProjectConnection connection) throws Exception {
                String message = "testFailingBuildQuery-message";
                BuildInfoBuilder<?> builder = TestBuilders.failingBuildInfoBuilder(message);

                BuilderResult result = fetchSingleBuildInfoWithError(connection, builder);
                assertNotNull("Required result for FailingBuildInfoBuilder.", result);

                BuilderIssue issue = result.getIssue();
                assertNotNull("Required issue for FailingBuildInfoBuilder", issue);

                assertEquals("Expected approriate builder name.", builder.getName(), issue.getName());
                String issueMessage = issue.getException().getMessage();
                if (!issueMessage.contains(message)) {
View Full Code Here

            }
        });
    }

    private static Object getSingleBuildResult(List<BuilderResult> list) {
        BuilderResult result = CollectionUtils.getSingleElement(list);
        return result != null ? result.getResultIfNoIssue() : null;
    }
View Full Code Here

        final GenericModelFetcher fetcher = new GenericModelFetcher(buildInfos, projectInfos, toolingModels);
        runTestForSubProject("apps:app1", new ProjectConnectionTask() {
            public void doTask(ProjectConnection connection) throws Exception {
                FetchedModels models = verifyNoError(fetcher.getModels(connection, TestUtils.defaultInit()));

                BuilderResult buildInfo1 = CollectionUtils
                        .getSingleElement(models.getBuildInfoResults().get(1));
                BuilderResult buildInfo2 = CollectionUtils
                        .getSingleElement(models.getBuildInfoResults().get(2));
                BuilderResult buildInfo3 = CollectionUtils
                        .getSingleElement(models.getBuildInfoResults().get(3));
                BuilderResult buildInfo4 = CollectionUtils
                        .getSingleElement(models.getBuildInfoResults().get(4));

                verifySerializationError(buildInfo1);
                verifySerializationError(buildInfo2);
                verifyDeserializationError(buildInfo3);
                verifyDeserializationError(buildInfo4);

                BuilderResult projectInfo1 = CollectionUtils.getSingleElement(
                        models.getDefaultProjectModels().getProjectInfoResults().get(1));
                BuilderResult projectInfo2 = CollectionUtils.getSingleElement(
                        models.getDefaultProjectModels().getProjectInfoResults().get(2));
                BuilderResult projectInfo3 = CollectionUtils.getSingleElement(
                        models.getDefaultProjectModels().getProjectInfoResults().get(3));
                BuilderResult projectInfo4 = CollectionUtils.getSingleElement(
                        models.getDefaultProjectModels().getProjectInfoResults().get(4));

                verifySerializationError(projectInfo1);
                verifySerializationError(projectInfo2);
                verifyDeserializationError(projectInfo3);
View Full Code Here

                } catch (Throwable ex) {
                    issue = ex;
                }

                if (info != null || issue != null) {
                    BuilderResult builderResult = new BuilderResult(
                            info,
                            BuilderUtils.createIssue(builder, issue));
                    projectInfosBuilder.addValue(key, builderResult);
                }
            }
View Full Code Here

TOP

Related Classes of org.netbeans.gradle.model.BuilderResult

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.