Package org.jbehave.core.i18n

Examples of org.jbehave.core.i18n.LocalizedKeywords


    @Test
    public void shouldReportEventsToXmlOutput() throws IOException, SAXException {
        // Given
        File file = new File("target/story.xml");
        StoryReporter reporter = new XmlTemplateOutput(file, new LocalizedKeywords());

        // When
        StoryNarrator.narrateAnInterestingStory(reporter, true);

        // Then
View Full Code Here


  public static class GherkinTransformer implements StoryTransformer {

    private LocalizedKeywords keywords;
   
    public GherkinTransformer() {
      this(new LocalizedKeywords());
    }
View Full Code Here

    @Test
    public void shouldBuildWithCustomKeywords() throws IOException {
        // Given
        String storyPath = storyPath(MyStory.class);
        Keywords keywords = new LocalizedKeywords(new Locale("it"));
        final URL codeLocation = CodeLocations.codeLocationFromClass(this.getClass());
        final OutputStream out = new ByteArrayOutputStream();

        StoryReporterBuilder builder = new StoryReporterBuilder() {
            @Override
View Full Code Here

        String storyPath = storyPath(MyStory.class);
        Locale locale = Locale.getDefault();

        // When
        StoryReporter reporter = builder.withDefaultFormats().withFormats(CONSOLE, IDE_CONSOLE, HTML, STATS, TXT, XML)
                .withKeywords(new LocalizedKeywords(locale)).build(storyPath);

        // Then
        assertThat(builder.formats(), hasItems(CONSOLE, IDE_CONSOLE, HTML, STATS, TXT, XML));
        String[] upperCaseNames = new String[] { "CONSOLE", "IDE_CONSOLE", "HTML", "STATS", "TXT", "XML" };
        assertThat(builder.formatNames(false), hasItems(upperCaseNames));
View Full Code Here

        // Given
        String storyPath = storyPath(MyStory.class);
        final FilePrintStreamFactory factory = new FilePrintStreamFactory(new StoryLocation(
                CodeLocations.codeLocationFromClass(MyStory.class), storyPath));
        final StoryReporter txtReporter = new TxtOutput(factory.createPrintStream(), new Properties(),
                new LocalizedKeywords(), true);
        StoryReporterBuilder builder = new StoryReporterBuilder() {
            @Override
            public StoryReporter reporterFor(String storyPath, org.jbehave.core.reporters.Format format) {
                if (format == org.jbehave.core.reporters.Format.TXT) {
                    factory.useConfiguration(new FilePrintStreamFactory.FileConfiguration("text"));
View Full Code Here

        // Given
        String storyPath = storyPath(MyStory.class);
        FilePrintStreamFactory factory = new FilePrintStreamFactory(new StoryLocation(
                CodeLocations.codeLocationFromClass(MyStory.class), storyPath));
        StoryReporter txtReporter = new TxtOutput(factory.createPrintStream(), new Properties(),
                new LocalizedKeywords(), true);
        StoryReporter htmlReporter = new TxtOutput(factory.createPrintStream(), new Properties(),
                new LocalizedKeywords(), true);
        StoryReporterBuilder builder = new StoryReporterBuilder();

        // When
        StoryReporter reporter = builder.withReporters(txtReporter, htmlReporter).build(storyPath);
View Full Code Here

    public StoryReporterBuilder() {
      relativeDirectory = new FileConfiguration().getRelativeDirectory();
      pathResolver = new FileConfiguration().getPathResolver();
      codeLocation = CodeLocations.codeLocationFromPath("target/classes");
      viewResources = new FreemarkerViewGenerator().defaultViewProperties();
      keywords = new LocalizedKeywords();
    }
View Full Code Here

    public MarkUnmatchedStepsAsPending() {
        this(new StepFinder());
    }

    public MarkUnmatchedStepsAsPending(StepFinder stepFinder) {
        this(stepFinder, new LocalizedKeywords());
    }
View Full Code Here

    private final ResourceLoader resourceLoader;
    private final ParameterConverters parameterConverters;
    private final TableTransformers tableTransformers;

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

    public ExamplesTableFactory(Keywords keywords) {
        this(keywords, new LoadFromClasspath(), new ParameterConverters(), new TableTransformers());
    }

    public ExamplesTableFactory(ResourceLoader resourceLoader) {
        this(new LocalizedKeywords(), resourceLoader, new ParameterConverters(), new TableTransformers());
    }
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.