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


Java Embedder类代码示例

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


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

示例1: configuredEmbedder

import org.jbehave.core.embedder.Embedder; //导入依赖的package包/类
@Override
public Embedder configuredEmbedder() {
    StepEventBus.getEventBus().setUniqueSession(true);
    Embedder embedder = super.configuredEmbedder();
    embedder.useExecutorService(MoreExecutors.sameThreadExecutor());
    embedder.configuration().useStepCollector(stepCollector);
    embedder.useStepsFactory(new ScanningStepsFactory(embedder
            .configuration(), this.getClass(), pages));
    embedder.configuration()
            .useParameterControls(new ParameterControls()
                    .useDelimiterNamedParameters(true));
    embedder.configuration()
            .storyReporterBuilder()
            .withReporters(new SatisfyStoryReporter()
                    , new ConsoleOutput());
    embedder.useEmbedderMonitor(new NullEmbedderMonitor());
    embedder.useMetaFilters(getSatisfyProperties().getMetaFilters());
    return embedder;
}
 
开发者ID:tapack,项目名称:satisfy,代码行数:20,代码来源:ScanningJunitStory.java

示例2: runTests

import org.jbehave.core.embedder.Embedder; //导入依赖的package包/类
@Override
public void runTests(TestPage pageToTest) {
    final ClassLoader originalClassLoader = Thread.currentThread().getContextClassLoader();
    testSummary = new TestSummary();

    testSystemListener.testStarted(pageToTest);

    try {
        Thread.currentThread().setContextClassLoader(classLoader);

        Embedder embedder = newEmbedder();

        resolveCandidateSteps(pageToTest, embedder);

        embedder.runStoriesAsPaths(Collections.singletonList(pageToTest.getContent()));
    } finally {
        Thread.currentThread().setContextClassLoader(originalClassLoader);
        testSystemListener.testComplete(pageToTest, testSummary);
    }
}
 
开发者ID:amolenaar,项目名称:fitnesse-jbehave-test-system,代码行数:21,代码来源:JBehaveTestSystem.java

示例3: runStories

import org.jbehave.core.embedder.Embedder; //导入依赖的package包/类
private void runStories(String... storyPaths) {
    StoryReporterBuilder storyReporterBuilder = new StoryReporterBuilder().withDefaultFormats()
            .withCodeLocation(CodeLocations.codeLocationFromClass(ReportTransformBehaviour.class))
            .withFormats(Format.XML);

    Configuration configuration = new MostUsefulConfiguration()
            .useStoryLoader(new LoadFromClasspath(this.getClass())).useStoryReporterBuilder(storyReporterBuilder)
            .useFailureStrategy(new SilentlyAbsorbingFailure())
            .useStepCollector(new MarkUnmatchedStepsAsPending(new StepFinder(new ByLevenshteinDistance())));

    Embedder embedder = new Embedder();
    embedder.useEmbedderControls(new EmbedderControls().doGenerateViewAfterStories(false));
    embedder.useConfiguration(configuration);
    embedder.useCandidateSteps(new InstanceStepsFactory(configuration, new MySteps()).createCandidateSteps());
    embedder.useMetaFilters(asList("-skip true"));

    try {
        embedder.runStoriesAsPaths(asList(storyPaths));
    } catch (Exception e) {
        e.printStackTrace();
    }
}
 
开发者ID:vactowb,项目名称:jbehave-core,代码行数:23,代码来源:ReportTransformBehaviour.java

示例4: shouldCreateNewEmbedderWithDefaultControls

import org.jbehave.core.embedder.Embedder; //导入依赖的package包/类
@Test
public void shouldCreateNewEmbedderWithDefaultControls() {
    // Given
    AbstractEmbedderTask task = new AbstractEmbedderTask() {
    };
    // When
    Embedder embedder = task.newEmbedder();
    // Then
    EmbedderControls embedderControls = embedder.embedderControls();
    assertThat(embedderControls.batch(), is(false));
    assertThat(embedderControls.generateViewAfterStories(), is(true));
    assertThat(embedderControls.ignoreFailureInStories(), is(false));
    assertThat(embedderControls.ignoreFailureInView(), is(false));
    assertThat(embedderControls.skip(), is(false));
    assertThat(embedderControls.verboseFailures(), is(false));
    assertThat(embedderControls.verboseFiltering(), is(false));
    assertThat(embedderControls.storyTimeoutInSecs(), equalTo(300L));
    assertThat(embedderControls.threads(), equalTo(1));  
}
 
开发者ID:vactowb,项目名称:jbehave-core,代码行数:20,代码来源:EmbedderTaskBehaviour.java

示例5: shouldCreateNewEmbedderWithSystemProperties

import org.jbehave.core.embedder.Embedder; //导入依赖的package包/类
@Test
public void shouldCreateNewEmbedderWithSystemProperties() throws IOException {
    // Given
    AbstractEmbedderTask task = new AbstractEmbedderTask() {
    };
    // When
    Properties systemProperties = new Properties();
    systemProperties.setProperty("one", "1");
    systemProperties.setProperty("two", "2");        
    ByteArrayOutputStream out = new ByteArrayOutputStream();
    systemProperties.store(out, "");
    task.setSystemProperties(out.toString());
    Embedder embedder = task.newEmbedder();
    // Then
    assertThat(embedder.systemProperties(), equalTo(systemProperties));
}
 
开发者ID:vactowb,项目名称:jbehave-core,代码行数:17,代码来源:EmbedderTaskBehaviour.java

示例6: shouldGenerateStoriesView

import org.jbehave.core.embedder.Embedder; //导入依赖的package包/类
@Test
public void shouldGenerateStoriesView() {
    // Given
    GenerateStoriesView task = new GenerateStoriesView() {
        @Override
        protected Embedder newEmbedder() {
            return embedder;
        }

    };
    // When
    task.execute();

    // Then
    verify(embedder).generateReportsView();
}
 
开发者ID:vactowb,项目名称:jbehave-core,代码行数:17,代码来源:EmbedderTaskBehaviour.java

示例7: shouldReportStepdocs

import org.jbehave.core.embedder.Embedder; //导入依赖的package包/类
@Test
public void shouldReportStepdocs() {
    // Given
    ReportStepdocs task = new ReportStepdocs() {
        @Override
        protected Embedder newEmbedder() {
            return embedder;
        }

    };
    // When
    task.execute();

    // Then
    verify(embedder).reportStepdocs();
}
 
开发者ID:vactowb,项目名称:jbehave-core,代码行数:17,代码来源:EmbedderTaskBehaviour.java

示例8: shouldCreateNewEmbedderWithDefaultControls

import org.jbehave.core.embedder.Embedder; //导入依赖的package包/类
@Test
public void shouldCreateNewEmbedderWithDefaultControls() {
    // Given
    AbstractEmbedderMojo mojo = new AbstractEmbedderMojo() {
        public void execute() throws MojoExecutionException, MojoFailureException {
        }
    };
    // When
    Embedder embedder = mojo.newEmbedder();
    // Then
    EmbedderControls embedderControls = embedder.embedderControls();
    assertThat(embedderControls.batch(), is(false));
    assertThat(embedderControls.generateViewAfterStories(), is(true));
    assertThat(embedderControls.ignoreFailureInStories(), is(false));
    assertThat(embedderControls.ignoreFailureInView(), is(false));
    assertThat(embedderControls.threads(), is(1));
    assertThat(embedderControls.skip(), is(false));
    assertThat(embedderControls.storyTimeoutInSecs(), equalTo(300L));
    assertThat(embedderControls.threads(), equalTo(1));
}
 
开发者ID:vactowb,项目名称:jbehave-core,代码行数:21,代码来源:EmbedderMojoBehaviour.java

示例9: shouldCreateNewEmbedderWithGivenControls

import org.jbehave.core.embedder.Embedder; //导入依赖的package包/类
@Test
public void shouldCreateNewEmbedderWithGivenControls() {
    // Given
    AbstractEmbedderMojo mojo = new AbstractEmbedderMojo() {
        public void execute() throws MojoExecutionException, MojoFailureException {
        }
    };
    // When
    mojo.batch = true;
    mojo.generateViewAfterStories = false;
    mojo.ignoreFailureInStories = true;
    mojo.ignoreFailureInView = true;
    mojo.storyTimeoutInSecs = 60;
    mojo.threads = 2;
    mojo.skip = true;
    Embedder embedder = mojo.newEmbedder();
    // Then
    EmbedderControls embedderControls = embedder.embedderControls();
    assertThat(embedderControls.batch(), is(true));
    assertThat(embedderControls.generateViewAfterStories(), is(false));
    assertThat(embedderControls.ignoreFailureInStories(), is(true));
    assertThat(embedderControls.ignoreFailureInView(), is(true));
    assertThat(embedderControls.storyTimeoutInSecs(), is(60L));
    assertThat(embedderControls.threads(), is(2));
    assertThat(embedderControls.skip(), is(true));
}
 
开发者ID:vactowb,项目名称:jbehave-core,代码行数:27,代码来源:EmbedderMojoBehaviour.java

示例10: shouldCreateNewEmbedderWithSystemProperties

import org.jbehave.core.embedder.Embedder; //导入依赖的package包/类
@Test
public void shouldCreateNewEmbedderWithSystemProperties() {
    // Given
    AbstractEmbedderMojo mojo = new AbstractEmbedderMojo() {
        public void execute() throws MojoExecutionException, MojoFailureException {
        }
    };
    // When
    Properties systemProperties = new Properties();
    systemProperties.setProperty("one", "1");
    systemProperties.setProperty("two", "2");
    mojo.systemProperties = systemProperties;
    Embedder embedder = mojo.newEmbedder();
    // Then
    assertThat(embedder.systemProperties(), equalTo(systemProperties));
}
 
开发者ID:vactowb,项目名称:jbehave-core,代码行数:17,代码来源:EmbedderMojoBehaviour.java

示例11: shouldGenerateStoriesView

import org.jbehave.core.embedder.Embedder; //导入依赖的package包/类
@Test
public void shouldGenerateStoriesView() throws MojoExecutionException, MojoFailureException {
    // Given
    GenerateStoriesView mojo = new GenerateStoriesView() {
        @Override
        protected Embedder newEmbedder() {
            return embedder;
        }

    };
    // When
    mojo.execute();

    // Then
    verify(embedder).generateReportsView();
}
 
开发者ID:vactowb,项目名称:jbehave-core,代码行数:17,代码来源:EmbedderMojoBehaviour.java

示例12: shouldReportStepdocs

import org.jbehave.core.embedder.Embedder; //导入依赖的package包/类
@Test
public void shouldReportStepdocs() throws MojoExecutionException, MojoFailureException {
    // Given
    ReportStepdocs mojo = new ReportStepdocs() {
        @Override
        protected Embedder newEmbedder() {
            return embedder;
        }

    };
    // When
    mojo.execute();

    // Then
    verify(embedder).reportStepdocs();
}
 
开发者ID:vactowb,项目名称:jbehave-core,代码行数:17,代码来源:EmbedderMojoBehaviour.java

示例13: shouldReportFailuresWhenReportingStepdocs

import org.jbehave.core.embedder.Embedder; //导入依赖的package包/类
@Test(expected = MojoFailureException.class)
public void shouldReportFailuresWhenReportingStepdocs() throws MojoExecutionException, MojoFailureException {
    // Given
    ReportStepdocs mojo = new ReportStepdocs() {
        @Override
        protected Embedder newEmbedder() {
            return embedder;
        }

    };

    // When
    doThrow(new RuntimeException()).when(embedder).reportStepdocs();
    mojo.execute();

    // Then fail as expected
}
 
开发者ID:vactowb,项目名称:jbehave-core,代码行数:18,代码来源:EmbedderMojoBehaviour.java

示例14: injectEmbedder

import org.jbehave.core.embedder.Embedder; //导入依赖的package包/类
protected Object injectEmbedder(Embedder embedder, Class<?> annotatedClass) {
    try {
        Object instance = annotatedClass.newInstance();
        if (instance instanceof Embeddable) {
            Embeddable embeddable = (Embeddable) instance;
            embeddable.useEmbedder(embedder);
        }
        if (instance instanceof ConfigurableEmbedder) {
            ConfigurableEmbedder configurableEmbedder = (ConfigurableEmbedder) instance;
            configurableEmbedder.useConfiguration(embedder.configuration());
            configurableEmbedder.addSteps(embedder.candidateSteps());
            configurableEmbedder.useStepsFactory(embedder.stepsFactory());
        }
        return instance;
    } catch (Exception e) {
        annotationMonitor.elementCreationFailed(annotatedClass, e);
        throw new InstantiationFailed(annotatedClass, e);
    }
}
 
开发者ID:vactowb,项目名称:jbehave-core,代码行数:20,代码来源:AnnotationBuilder.java

示例15: shouldRunASingleStory

import org.jbehave.core.embedder.Embedder; //导入依赖的package包/类
@Test
public void shouldRunASingleStory() throws Throwable {
    // Given
    Embedder embedder = mock(Embedder.class);
    Configuration configuration = mock(Configuration.class);
    StoryPathResolver pathResolver = mock(StoryPathResolver.class);
    when(embedder.configuration()).thenReturn(configuration);
    when(configuration.storyPathResolver()).thenReturn(pathResolver);
    Class<MyStory> storyClass = MyStory.class;
    String storyPath = "/path/to/story";
    when(pathResolver.resolve(storyClass)).thenReturn(storyPath);
    CandidateSteps steps = mock(CandidateSteps.class);

    // When
    MyStory story = new MyStory(configuration, steps);
    story.useEmbedder(embedder);
    story.run();

    // Then
    verify(embedder).useConfiguration(configuration);
    verify(embedder).useCandidateSteps(eq(asList(steps)));
    verify(embedder).runStoriesAsPaths(asList(storyPath));
}
 
开发者ID:vactowb,项目名称:jbehave-core,代码行数:24,代码来源:ConfigurableEmbedderBehaviour.java


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