当前位置: 首页>>代码示例>>Java>>正文


Java Feature类代码示例

本文整理汇总了Java中gherkin.formatter.model.Feature的典型用法代码示例。如果您正苦于以下问题:Java Feature类的具体用法?Java Feature怎么用?Java Feature使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Feature类属于gherkin.formatter.model包,在下文中一共展示了Feature类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: findTestClassesLevel

import gherkin.formatter.model.Feature; //导入依赖的package包/类
/**
 * <p>
 * Find Test classes level<p>
 * JUnit`s test {@link Description} is multilevel object with liquid
 * hierarchy.<br>
 * This method recursively query
 * {@link #getTestEntityType(org.junit.runner.Description)} method until it
 * matches {@link Feature} type and when returns parent of this object as
 * list of test classes descriptions
 *
 * @param description {@link Description} Description to start search where
 * @return {@link List<Description>} test classes description list
 * @throws IllegalAccessException
 */
public List<Description> findTestClassesLevel(List<Description> description) throws IllegalAccessException {
    if (description.isEmpty()) {
        return new ArrayList<>();
    }
    Object possibleClass = getTestEntityType(description.get(0));
    if (possibleClass instanceof String && !((String) possibleClass).isEmpty()) {
        if (!description.get(0).getChildren().isEmpty()) {
            Object possibleFeature = getTestEntityType(description.get(0).getChildren().get(0));
            if (possibleFeature instanceof Feature) {
                return description;
            } else {
                return findTestClassesLevel(description.get(0).getChildren());
            }
        } else {
            //No scenarios in feature
            return description;
        }

    } else {
        return findTestClassesLevel(description.get(0).getChildren());
    }

}
 
开发者ID:allure-framework,项目名称:allure-cucumberjvm,代码行数:38,代码来源:AllureRunListener.java

示例2: describeChild

import gherkin.formatter.model.Feature; //导入依赖的package包/类
@Override
protected Description describeChild(KarateFeature child) {
    Description description = descriptions.get(child.getFeature().getPath());
    if (description != null) {
        return description;
    }
    Feature feature = child.getFeature().getGherkinFeature();
    String name = feature.getKeyword() + ": " + feature.getName();
    return Description.createSuiteDescription(name, feature);
}
 
开发者ID:intuit,项目名称:karate,代码行数:11,代码来源:Karate.java

示例3: rename

import gherkin.formatter.model.Feature; //导入依赖的package包/类
private Feature rename(Feature f) {
    String name = uri; // swap
    String description = f.getName();
    String extra = StringUtils.trimToNull(f.getDescription());
    if (extra != null) {
        description = description + '\n' + extra;
    }
    return new Feature(f.getComments(), f.getTags(), f.getKeyword(), name, description, f.getLine(), f.getId());
}
 
开发者ID:intuit,项目名称:karate,代码行数:10,代码来源:KarateJunitAndJsonReporter.java

示例4: with_Feature_comment_should_escape_double_sharp_lines

import gherkin.formatter.model.Feature; //导入依赖的package包/类
@Test
public void with_Feature_comment_should_escape_double_sharp_lines() throws Exception {
    FeatureWrapper featureWrapper = new FeatureWrapper("", new Feature(null, null, null, null, null, null, null));
    List<Comment> comments = newArrayList(new Comment("## foo", 42));
    featureWrapper.scenario(new Scenario(comments, null, null, null, null, null, null));

    assertThat(featureWrapper.getDescription()).isEmpty();
}
 
开发者ID:Arnauld,项目名称:cucumber-contrib,代码行数:9,代码来源:FeatureWrapperTest.java

示例5: StepUtils

import gherkin.formatter.model.Feature; //导入依赖的package包/类
StepUtils(final Feature feature, final Scenario scenario) {
    this.lifecycle = Allure.getLifecycle();
    this.feature = feature;
    this.scenario = scenario;
}
 
开发者ID:allure-framework,项目名称:allure-java,代码行数:6,代码来源:StepUtils.java

示例6: TagParser

import gherkin.formatter.model.Feature; //导入依赖的package包/类
TagParser(final Feature feature, final Scenario scenario) {
    this.feature = feature;
    this.scenario = scenario;
}
 
开发者ID:allure-framework,项目名称:allure-java,代码行数:5,代码来源:TagParser.java

示例7: LabelBuilder

import gherkin.formatter.model.Feature; //导入依赖的package包/类
LabelBuilder(final Feature feature, final Scenario scenario, final Deque<Tag> tags) {
    final TagParser tagParser = new TagParser(feature, scenario);

    getScenarioLabels().add(createFeatureLabel(feature.getName()));
    getScenarioLabels().add(createStoryLabel(scenario.getName()));

    while (tags.peek() != null) {
        final Tag tag = tags.remove();

        final String tagString = tag.getName();

        if (tagString.contains(COMPOSITE_TAG_DELIMITER)) {

            final String[] tagParts = tagString.split(COMPOSITE_TAG_DELIMITER, 2);
            if (StringUtils.isEmpty(tagParts[1])) {
                // skip empty tags, e.g. '@tmsLink=', to avoid formatter errors
                continue;
            }

            final String tagKey = tagParts[0].toUpperCase();
            final String tagValue = tagParts[1];

            // Handle composite named links
            if (tagKey.startsWith(PLAIN_LINK + ".")) {
                tryHandleNamedLink(tagString);
                continue;
            }

            switch (tagKey) {
                case SEVERITY:
                    getScenarioLabels().add(createSeverityLabel(tagValue.toLowerCase()));
                    break;
                case TMS_LINK:
                    getScenarioLinks().add(ResultsUtils.createTmsLink(tagValue));
                    break;
                case ISSUE_LINK:
                    getScenarioLinks().add(ResultsUtils.createIssueLink(tagValue));
                    break;
                case PLAIN_LINK:
                    getScenarioLinks().add(ResultsUtils.createLink(null, tagValue, tagValue, null));
                    break;
                default:
                    LOGGER.warn("Composite tag {} is not supported. adding it as RAW", tagKey);
                    getScenarioLabels().add(getTagLabel(tag));
                    break;
            }
        } else if (tagParser.isPureSeverityTag(tag)) {
            getScenarioLabels().add(createSeverityLabel(tagString.substring(1)));
        } else if (!tagParser.isResultTag(tag)) {
            getScenarioLabels().add(getTagLabel(tag));
        }
    }

    getScenarioLabels().add(new Label().withName("host").withValue(getHostName()));
    getScenarioLabels().add(new Label().withName("package").withValue(feature.getName()));
    getScenarioLabels().add(new Label().withName("suite").withValue(feature.getName()));
    getScenarioLabels().add(new Label().withName("testClass").withValue(scenario.getName()));
    getScenarioLabels().add(new Label().withName("thread").withValue(getThreadName()));

}
 
开发者ID:allure-framework,项目名称:allure-java,代码行数:61,代码来源:LabelBuilder.java

示例8: feature

import gherkin.formatter.model.Feature; //导入依赖的package包/类
@Override
public void feature(Feature f) {
    formatter.feature(f);
}
 
开发者ID:intuit,项目名称:karate,代码行数:5,代码来源:KarateHtmlReporter.java

示例9: feature

import gherkin.formatter.model.Feature; //导入依赖的package包/类
@Override
public void feature( Feature arg0 )
{

}
 
开发者ID:xframium,项目名称:xframium-java,代码行数:6,代码来源:XMLFormatter.java

示例10: getName

import gherkin.formatter.model.Feature; //导入依赖的package包/类
@Override
public String getName() {
   Feature feature = cucumberFeature.getGherkinFeature();
   return feature.getKeyword() + ": " + feature.getName();
}
 
开发者ID:LiamHayes1,项目名称:rest-cucumber,代码行数:6,代码来源:RestFeatureRunner.java

示例11: feature

import gherkin.formatter.model.Feature; //导入依赖的package包/类
@Override
public void feature(Feature arg0) {
	currentFeature = arg0.toMap();
}
 
开发者ID:domgold,项目名称:asciidoctor-gherkin-extension,代码行数:5,代码来源:MapFormatter.java

示例12: feature

import gherkin.formatter.model.Feature; //导入依赖的package包/类
@Override
public void feature(Feature arg0) {
	wrapped.feature(arg0);
}
 
开发者ID:gfk-ba,项目名称:senbot,代码行数:5,代码来源:WrappedJSONFormatter.java

示例13: ParameterizedCucumber

import gherkin.formatter.model.Feature; //导入依赖的package包/类
/**
	 * Constructor looping though the {@link Parameterized} {@link Runner}'s and
	 * adding the {@link CucumberFeature}'s found as children to each one
	 * ensuring the {@link TestEnvironment} is available for each {@link Runner}
	 * .
	 * 
	 * @param klass
	 * @throws Throwable
	 */
	public ParameterizedCucumber(Class<?> klass) throws Throwable {
    	
    	super(klass);
        
        log.debug("Initializing the ParameterizedCucumber runner");

        final ClassLoader classLoader = klass.getClassLoader();
        Assertions.assertNoCucumberAnnotatedMethods(klass);

//        Class<? extends Annotation>[] annotationClasses = new Class[]{CucumberOptions.class, Options.class};
//        RuntimeOptionsFactory runtimeOptionsFactory = new RuntimeOptionsFactory(klass, annotationClasses);
        RuntimeOptionsFactory runtimeOptionsFactory = new RuntimeOptionsFactory(klass);
        final RuntimeOptions runtimeOptions = runtimeOptionsFactory.create();

        ResourceLoader resourceLoader = new MultiLoader(classLoader);
//        ClassFinder classFinder = new ResourceLoaderClassFinder(resourceLoader, classLoader);
//        runtime = new Runtime(resourceLoader, classFinder, classLoader, runtimeOptions);
        runtime = new Runtime(resourceLoader, classLoader, runtimeOptions);
        
        final ThreadAwareFormatter threadAwareWrappedFormatter = new ThreadAwareFormatter(runtimeOptions, classLoader);
        
        
        Reporter threadAwareReporter = new ThreadAwareReporter(threadAwareWrappedFormatter, classLoader, runtimeOptions);
        
		
		runtimeOptions.formatters.clear();
		runtimeOptions.formatters.add(threadAwareWrappedFormatter);
		
        jUnitReporter = new JUnitReporter(threadAwareReporter, threadAwareWrappedFormatter, runtimeOptions.strict);
        //overwrite the reporter so we can alter the path to write to
        
        List<CucumberFeature> cucumberFeatures = runtimeOptions.cucumberFeatures(resourceLoader);
        List<Runner> parameterizedChildren = super.getChildren();
        final SeleniumManager seleniumManager = SenBotContext.getSenBotContext().getSeleniumManager();
        final CucumberManager cucumberManager = SenBotContext.getSenBotContext().getCucumberManager();

        for (int i = 0; i < parameterizedChildren.size(); i++) {
        	BlockJUnit4ClassRunner paramRunner = (BlockJUnit4ClassRunner) parameterizedChildren.get(i);
        	final TestEnvironment environment = seleniumManager.getSeleniumTestEnvironments().get(i);
        
        	log.debug("Load runners for test envrironment: " + environment.toString());
        	
            for (final CucumberFeature cucumberFeature : cucumberFeatures) {
            	Feature originalFeature = cucumberFeature.getGherkinFeature();
            	
            	log.debug("Load runner for test cucumberFeature: " + originalFeature.getDescription() + " on evironment " + environment.toString());
                
            	ThreadPoolFeatureRunnerScheduler environmentFeatureRunner = new ThreadPoolFeatureRunnerScheduler(environment, 
            			cucumberFeature, 
            			runtime, 
            			jUnitReporter,
            			cucumberManager.getFeatureFileTimeout());
            	
            	setScheduler(environmentFeatureRunner);
				children.add(environmentFeatureRunner);
            }           
        }

    }
 
开发者ID:gfk-ba,项目名称:senbot,代码行数:69,代码来源:ParameterizedCucumber.java

示例14: feature

import gherkin.formatter.model.Feature; //导入依赖的package包/类
@Override
public void feature(Feature arg0) {
	getWrapped().feature(arg0);
	
}
 
开发者ID:gfk-ba,项目名称:senbot,代码行数:6,代码来源:ParameterizedCucumber.java

示例15: startedFeature

import gherkin.formatter.model.Feature; //导入依赖的package包/类
public void startedFeature(Feature feature) {
    currentFeature = feature;
    numberOfExecutedFeatures++;
}
 
开发者ID:viltgroup,项目名称:minium,代码行数:5,代码来源:ExecutionProgress.java


注:本文中的gherkin.formatter.model.Feature类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。