gradle: test added for TestModuleProperties importing appcode/144.3368 clion/144.3367
authorVladislav.Soroka <Vladislav.Soroka@jetbrains.com>
Tue, 26 Jan 2016 11:45:03 +0000 (14:45 +0300)
committerVladislav.Soroka <Vladislav.Soroka@jetbrains.com>
Tue, 26 Jan 2016 11:51:59 +0000 (14:51 +0300)
plugins/gradle/testSources/org/jetbrains/plugins/gradle/importing/GradleMiscImportingTest.java

index 605c34f4f9432f36b764d399c75d9116039f1d1c..c28a1745846c89f6f9857f2ea5682d9a24904ad1 100644 (file)
 package org.jetbrains.plugins.gradle.importing;
 
 import com.intellij.compiler.CompilerConfiguration;
-import com.intellij.openapi.roots.*;
-import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.openapi.module.Module;
+import com.intellij.openapi.roots.LanguageLevelModuleExtensionImpl;
+import com.intellij.openapi.roots.ModuleRootManager;
+import com.intellij.openapi.roots.TestModuleProperties;
 import com.intellij.pom.java.LanguageLevel;
-import com.intellij.util.PathUtil;
-import org.gradle.util.GradleVersion;
 import org.junit.Test;
 import org.junit.runners.Parameterized;
 
 import java.util.Arrays;
 import java.util.Collection;
-import java.util.List;
 
 /**
  * @author Vladislav.Soroka
@@ -44,6 +43,21 @@ public class GradleMiscImportingTest extends GradleImportingTestCase {
     return Arrays.asList(new Object[][]{{BASE_GRADLE_VERSION}});
   }
 
+  @Test
+  public void testTestModuleProperties() throws Exception {
+    importProject(
+      "apply plugin: 'java'"
+    );
+
+    assertModules("project", "project_main", "project_test");
+
+    final Module testModule = getModule("project_test");
+    TestModuleProperties testModuleProperties = TestModuleProperties.getInstance(testModule);
+    assertEquals("project_main", testModuleProperties.getProductionModuleName());
+
+    final Module productionModule = getModule("project_main");
+    assertSame(productionModule, testModuleProperties.getProductionModule());
+  }
 
   @Test
   public void testInheritProjectJdkForModules() throws Exception {