Examples of GherkinFile


Examples of org.jetbrains.plugins.cucumber.psi.GherkinFile

    AnnotationPackageProvider provider = new AnnotationPackageProvider(versionProvider);
    return provider.getAnnotationPackageFor(createStepIn(language));
  }

  private static GherkinStep createStepIn(String language) {
    GherkinFile featureFile = EasyMock.createNiceMock(GherkinFile.class);
    expect(featureFile.getLocaleLanguage()).andReturn(language).anyTimes();

    GherkinStep step = EasyMock.createNiceMock(GherkinStep.class);
    expect(step.getContainingFile()).andReturn(featureFile).anyTimes();

    replay(featureFile, step);
View Full Code Here

Examples of org.jetbrains.plugins.cucumber.psi.GherkinFile

    if (!(probableGherkinFile instanceof GherkinFile)) {
      return;
    }

    final Set<String> createdStepDefPatterns = new HashSet<String>();
    final GherkinFile gherkinFile = (GherkinFile)probableGherkinFile;
    for (GherkinFeature feature : gherkinFile.getFeatures()) {
      for (GherkinStepsHolder stepsHolder : feature.getScenarios()) {
        for (GherkinStep step : stepsHolder.getSteps()) {
          final PsiReference[] references = step.getReferences();
          for (PsiReference reference : references) {
            if (!(reference instanceof CucumberStepReference)) continue;
View Full Code Here

Examples of org.jetbrains.plugins.cucumber.psi.GherkinFile

  @Override
  public List<? extends GotoRelatedItem> getItems(@NotNull PsiElement psiElement) {
    final PsiFile file = psiElement.getContainingFile();
    if (file instanceof GherkinFile) {
      final List<GherkinStep> steps = new ArrayList<GherkinStep>();
      final GherkinFile gherkinFile = (GherkinFile)file;
      final GherkinFeature[] features = gherkinFile.getFeatures();
      for (GherkinFeature feature : features) {
        final GherkinStepsHolder[] stepHolders = feature.getScenarios();
        for (GherkinStepsHolder stepHolder : stepHolders) {
          Collections.addAll(steps, stepHolder.getSteps());
        }
View Full Code Here

Examples of org.jetbrains.plugins.cucumber.psi.GherkinFile

    return getName();
  }

  public void applyFix(@NotNull final Project project, @NotNull ProblemDescriptor descriptor) {
    final GherkinStep step = (GherkinStep)descriptor.getPsiElement();
    final GherkinFile featureFile = (GherkinFile)step.getContainingFile();
    // TODO + step defs pairs from other content roots
    //Tree is used to prevent duplicates (if several frameworks take care about one file)
    final SortedSet<Pair<PsiFile, BDDFrameworkType>> pairSortedSet = ContainerUtilRt.newTreeSet(FILE_FRAMEWORK_COMPARATOR);
    pairSortedSet.addAll(getStepDefinitionContainers(featureFile));
    final List<Pair<PsiFile, BDDFrameworkType>> pairs = ContainerUtil.newArrayList(pairSortedSet);
View Full Code Here

Examples of org.jetbrains.plugins.cucumber.psi.GherkinFile

  public String getAnnotationPackageFor(GherkinStep step) {
    return format("%s.%s", annotationBasePackage(step), locale(step));
  }

  private static String locale(GherkinStep step) {
    GherkinFile file = (GherkinFile)step.getContainingFile();
    return file.getLocaleLanguage().replaceAll("-", "_");
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.