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");
}
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");
}
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");
}
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");
}
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");
}
Aggregations