IDEA-76142: Gradle support - cannot update IDEA projects once one of build.gradle... idea/112.655
authorDenis.Zhdanov <Denis.Zhdanov@jetbrains.com>
Tue, 31 Jan 2012 14:07:54 +0000 (18:07 +0400)
committerDenis.Zhdanov <Denis.Zhdanov@jetbrains.com>
Tue, 31 Jan 2012 14:10:20 +0000 (18:10 +0400)
1. Explicit method call syntax is applied (server compilation fails otherwise);
2. Comments are added;

plugins/gradle/testSources/org/jetbrains/plugins/gradle/sync/GradleProjectStructureChangesModelTest.groovy
plugins/gradle/testSources/org/jetbrains/plugins/gradle/testutil/ProjectStructureChecker.groovy

index b806804cff6039a03e3e7f8a2899d6d244970d60..efb25809b82fa6c611bf2ded46aca4f2e74989f7 100644 (file)
@@ -55,6 +55,7 @@ public class GradleProjectStructureChangesModelTest {
   
   @Test
   public void mergeGradleLocalToIntellij() {
+    // Configure initial projects state.
     init(
       gradle {
         module {
@@ -70,6 +71,7 @@ public class GradleProjectStructureChangesModelTest {
       } } }
     )
     
+    // Check that the initial projects state is correctly parsed.
     checkChanges {
       presence {
         lib(gradle: gradle.modules.dependencies.flatten().findAll { it.name == "lib2" })
@@ -82,11 +84,14 @@ public class GradleProjectStructureChangesModelTest {
             lib2('gradle')
     } } } }
 
+    // Define changed project state.
     gradle {
       module {
         dependencies {
           lib(name: "lib1")
     } } }
+    
+    // Apply the changed project state and check if it's correctly parsed.
     changesModel.update(gradle.project)
     assertEquals([].toSet(), changesModel.changes)
     checkTree {
index efecadcf756321edaecdc45b6b85747c722e52df..88decefa8a0025e1c198892af95eaa90513dcf32 100644 (file)
@@ -38,7 +38,7 @@ class ProjectStructureChecker {
       check it as Node, actual.getChildAt(childIndex++) as DefaultMutableTreeNode
     }
     if (childIndex < actual.childCount) {
-      fail("Unexpected nodes detected: ${(childIndex..<actual.childCount).collect { actual.getChildAt(it) } join '-'}")
+      fail("Unexpected nodes detected: ${(childIndex..<actual.childCount).collect { actual.getChildAt(it) }.join('-')}")
     }
   }