public void runFeatures(ExecutionToken executionToken, List<FeatureToken> features) { //RUN EACH FEATURE for (FeatureToken feature : features) { try { runFeature( executionToken, feature ); } catch (Throwable t) { log.error("Exception while running feature " + feature, t); executionToken.incrementFeaturesFailed(); } } }
private List<FeatureToken> parseFeatures(final File featureFile, ExecutionToken executionToken, List<StepMacro> globalStepMacro) { List<FeatureToken> features = null; ChorusParser<FeatureToken> parser = new FeatureFileParser(globalStepMacro); try { log.debug(String.format("Loading feature from file: %s", featureFile)); features = parser.parse(new FileReaderSupplier(featureFile)); for (FeatureToken f : features) { f.setFeatureFile(featureFile); } if (features.isEmpty()) { log.warn("Did not find a feature definition in file " + featureFile + ", will be skipped"); } //we can end up with more than one feature per file if using Chorus 'configurations' } catch (Throwable t) { log.warn("Failed to parse feature file " + featureFile + " will skip this feature file"); if ( t.getMessage() != null ) { log.warn(t.getMessage()); } //failure to parse is considered a failed feature executionToken.incrementFeaturesFailed(); } return features; }
executionToken.incrementFeaturesPending(); } else { executionToken.incrementFeaturesFailed();