package com.intellij.flex.intentions; import com.intellij.codeInspection.LocalInspectionTool; import com.intellij.flex.util.FlexTestUtils; import com.intellij.javascript.flex.css.FlexStylesIndexableSetContributor; import com.intellij.javascript.flex.mxml.schema.FlexSchemaHandler; import com.intellij.lang.javascript.BaseJSIntentionTestCase; import com.intellij.lang.javascript.JSTestOption; import com.intellij.lang.javascript.JSTestOptions; import com.intellij.lang.javascript.flex.FlexModuleType; import com.intellij.lang.javascript.inspections.actionscript.JSFieldCanBeLocalInspection; import com.intellij.openapi.module.ModuleType; import com.intellij.openapi.vfs.newvfs.impl.VfsRootAccess; import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NotNull; import static com.intellij.openapi.vfs.VfsUtilCore.convertFromUrl; import static com.intellij.openapi.vfs.VfsUtilCore.urlToPath; public class FlexConvertToLocalTest extends BaseJSIntentionTestCase { @Override protected void setUp() throws Exception { VfsRootAccess.allowRootAccess(getTestRootDisposable(), urlToPath(convertFromUrl(FlexSchemaHandler.class.getResource("z.xsd"))), urlToPath(convertFromUrl(FlexStylesIndexableSetContributor.class.getResource("FlexStyles.as")))); super.setUp(); } @Override protected ModuleType getModuleType() { return FlexModuleType.getInstance(); } @Override protected LocalInspectionTool[] configureLocalInspectionTools() { return new LocalInspectionTool[]{new JSFieldCanBeLocalInspection()}; } @Override @NonNls public String getBasePath() { return "/convertToLocal"; } @NotNull @Override public String getTestDataPath() { return FlexTestUtils.getTestDataPath(""); } @Override protected void setUpJdk() { FlexTestUtils.setupFlexSdk(myModule, getTestName(false), getClass()); } @JSTestOptions({JSTestOption.WithFlexFacet, JSTestOption.WithGumboSdk}) public void testAll() throws Exception { doTestAll(); } }