package org.jetbrains.plugins.scala.refactoring.introduceVariable;

import com.intellij.openapi.module.Module;
import com.intellij.openapi.module.ModuleManager;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.projectRoots.JavaSdk;
import com.intellij.openapi.projectRoots.Sdk;
import junit.framework.Test;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.plugins.scala.base.ScalaLibraryLoader;
import org.jetbrains.plugins.scala.util.TestUtils;
import scala.Option$;

/**
 * @author Alexander Podkhalyuzin
 */
public class IntroduceVariableTest extends AbstractIntroduceVariableTestBase {
  @NonNls
  private static final String DATA_PATH = "/introduceVariable/data";

  public IntroduceVariableTest() {
    super(TestUtils.getTestDataPath() + DATA_PATH);
  }

  public static Test suite() {
    return new IntroduceVariableTest();
  }

  @Override
  protected void setUp(Project project) {
    super.setUp(project);
    Module[] modules = ModuleManager.getInstance(project).getModules();
    Sdk sdk = JavaSdk.getInstance().createJdk("java sdk", TestUtils.getMockJdk(), false);
    ScalaLibraryLoader loader = new ScalaLibraryLoader(project, modules[0], null, false, false, Option$.MODULE$.apply(sdk));
    loader.loadLibrary(TestUtils.DEFAULT_SCALA_SDK_VERSION);
  }
}

@@ -291,24 +291,83 @@
 tRoots.Sdk;%0A
+import com.intellij.openapi.vfs.newvfs.impl.VfsRootAccess;%0A
 import junit
@@ -1079,16 +1079,105 @@
 ules();%0A
+    String mockJdk = TestUtils.getMockJdk();%0A    VfsRootAccess.allowRootAccess(mockJdk);%0A
     Sdk 
@@ -1226,38 +1226,23 @@
 a sdk%22, 
-TestUtils.getM
+m
 ockJdk
-()
 , false)

Allow root access for mock jdk in introduce variable test