Package com.intellij.javascript.testFramework

Examples of com.intellij.javascript.testFramework.TestFileStructurePack


    }
    JSFile jsFile = ObjectUtils.tryCast(PsiManager.getInstance(project).findFile(jsTestVirtualFile), JSFile.class);
    if (jsFile == null) {
      return;
    }
    TestFileStructurePack pack = TestFileStructureManager.fetchTestFileStructurePackByJsFile(jsFile);
    if (pack != null) {
      for (Object topLevel : pack.getTopLevelElements()) {
        myTestCaseNameComboBox.addItem(topLevel);
      }
    }
  }
View Full Code Here


    }
    JSFile jsFile = ObjectUtils.tryCast(PsiManager.getInstance(project).findFile(jsTestVirtualFile), JSFile.class);
    if (jsFile == null) {
      return;
    }
    TestFileStructurePack pack = TestFileStructureManager.fetchTestFileStructurePackByJsFile(jsFile);
    if (pack != null) {
      List<String> testMethodNames = pack.getChildrenOf(testCaseName);
      for (String testMethodName : testMethodNames) {
        myTestMethodNameComboBox.addItem(testMethodName);
      }
    }
  }
View Full Code Here

    }
    JSFile jsFile = ObjectUtils.tryCast(PsiManager.getInstance(project).findFile(jsTestVirtualFile), JSFile.class);
    if (jsFile == null) {
      throw new RuntimeConfigurationWarning("Wrong JavaScript test file.");
    }
    TestFileStructurePack pack = TestFileStructureManager.fetchTestFileStructurePackByJsFile(jsFile);
    if (pack != null) {
      boolean found = pack.contains(runSettings.getTestCaseName(), null, JstdTestMethodNameRefiner.INSTANCE);
      if (!found) {
        throw new RuntimeConfigurationWarning("Can't find test case with name '" + runSettings.getTestCaseName() + "'.");
      }
      return pack;
    }
View Full Code Here

    return null;
  }

  private static void verifyTestMethod(@NotNull Project project,
                                       @NotNull JstdRunSettings runSettings) throws RuntimeConfigurationException {
    TestFileStructurePack pack = verifyTestCase(project, runSettings);
    if (runSettings.getTestMethodName().isEmpty()) {
      throw new RuntimeConfigurationError("Test method name is empty.");
    }
    if (pack != null) {
      boolean found = pack.contains(runSettings.getTestCaseName(),
                                    runSettings.getTestMethodName(),
                                    JstdTestMethodNameRefiner.INSTANCE);
      if (!found) {
        throw new RuntimeConfigurationWarning("Can't find test method with name '" + runSettings.getTestMethodName() + "'.");
      }
View Full Code Here

      }
      VirtualFile virtualFile = jsFile.getVirtualFile();
      if (virtualFile == null || virtualFile.getFileType() != JavaScriptSupportLoader.JAVASCRIPT) {
        return null;
      }
      TestFileStructurePack pack = TestFileStructureManager.fetchTestFileStructurePackByJsFile(jsFile);
      if (pack == null) {
        return null;
      }
      JstdRunElement jstdRunElement = pack.getJstdRunElement(psiElement);
      if (jstdRunElement != null) {
        Project project = jsFile.getProject();
        JstdRunSettings.Builder builder = new JstdRunSettings.Builder();
        builder.setJSFilePath(getPath(virtualFile));
        builder.setTestCaseName(jstdRunElement.getTestCaseName());
View Full Code Here

        VirtualFile virtualFile = VfsUtil.findFileByIoFile(jsFile, true);
        if (virtualFile != null) {
          PsiFile psiFile = PsiManager.getInstance(project).findFile(virtualFile);
          if (psiFile instanceof JSFile) {
            JSFile jsPsiFile = (JSFile) psiFile;
            TestFileStructurePack pack = TestFileStructureManager.fetchTestFileStructurePackByJsFile(jsPsiFile);
            if (pack != null) {
              List<String> testCases = pack.getTopLevelElements();
              if (testCases.isEmpty()) {
                throw new ExecutionException("No tests found in " + jsPsiFile.getName());
              }
              Map<String, Set<String>> scope = ContainerUtil.newHashMap();
              for (String testCase : testCases) {
View Full Code Here

    PsiFile psiFile = PsiManager.getInstance(project).findFile(jsTestVirtualFile);
    if (!(psiFile instanceof JSFile)) {
      return null;
    }
    JSFile jsFile = (JSFile) psiFile;
    TestFileStructurePack pack = TestFileStructureManager.fetchTestFileStructurePackByJsFile(jsFile);
    if (pack != null) {
      return pack.findPsiElement(testCaseName, testMethodName, testMethodNameRefiner);
    }
    return null;
  }
View Full Code Here

TOP

Related Classes of com.intellij.javascript.testFramework.TestFileStructurePack

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.