use of com.intellij.lang.javascript.JSTestOptions in project intellij-plugins by JetBrains.
the class FlexNavigationTest method testMonkeyPatching.
@JSTestOptions({ JSTestOption.WithFlexSdk })
public void testMonkeyPatching() throws Exception {
final String testName = getTestName(false);
myAfterCommitRunnable = () -> {
final VirtualFile sdkSrc = LocalFileSystem.getInstance().findFileByPath(getTestDataPath() + BASE_PATH + testName + "_sdk_src");
final SdkModificator sdkModificator = FlexTestUtils.getFlexSdkModificator(myModule);
sdkModificator.addRoot(sdkSrc, OrderRootType.SOURCES);
sdkModificator.commitChanges();
};
configureByFiles(BASE_PATH + testName, BASE_PATH + testName + "/" + testName + ".as", BASE_PATH + testName + "/mx/events/FlexEvent.as");
final VirtualFile expectedFile = LocalFileSystem.getInstance().findFileByPath(ModuleRootManager.getInstance(myModule).getSourceRoots()[0].getPath() + "/mx/events/FlexEvent.as");
assert expectedFile != null;
final PsiReference reference = TargetElementUtil.findReference(myEditor);
assertNotNull(reference);
final Collection<PsiElement> candidates = TargetElementUtil.getInstance().getTargetCandidates(reference);
assertEquals(1, candidates.size());
doCheck(candidates.iterator().next(), expectedFile, expectedFile, null);
}
use of com.intellij.lang.javascript.JSTestOptions in project intellij-plugins by JetBrains.
the class FlexNavigationTest method testLibraryClass2.
@JSTestOptions({ JSTestOption.WithFlexSdk })
public void testLibraryClass2() throws Exception {
final String libWithAsDocSwc = "TestLib3.swc";
myAfterCommitRunnable = () -> {
FlexTestUtils.addLibrary(myModule, "Lib", getTestDataPath() + BASE_PATH, "TestLib1.swc", null, null);
FlexTestUtils.addLibrary(myModule, "LibWithAsdoc", getTestDataPath() + BASE_PATH, libWithAsDocSwc, null, "TestLibAsdoc.zip");
};
final VirtualFile forAsdoc = getFile(libWithAsDocSwc + "!/library.swf");
doTest("LibraryClass.as", null, forAsdoc);
}
use of com.intellij.lang.javascript.JSTestOptions in project intellij-plugins by JetBrains.
the class FlexNavigationTest method testIncludes.
@JSTestOptions({ JSTestOption.WithCssSupportLoader, JSTestOption.WithFlexFacet })
public void testIncludes() throws Exception {
VirtualFile vFile = configureByFiles(null, BASE_PATH + "Includes.css", BASE_PATH + "Includes.as", BASE_PATH + "Includes1.as");
VirtualFile file = vFile.getParent().findChild("Includes1.as");
doTest(file, file, null);
}
use of com.intellij.lang.javascript.JSTestOptions in project intellij-plugins by JetBrains.
the class FlexDocumentationTest method testExternalDoc1.
@JSTestOptions({ JSTestOption.WithJsSupportLoader, JSTestOption.WithFlexSdk })
public void testExternalDoc1() throws Exception {
String fullName = BASE_PATH + getTestName(false);
final String[] files = { fullName + ".mxml" };
VirtualFile swc = LocalFileSystem.getInstance().findFileByPath(getTestDataPath() + BASE_PATH + "CustomSdk.swc");
swc = JarFileSystem.getInstance().getJarRootForLocalFile(swc);
VirtualFile asdoc = HttpFileSystem.getInstance().findFileByPath("livedocs.adobe.com/flex/3/langref");
FlexTestUtils.setupCustomSdk(myModule, swc, null, asdoc);
doTest(files, getTestName(false), false, Check.Url);
}
use of com.intellij.lang.javascript.JSTestOptions in project intellij-plugins by JetBrains.
the class FlexDocumentationTest method testFlexCssSelector.
@JSTestOptions({ JSTestOption.WithCssSupportLoader, JSTestOption.WithFlexFacet })
public void testFlexCssSelector() throws Exception {
DocumentationProvider cssDocumentationProvider = new CssDocumentationProvider();
PsiElement docElement = getDocElementForLookupItem(cssDocumentationProvider, getTestName(false) + ".css");
assertInstanceOf(docElement, JSClass.class);
}
Aggregations