Search in sources :

Example 16 with JSTestOptions

use of com.intellij.lang.javascript.JSTestOptions in project intellij-plugins by JetBrains.

the class ActionScriptCompletionInTextFieldTest method testChangeSignatureReturnType.

@JSTestOptions({ JSTestOption.WithFlexSdk })
public void testChangeSignatureReturnType() throws Exception {
    configureByFiles(null, BASE_PATH + getTestName(false) + "_2.js2");
    JSFunction function = createFakeFunction();
    JSExpressionCodeFragment fragment = JSChangeSignatureDialog.createReturnTypeCodeFragment(new JSMethodDescriptor(function, false).getReturnType(), function, JavaScriptSupportLoader.ECMA_SCRIPT_L4);
    String[] included = new String[] { "Z111", "Z222", "int", "String", "uint", "Number", "EventDispatcher", "void", "*" };
    String[] excluded = ArrayUtil.mergeArrays(DEFALUT_VALUES, "public", "function", "while");
    checkTextFieldCompletion(fragment, included, excluded, "Z111", BASE_PATH + getTestName(false) + ".txt");
}
Also used : JSFunction(com.intellij.lang.javascript.psi.JSFunction) JSMethodDescriptor(com.intellij.lang.javascript.refactoring.changeSignature.JSMethodDescriptor) JSExpressionCodeFragment(com.intellij.lang.javascript.psi.JSExpressionCodeFragment) JSTestOptions(com.intellij.lang.javascript.JSTestOptions)

Example 17 with JSTestOptions

use of com.intellij.lang.javascript.JSTestOptions in project intellij-plugins by JetBrains.

the class ActionScriptCompletionInTextFieldTest method testPackageNameCombo2.

@JSTestOptions({ JSTestOption.WithFlexSdk })
public void testPackageNameCombo2() throws Exception {
    configureByFiles(null, BASE_PATH + getTestName(false) + "_2.js2");
    PsiFile fragment = JSReferenceEditor.forPackageName("", myProject, "", GlobalSearchScope.projectScope(myProject), "").getPsiFile();
    String[] included = new String[] { "foo" };
    String[] excluded = new String[] { "public", "function", "while", "Z111", "Z222", "int", "String", "uint", "Number", "EventDispatcher" };
    checkTextFieldCompletion((JSExpressionCodeFragment) fragment, included, excluded, "foo", BASE_PATH + getTestName(false) + ".txt");
}
Also used : PsiFile(com.intellij.psi.PsiFile) JSTestOptions(com.intellij.lang.javascript.JSTestOptions)

Example 18 with JSTestOptions

use of com.intellij.lang.javascript.JSTestOptions in project intellij-plugins by JetBrains.

the class FlexCssNavigationTest method testCssTypeReference1.

@JSTestOptions({ JSTestOption.WithCssSupportLoader, JSTestOption.WithFlexFacet, JSTestOption.WithGumboSdk })
public void testCssTypeReference1() throws Exception {
    PsiElement[] elements = findTargetElements(getTestName(false) + ".css");
    assertEquals(1, elements.length);
    assertInstanceOf(elements[0], JSAttributeNameValuePair.class);
    final JSClass jsClass = PsiTreeUtil.getParentOfType(elements[0], JSClass.class);
    assertNotNull(jsClass);
    assertEquals(jsClass.getQualifiedName(), "spark.components.Button");
}
Also used : JSClass(com.intellij.lang.javascript.psi.ecmal4.JSClass) PsiElement(com.intellij.psi.PsiElement) JSTestOptions(com.intellij.lang.javascript.JSTestOptions)

Example 19 with JSTestOptions

use of com.intellij.lang.javascript.JSTestOptions in project intellij-plugins by JetBrains.

the class FlexMoveTest method testConfigUpdatedOnPackageMove.

@JSTestOptions({ JSTestOption.WithFlexFacet })
public void testConfigUpdatedOnPackageMove() throws Exception {
    FlexTestUtils.modifyBuildConfiguration(myModule, bc -> bc.setMainClass("foo.SomeClass"));
    final RunManager runManager = RunManager.getInstance(myProject);
    FlexTestUtils.createFlexUnitRunConfig(runManager, "SomeClass.testSomething()", myModule, FlexUnitRunnerParameters.Scope.Method, "", "foo.SomeClass", "testSomething", true);
    FlexTestUtils.createFlexUnitRunConfig(runManager, "SomeClass", myModule, FlexUnitRunnerParameters.Scope.Class, "", "foo.SomeClass", "", true);
    FlexTestUtils.createFlexUnitRunConfig(runManager, "foo", myModule, FlexUnitRunnerParameters.Scope.Package, "foo", "", "", true);
    FlexTestUtils.createFlashRunConfig(runManager, myModule, "SomeClass", "foo.SomeClass", true);
    doTest("foo", "bar");
    assertEquals("bar.foo.SomeClass", FlexBuildConfigurationManager.getInstance(myModule).getActiveConfiguration().getMainClass());
    FlexTestUtils.checkFlexUnitRunConfig(runManager, myModule, "SomeClass.testSomething()", "", "bar.foo.SomeClass", "testSomething");
    FlexTestUtils.checkFlexUnitRunConfig(runManager, myModule, "SomeClass", "", "bar.foo.SomeClass", "");
    FlexTestUtils.checkFlexUnitRunConfig(runManager, myModule, "bar.foo", "bar.foo", "", "");
    FlexTestUtils.checkFlashRunConfig(runManager, myModule, "SomeClass", "bar.foo.SomeClass");
}
Also used : RunManager(com.intellij.execution.RunManager) JSTestOptions(com.intellij.lang.javascript.JSTestOptions)

Example 20 with JSTestOptions

use of com.intellij.lang.javascript.JSTestOptions in project intellij-plugins by JetBrains.

the class FlexMoveTest method testConfigUpdatedOnClassMove.

@JSTestOptions({ JSTestOption.WithFlexFacet })
public void testConfigUpdatedOnClassMove() throws Exception {
    final RunManager runManager = RunManager.getInstance(myProject);
    FlexTestUtils.createFlexUnitRunConfig(runManager, "SomeClass.testSomething()", myModule, FlexUnitRunnerParameters.Scope.Method, "", "foo.bar.SomeClass", "testSomething", true);
    FlexTestUtils.createFlexUnitRunConfig(runManager, "SomeClass", myModule, FlexUnitRunnerParameters.Scope.Class, "", "foo.bar.SomeClass", "", true);
    FlexTestUtils.createFlashRunConfig(runManager, myModule, "SomeClass", "foo.bar.SomeClass", true);
    doTest("foo/bar/SomeClass.mxml", "");
    //assertEquals("SomeClass", config.MAIN_CLASS);
    FlexTestUtils.checkFlexUnitRunConfig(runManager, myModule, "SomeClass.testSomething()", "", "SomeClass", "testSomething");
    FlexTestUtils.checkFlexUnitRunConfig(runManager, myModule, "SomeClass", "", "SomeClass", "");
    FlexTestUtils.checkFlashRunConfig(runManager, myModule, "SomeClass", "SomeClass");
}
Also used : RunManager(com.intellij.execution.RunManager) JSTestOptions(com.intellij.lang.javascript.JSTestOptions)

Aggregations

JSTestOptions (com.intellij.lang.javascript.JSTestOptions)59 VirtualFile (com.intellij.openapi.vfs.VirtualFile)20 PsiFile (com.intellij.psi.PsiFile)12 PsiElement (com.intellij.psi.PsiElement)11 JSExpressionCodeFragment (com.intellij.lang.javascript.psi.JSExpressionCodeFragment)5 File (java.io.File)5 CssDocumentationProvider (com.intellij.psi.css.impl.util.CssDocumentationProvider)4 THashMap (gnu.trove.THashMap)4 GutterMark (com.intellij.codeInsight.daemon.GutterMark)3 FlexDocumentationProvider (com.intellij.javascript.flex.FlexDocumentationProvider)3 DocumentationProvider (com.intellij.lang.documentation.DocumentationProvider)3 JSDocumentationProvider (com.intellij.lang.javascript.documentation.JSDocumentationProvider)3 JSCodeStyleSettings (com.intellij.lang.javascript.formatter.JSCodeStyleSettings)3 JSClass (com.intellij.lang.javascript.psi.ecmal4.JSClass)3 Sdk (com.intellij.openapi.projectRoots.Sdk)3 SdkModificator (com.intellij.openapi.projectRoots.SdkModificator)3 LookupElement (com.intellij.codeInsight.lookup.LookupElement)2 RunManager (com.intellij.execution.RunManager)2 ModifiableFlexBuildConfiguration (com.intellij.lang.javascript.flex.projectStructure.model.ModifiableFlexBuildConfiguration)2 ECMA4CodeStyleSettings (com.intellij.lang.javascript.formatter.ECMA4CodeStyleSettings)2