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