Package org.netbeans.gradle.model

Examples of org.netbeans.gradle.model.FetchedModels


    public static FetchedModels verifyNoError(FetchedModelsOrError modelsOrError) {
        assertNull(modelsOrError.getBuildScriptEvaluationError());
        assertNull(modelsOrError.getUnexpectedError());

        FetchedModels result = modelsOrError.getModels();
        assertNotNull(result);
        return result;
    }
View Full Code Here


    public static BuilderResult fetchSingleBuildInfoWithError(
            ProjectConnection connection,
            BuildInfoBuilder<?> infoBuilder) throws IOException {

        GenericModelFetcher modelFetcher = buildInfoFetcher(infoBuilder);
        FetchedModels models = verifyNoError(modelFetcher.getModels(connection, defaultInit()));

        assertTrue(models.getDefaultProjectModels().getProjectInfoResults().isEmpty());

        return getSingleElement(models.getBuildInfoResults().get(0));
    }
View Full Code Here

    public static BuilderResult fetchSingleProjectInfoWithError(
            ProjectConnection connection,
            ProjectInfoBuilder<?> infoBuilder) throws IOException {

        GenericModelFetcher modelFetcher = projectInfoFetcher(infoBuilder);
        FetchedModels models = verifyNoError(modelFetcher.getModels(connection, defaultInit()));

        assertTrue(models.getBuildInfoResults().isEmpty());

        return getSingleElement(models.getDefaultProjectModels().getProjectInfoResults().get(0));
    }
View Full Code Here

    public static GradleMultiProjectDef fetchProjectDef(
            ProjectConnection connection) throws IOException {

        GenericModelFetcher modelFetcher = basicInfoFetcher();
        FetchedModels models = verifyNoError(modelFetcher.getModels(connection, defaultInit()));

        return models.getDefaultProjectModels().getProjectDef();
    }
View Full Code Here

        toolingModels.add(IdeaProject.class);

        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()));

                String buildInfo = (String)getSingleBuildResult(
                        models.getBuildInfoResults().get(0));
                assertEquals(prefix + ROOT_NAME, buildInfo);

                Map<Object, List<BuilderResult>> projectInfos
                        = models.getDefaultProjectModels().getProjectInfoResults();

                JarOutputsModel model1 = (JarOutputsModel)getSingleBuildResult(projectInfos.get(0));
                JavaCompatibilityModel model2 = (JavaCompatibilityModel)getSingleBuildResult(projectInfos.get(1));
                JavaSourcesModel model3 = (JavaSourcesModel)getSingleBuildResult(projectInfos.get(2));
                WarFoldersModel model4 = (WarFoldersModel)getSingleBuildResult(projectInfos.get(3));
View Full Code Here

        toolingModels.add(IdeaProject.class);

        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()));

                String buildInfo = (String)getSingleBuildResult(
                        models.getBuildInfoResults().get(0));
                assertEquals(prefix + ROOT_NAME, buildInfo);

                Map<Object, List<BuilderResult>> projectInfos
                        = models.getDefaultProjectModels().getProjectInfoResults();

                List<BuilderResult> results = projectInfos.get(0);
                assertNotNull("Must have results of query", results);

                assertEquals("Must have 3/4 queries.", 3, results.size());
View Full Code Here

        toolingModels.add(IdeaProject.class);

        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);
                verifyDeserializationError(projectInfo4);

                Object buildInfoOk = getSingleBuildResult(
                        models.getBuildInfoResults().get(0));
                assertTrue("The valid builder must succeed",
                        buildInfoOk.toString().startsWith(buildInfoPrefix));

                Object projectInfoOk = getSingleBuildResult(
                        models.getDefaultProjectModels().getProjectInfoResults().get(0));
                assertTrue("The valid builder must succeed",
                        projectInfoOk.toString().startsWith(projectInfoPrefix));
            }
        });
    }
View Full Code Here

        Map<Object, List<GradleBuildInfoQuery<?>>> buildInfos = Collections.emptyMap();
        Map<Object, List<GradleProjectInfoQuery<?>>> projectInfos = Collections.emptyMap();
        Set<Class<?>> toolingModels = new HashSet<Class<?>>(Arrays.asList(modelClasses));

        GenericModelFetcher modelFetcher = new GenericModelFetcher(buildInfos, projectInfos, toolingModels);
        FetchedModels models = verifyNoError(modelFetcher.getModels(connection, defaultInit()));

        return models.getDefaultProjectModels().getToolingModels();
    }
View Full Code Here

            ProjectConnection connection,
            ProgressHandle progress) throws IOException, GradleModelLoadError {

        ProjectModelFetcher modelFetcher = new ProjectModelFetcher(project, gradleTarget);
        FetchedModelsOrError fetchedModelsOrError = modelFetcher.getModels(connection, setup);
        FetchedModels fetchedModels = fetchedModelsOrError.getModels();
        if (fetchedModels == null) {
            throw new GradleModelLoadError(
                    project,
                    fetchedModelsOrError.getBuildScriptEvaluationError(),
                    fetchedModelsOrError.getUnexpectedError());
View Full Code Here

TOP

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

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.