Package org.jbehave.core.i18n

Examples of org.jbehave.core.i18n.LocalizedKeywords


    public TxtOutput(PrintStream output) {
        this(output, new Properties());
    }

    public TxtOutput(PrintStream output, Properties outputPatterns) {
        this(output, outputPatterns, new LocalizedKeywords());
    }
View Full Code Here


*/
public class MostUsefulConfiguration extends Configuration {

    public MostUsefulConfiguration() {
      doDryRun(false);
        useKeywords(new LocalizedKeywords());
        useStoryLoader(new LoadFromClasspath());
        useStoryParser(new RegexStoryParser(keywords()));
        useFailureStrategy(new RethrowingFailure());
        usePendingStepStrategy(new PassingUponPendingStep());
        useDefaultStoryReporter(new ConsoleOutput());
View Full Code Here

    private static final String NONE = "";
    private static final String COMMA = ",";
    private final Keywords keywords;

    public RegexStoryParser() {
        this(new LocalizedKeywords());
    }
View Full Code Here

    }

    @Test
    public void shouldAllowLocalizationOfSteps(){
        Configuration configuration = new MostUsefulConfiguration();
        configuration.useKeywords(new LocalizedKeywords(new Locale("it")));
      LocalizedSteps steps = new LocalizedSteps(configuration);
        List<StepCandidate> candidates = steps.listCandidates();
        assertThat(candidates.size(), equalTo(3));

        findCandidate(candidates, "GIVEN un dato che").createMatchedStep("Dato che un dato che", tableRow).perform(null);
View Full Code Here

    }

    @Test(expected=StartingWordNotFound.class)
    public void shouldNotCreateStepIfStartingWordNotFound(){
        Configuration configuration = new MostUsefulConfiguration();
        configuration.useKeywords(new LocalizedKeywords(new Locale("it")));
      LocalizedSteps steps = new LocalizedSteps(configuration);
        List<StepCandidate> candidates = steps.listCandidates();
        assertThat(candidates.size(), equalTo(3));

        // misspelled starting word
View Full Code Here

    }

    @Test
    public void shouldNotMatchOrIgnoreStepWhenStartingWordNotFound() throws Exception {
        Method method = SomeSteps.class.getMethod("aMethod");
        Keywords keywords = new LocalizedKeywords(){           
           
            @Override
            public String startingWordFor(StepType stepType) {
                throw new StartingWordNotFound(stepType, new HashMap<StepType, String>());
            }
View Full Code Here

   public Configuration configuration() {
      Class<? extends Embeddable> embeddableClass = this.getClass();
      // Start from default ParameterConverters instance
      ParameterConverters parameterConverters = new ParameterConverters();
      // factory to allow parameter conversion and loading from external resources (used by StoryParser too)
      ExamplesTableFactory examplesTableFactory = new ExamplesTableFactory(new LocalizedKeywords(), new LoadFromClasspath(embeddableClass),
            parameterConverters);
      // add custom coverters
      parameterConverters.addConverters(new DateConverter(new SimpleDateFormat("yyyy-MM-dd")), new ExamplesTableConverter(
            examplesTableFactory));
      return new MostUsefulConfiguration()
View Full Code Here

            new ExamplesTableFactory(new LoadFromRelativeFile(
                codeLocation))));
    // factory to allow parameter conversion and loading from external
    // resources (used by StoryParser too)
    ExamplesTableFactory examplesTableFactory = new ExamplesTableFactory(
        new LocalizedKeywords(),
        new LoadFromRelativeFile(codeLocation), parameterConverters);
    // add custom coverters
    parameterConverters.addConverters(new ExamplesTableConverter(
        examplesTableFactory));
    viewResources.put("decorateNonHtml", "true");
View Full Code Here

    public Configuration configuration() {
        Class<? extends Embeddable> embeddableClass = this.getClass();
        // Start from default ParameterConverters instance
        ParameterConverters parameterConverters = new ParameterConverters();
        // factory to allow parameter conversion and loading from external resources (used by StoryParser too)
        ExamplesTableFactory examplesTableFactory = new ExamplesTableFactory(new LocalizedKeywords(), new LoadFromClasspath(embeddableClass), parameterConverters);
        // add custom converters
        parameterConverters.addConverters(new DateConverter(new SimpleDateFormat("yyyy-MM-dd")),
                new ExamplesTableConverter(examplesTableFactory));
        return new MostUsefulConfiguration()
            .useStoryLoader(new LoadFromClasspath(embeddableClass))
View Full Code Here

    // Start from default ParameterConverters instance
    ParameterConverters parameterConverters = new ParameterConverters();
    // factory to allow parameter conversion and loading from external
    // resources (used by StoryParser too)
    ExamplesTableFactory examplesTableFactory = new ExamplesTableFactory(
        new LocalizedKeywords(),
        new LoadFromClasspath(embeddableClass), parameterConverters);
    // and add custom converters
    parameterConverters.addConverters(
        new ParameterConverters.DateConverter(new SimpleDateFormat(
            "dd-MM-yyyy")),
View Full Code Here

TOP

Related Classes of org.jbehave.core.i18n.LocalizedKeywords

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.