use of org.gradle.foundation.BuildInformation in project gradle by gradle.
the class FavoritesIntegrationTest method setUp.
@Before
public void setUp() throws Exception {
context = new JUnit4Mockery();
Task subsubCompileTask = TestUtility.createTask(context, "compile", "compile description");
Task subsubLibTask = TestUtility.createTask(context, "lib", "lib description");
Task subsubDocTask = TestUtility.createTask(context, "doc", "doc description");
Project subsubProject = TestUtility.createMockProject(context, "mysubsubproject", "filepath3", 2, null, new Task[] { subsubCompileTask, subsubLibTask, subsubDocTask }, null);
Task subCompileTask1 = TestUtility.createTask(context, "compile", "compile description");
Task subLibTask1 = TestUtility.createTask(context, "lib", "lib description");
Task subDocTask1 = TestUtility.createTask(context, "doc", "doc description");
Project subProject1 = TestUtility.createMockProject(context, "mysubproject1", "filepath2a", 1, new Project[] { subsubProject }, new Task[] { subCompileTask1, subLibTask1, subDocTask1 }, null);
Task subCompileTask2 = TestUtility.createTask(context, "compile", "compile description");
Task subLibTask2 = TestUtility.createTask(context, "lib", "lib description");
Task subDocTask2 = TestUtility.createTask(context, "doc", "doc description");
Project subProject2 = TestUtility.createMockProject(context, "mysubproject2", "filepath2b", 1, null, new Task[] { subCompileTask2, subLibTask2, subDocTask2 }, null);
Project rootProject = TestUtility.createMockProject(context, "myrootproject", "filepath1", 0, new Project[] { subProject1, subProject2 }, null, null);
buildInformation = new BuildInformation(rootProject);
//now get the converted objects to simplify our matching
myRootProject = buildInformation.getProjectFromFullPath("myrootproject");
Assert.assertNotNull(myRootProject);
mySubProject1 = buildInformation.getProjectFromFullPath("myrootproject:mysubproject1");
Assert.assertNotNull(mySubProject1);
mySubProject1Comple = buildInformation.getTaskFromFullPath("myrootproject:mysubproject1:compile");
Assert.assertNotNull(mySubProject1Comple);
mySubProject1Lib = buildInformation.getTaskFromFullPath("myrootproject:mysubproject1:lib");
Assert.assertNotNull(mySubProject1Lib);
mySubProject1Doc = buildInformation.getTaskFromFullPath("myrootproject:mysubproject1:doc");
Assert.assertNotNull(mySubProject1Doc);
mySubSubProject = buildInformation.getProjectFromFullPath("myrootproject:mysubproject1:mysubsubproject");
Assert.assertNotNull(mySubSubProject);
mySubSubProjectCompile = buildInformation.getTaskFromFullPath("myrootproject:mysubproject1:mysubsubproject:compile");
Assert.assertNotNull(mySubSubProjectCompile);
mySubSubProjectLib = buildInformation.getTaskFromFullPath("myrootproject:mysubproject1:mysubsubproject:lib");
Assert.assertNotNull(mySubSubProjectLib);
mySubSubProjectDoc = buildInformation.getTaskFromFullPath("myrootproject:mysubproject1:mysubsubproject:doc");
Assert.assertNotNull(mySubSubProjectDoc);
mySubProject2 = buildInformation.getProjectFromFullPath("myrootproject:mysubproject2");
Assert.assertNotNull(mySubProject2);
mySubProject2Compile = buildInformation.getTaskFromFullPath("myrootproject:mysubproject2:compile");
Assert.assertNotNull(mySubProject2Compile);
mySubProject2Lib = buildInformation.getTaskFromFullPath("myrootproject:mysubproject2:lib");
Assert.assertNotNull(mySubProject2Lib);
mySubProject2doc = buildInformation.getTaskFromFullPath("myrootproject:mysubproject2:doc");
Assert.assertNotNull(mySubProject2doc);
}
Aggregations