Search in sources :

Example 1 with FlexUnitTestCreator

use of com.intellij.lang.javascript.flex.flexunit.FlexUnitTestCreator in project intellij-plugins by JetBrains.

the class FlexHighlightingTest method testGenerateTestClass.

@JSTestOptions({ JSTestOption.WithFlexFacet, JSTestOption.WithFlexUnit4 })
public void testGenerateTestClass() throws Exception {
    JSTestUtils.disableFileHeadersInTemplates(getProject());
    final String testName = getTestName(false);
    configureByFiles(BASE_PATH + "/" + testName, BASE_PATH + "/" + testName + "/pack/" + testName + ".mxml");
    final FlexUnitTestCreator testCreator = new FlexUnitTestCreator();
    assertTrue(testCreator.isAvailable(myProject, myEditor, myFile));
    testCreator.createTest(myProject, myEditor, myFile);
    final VirtualFile testClassFile = ModuleRootManager.getInstance(myModule).getSourceRoots()[0].findFileByRelativePath("pack/" + testName + "Test.as");
    myEditor = FileEditorManager.getInstance(myProject).openTextEditor(new OpenFileDescriptor(myProject, testClassFile), true);
    myFile = PsiDocumentManager.getInstance(myProject).getPsiFile(myEditor.getDocument());
    checkResultByFile(BASE_PATH + "/" + testName + "/pack/" + testName + "_after.as");
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) FlexUnitTestCreator(com.intellij.lang.javascript.flex.flexunit.FlexUnitTestCreator) OpenFileDescriptor(com.intellij.openapi.fileEditor.OpenFileDescriptor)

Aggregations

FlexUnitTestCreator (com.intellij.lang.javascript.flex.flexunit.FlexUnitTestCreator)1 OpenFileDescriptor (com.intellij.openapi.fileEditor.OpenFileDescriptor)1 VirtualFile (com.intellij.openapi.vfs.VirtualFile)1