本文整理汇总了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());
}
}
示例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);
}
示例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());
}
示例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();
}
示例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;
}
示例6: TagParser
import gherkin.formatter.model.Feature; //导入依赖的package包/类
TagParser(final Feature feature, final Scenario scenario) {
this.feature = feature;
this.scenario = scenario;
}
示例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()));
}
示例8: feature
import gherkin.formatter.model.Feature; //导入依赖的package包/类
@Override
public void feature(Feature f) {
formatter.feature(f);
}
示例9: feature
import gherkin.formatter.model.Feature; //导入依赖的package包/类
@Override
public void feature( Feature arg0 )
{
}
示例10: getName
import gherkin.formatter.model.Feature; //导入依赖的package包/类
@Override
public String getName() {
Feature feature = cucumberFeature.getGherkinFeature();
return feature.getKeyword() + ": " + feature.getName();
}
示例11: feature
import gherkin.formatter.model.Feature; //导入依赖的package包/类
@Override
public void feature(Feature arg0) {
currentFeature = arg0.toMap();
}
示例12: feature
import gherkin.formatter.model.Feature; //导入依赖的package包/类
@Override
public void feature(Feature arg0) {
wrapped.feature(arg0);
}
示例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);
}
}
}
示例14: feature
import gherkin.formatter.model.Feature; //导入依赖的package包/类
@Override
public void feature(Feature arg0) {
getWrapped().feature(arg0);
}
示例15: startedFeature
import gherkin.formatter.model.Feature; //导入依赖的package包/类
public void startedFeature(Feature feature) {
currentFeature = feature;
numberOfExecutedFeatures++;
}