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


Java LoadFromClasspath类代码示例

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


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

示例1: setUp

import org.jbehave.core.io.LoadFromClasspath; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
    results = new AllureResultsWriterStub();
    final AllureLifecycle lifecycle = new AllureLifecycle(results);
    StepsAspects.setLifecycle(lifecycle);
    AttachmentsAspects.setLifecycle(lifecycle);
    embedder.useEmbedderControls(new EmbedderControls()
            .doGenerateViewAfterStories(false)
            .doVerboseFailures(true)
    );
    embedder.useConfiguration(new MostUsefulConfiguration()
            .useStoryLoader(new LoadFromClasspath(this.getClass()))
            .useStoryReporterBuilder(new ReportlessStoryReporterBuilder(folder.newFolder())
                    .withReporters(new AllureJbehave(lifecycle))
            )
    );
    embedder.useCandidateSteps(new InstanceStepsFactory(embedder.configuration(), new StackSteps())
            .createCandidateSteps()
    );
}
 
开发者ID:allure-framework,项目名称:allure-java,代码行数:21,代码来源:AllureJbehaveTest.java

示例2: configuration

import org.jbehave.core.io.LoadFromClasspath; //导入依赖的package包/类
@Override
public Configuration configuration() {
    return new MostUsefulConfiguration()
            // 找和java相同路徑的Story
            .useStoryLoader(new LoadFromClasspath(this.getClass()))
            // 設定Story行為檔佮JUnit設定檔的檔名對應
            .useStoryPathResolver(new CasePreservingResolver())
            // 有Step沒定義到視同Error
            .usePendingStepStrategy(new FailingUponPendingStep())
            // CONSOLE和TXT報表
            .useStoryReporterBuilder(
                    new StoryReporterBuilder().withDefaultFormats().withFormats(
                            Format.CONSOLE,
                            Format.TXT
                    )
            );
}
 
开发者ID:sih4sing5hong5,项目名称:Android_with_JBehave,代码行数:18,代码来源:加字串長度試驗.java

示例3: getConfiguration

import org.jbehave.core.io.LoadFromClasspath; //导入依赖的package包/类
@Produces
@Singleton
@ConfigurationAlternative
@WeldConfiguration
public Configuration getConfiguration()
{
  LOG.info("ConfigurationProducer.getConfiguration()");

  Keywords keywords = new LocalizedKeywords();

  ParameterConverters converters = new ParameterConverters().addConverters(new DateConverter(new SimpleDateFormat("yyyy-MM-dd")), new StoryParameterEnumConverter());

  return new MostUsefulConfiguration().useStoryControls(new StoryControls().doDryRun(runConfig.doDryRun()).doSkipScenariosAfterFailure(false))

  .useStepPatternParser(new RegexPrefixCapturingPatternParser()).useStoryLoader(new LoadFromClasspath(this.getClass().getClassLoader()))

  .useKeywords(keywords).useStepCollector(new MarkUnmatchedStepsAsPending(keywords)).useStoryParser(new RegexStoryParser(keywords, new ExamplesTableFactory(keywords, new LoadFromClasspath(this.getClass()), converters))).useDefaultStoryReporter(new ConsoleOutput(keywords))

  .useStoryReporterBuilder(new StoryReporterBuilder().withFormats(Format.CONSOLE, Format.TXT, Format.STATS, WebDriverHtmlOutputWithImg.WEB_DRIVER_HTML_WITH_IMG).withFailureTrace(true).withReporters(new LoggingStoryReporter()).withKeywords(keywords)).useParameterConverters(converters);
}
 
开发者ID:partnet,项目名称:seauto,代码行数:21,代码来源:DefaultConfigurationProducer.java

示例4: PortalStories

import org.jbehave.core.io.LoadFromClasspath; //导入依赖的package包/类
protected PortalStories() {
  CrossReference crossReference = new CrossReference().withJsonOnly().withOutputAfterEachStory(true)
      .excludingStoriesWithNoExecutedScenarios(true);
  ContextView contextView = new LocalFrameContextView().sized(640, 120);
  SeleniumContext seleniumContext = new SeleniumContext();
  SeleniumStepMonitor stepMonitor = new SeleniumStepMonitor(contextView, seleniumContext,
      crossReference.getStepMonitor());
  Format[] formats = new Format[]{new SeleniumContextOutput(seleniumContext), CONSOLE, WEB_DRIVER_HTML};
  StoryReporterBuilder reporterBuilder = new StoryReporterBuilder()
      .withCodeLocation(codeLocationFromClass(this.getClass())).withFailureTrace(true)
      .withFailureTraceCompression(true).withDefaultFormats().withFormats(formats)
      .withCrossReference(crossReference);

  Configuration configuration = new SeleniumConfiguration().useSeleniumContext(seleniumContext)
      .useFailureStrategy(new FailingUponPendingStep())
      .useStoryControls(new StoryControls().doResetStateBeforeScenario(false)).useStepMonitor(stepMonitor)
      .useStoryLoader(new LoadFromClasspath(this.getClass()))
      .useStoryReporterBuilder(reporterBuilder);
  useConfiguration(configuration);

  ApplicationContext context = new SpringApplicationContextFactory("applicationContext-tests.xml").createApplicationContext();
  useStepsFactory(new SpringStepsFactory(configuration, context));
}
 
开发者ID:apache,项目名称:rave,代码行数:24,代码来源:PortalStories.java

示例5: configuration

import org.jbehave.core.io.LoadFromClasspath; //导入依赖的package包/类
@Override
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 ParameterConverters.EnumConverter()
    );
    return new MostUsefulConfiguration()
            .useStoryLoader(new LoadFromClasspath(embeddableClass))
            .useStoryParser(new RegexStoryParser(examplesTableFactory))
            .useStoryReporterBuilder(new StoryReporterBuilder()
                    .withCodeLocation(CodeLocations.codeLocationFromClass(embeddableClass))
                    .withDefaultFormats()
                    .withFormats(CONSOLE, TXT, HTML, XML))
            .useParameterConverters(parameterConverters);
}
 
开发者ID:apache,项目名称:rave,代码行数:22,代码来源:Stories.java

示例6: configuration

import org.jbehave.core.io.LoadFromClasspath; //导入依赖的package包/类
@Override
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))
        .useStoryParser(new RegexStoryParser(examplesTableFactory)) 
        .useStoryReporterBuilder(new StoryReporterBuilder()
            .withCodeLocation(CodeLocations.codeLocationFromClass(embeddableClass))
            .withDefaultFormats()
            .withFormats(CONSOLE, TXT, HTML, XML))
        .useParameterConverters(parameterConverters);
}
 
开发者ID:wemanity,项目名称:Acceptance-Tests-with-JBehave,代码行数:20,代码来源:MyStories.java

示例7: configuration

import org.jbehave.core.io.LoadFromClasspath; //导入依赖的package包/类
@Override
public Configuration configuration() {

  LoadFromClasspath storyLoader = new LoadFromClasspath(this.getClass());
  URL codeLocation = codeLocationFromClass(this.getClass());

  // TODO test ANSI_CONSOLE and IDE_CONSOLE format
  StoryReporterBuilder reporterBuilder = new StoryReporterBuilder()
      .withCodeLocation(codeLocation)
      .withDefaultFormats()
      .withFormats(CONSOLE, TXT, HTML, XML);

  Configuration config = new MostUsefulConfiguration()
      .useStoryLoader(storyLoader)
      .useStoryReporterBuilder(reporterBuilder);

  return config;
}
 
开发者ID:vrampal,项目名称:connectfour,代码行数:19,代码来源:BoardStory.java

示例8: configuration

import org.jbehave.core.io.LoadFromClasspath; //导入依赖的package包/类
@Override
public Configuration configuration() {
    Class<? extends Embeddable> embeddableClass = this.getClass();
    Properties viewResources = new Properties();
    viewResources.put("decorateNonHtml", "true");
    return new MostUsefulConfiguration()
            .useParanamer(paranamer)
            .useStoryLoader(new LoadFromClasspath(embeddableClass))
            .useStoryPathResolver(new UnderscoredCamelCaseResolver().removeFromClassName("Story"))
            .useStoryReporterBuilder(new StoryReporterBuilder()
                    .withCodeLocation(CodeLocations.codeLocationFromClass(embeddableClass))
                    .withDefaultFormats()
                    .withPathResolver(new FilePrintStreamFactory.ResolveToPackagedName())
                    .withViewResources(viewResources)
                    .withFormats(CONSOLE, TXT, HTML, XML))
            .useParameterConverters(new ParameterConverters()
                    .addConverters(new ParameterConverters.NumberConverter(), new DateConverter(new SimpleDateFormat("yyyy-MM-dd")))) // use custom date pattern
            .useStepPatternParser(new RegexPrefixCapturingPatternParser(
                    "$")) // use '%' instead of '$' to identify parameters
            .useStepMonitor(new SilentStepMonitor());
}
 
开发者ID:yujunliang,项目名称:seleniumcapsules,代码行数:22,代码来源:AllStoryRunner.java

示例9: InvoiceStories

import org.jbehave.core.io.LoadFromClasspath; //导入依赖的package包/类
public InvoiceStories() {

        CrossReference crossReference = new CrossReference().withJsonOnly().withOutputAfterEachStory(true)
                .excludingStoriesWithNoExecutedScenarios(true);
        ContextView contextView = new LocalFrameContextView().sized(640, 120);
        SeleniumContext seleniumContext = new SeleniumContext();
        SeleniumStepMonitor stepMonitor = new SeleniumStepMonitor(contextView, seleniumContext,
                crossReference.getStepMonitor());
        Format[] formats = new Format[] { new SeleniumContextOutput(seleniumContext), CONSOLE, WEB_DRIVER_HTML };
        StoryReporterBuilder reporterBuilder = new StoryReporterBuilder()
                .withCodeLocation(codeLocationFromClass(InvoiceStories.class)).withFailureTrace(true)
                .withFailureTraceCompression(true).withDefaultFormats().withFormats(formats)
                .withCrossReference(crossReference);

        Configuration configuration = new SeleniumConfiguration().useSeleniumContext(seleniumContext)
                .useFailureStrategy(new FailingUponPendingStep())
                .useStoryControls(new StoryControls().doResetStateBeforeScenario(false)).useStepMonitor(stepMonitor)
                .useStoryLoader(new LoadFromClasspath(InvoiceStories.class))
                .useStoryReporterBuilder(reporterBuilder);
        useConfiguration(configuration);

        ApplicationContext context = new SpringApplicationContextFactory("invoice-steps.xml").createApplicationContext();
        useStepsFactory(new SpringStepsFactory(configuration, context));

    }
 
开发者ID:bartgeluykens,项目名称:Invoice-Keeper,代码行数:26,代码来源:InvoiceStories.java

示例10: runStories

import org.jbehave.core.io.LoadFromClasspath; //导入依赖的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

示例11: configuration

import org.jbehave.core.io.LoadFromClasspath; //导入依赖的package包/类
@Override
public Configuration configuration() {
	Class<? extends TraderEmbedder> embedderClass = this.getClass();
	return new MostUsefulConfiguration()
		.useStoryLoader(new LoadFromClasspath(embedderClass.getClassLoader()))
		.useStoryReporterBuilder(new StoryReporterBuilder()
       		.withCodeLocation(CodeLocations.codeLocationFromClass(embedderClass))
       		.withDefaultFormats()
			.withFormats(CONSOLE, TXT, HTML, XML)
			.withCrossReference(new CrossReference()))
           .useParameterConverters(new ParameterConverters()
               	.addConverters(new DateConverter(new SimpleDateFormat("yyyy-MM-dd")))) // use custom date pattern
           .useStepPatternParser(new RegexPrefixCapturingPatternParser(
						"%")) // use '%' instead of '$' to identify parameters
		.useStepMonitor(new SilentStepMonitor());								
}
 
开发者ID:vactowb,项目名称:jbehave-core,代码行数:17,代码来源:TraderEmbedder.java

示例12: configuration

import org.jbehave.core.io.LoadFromClasspath; //导入依赖的package包/类
@Override
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))
    .useStoryParser(new RegexStoryParser(examplesTableFactory))
    .useStoryReporterBuilder(new StoryReporterBuilder()
    .withCodeLocation(CodeLocations.codeLocationFromClass(embeddableClass))
    .withDefaultFormats()
    .withFormats(CONSOLE, TXT, HTML, XML))
    .useParameterConverters(parameterConverters);
}
 
开发者ID:vactowb,项目名称:jbehave-core,代码行数:20,代码来源:MyStories.java

示例13: MostUsefulConfiguration

import org.jbehave.core.io.LoadFromClasspath; //导入依赖的package包/类
public MostUsefulConfiguration() {
    useKeywords(new LocalizedKeywords());
    useStoryControls(new StoryControls());
    useStoryLoader(new LoadFromClasspath());
    useStoryParser(new RegexStoryParser(keywords()));
    useFailureStrategy(new RethrowingFailure());
    usePendingStepStrategy(new PassingUponPendingStep());
    useStepCollector(new MarkUnmatchedStepsAsPending());
    useStepFinder(new StepFinder());
    useStepPatternParser(new RegexPrefixCapturingPatternParser());
    useStepMonitor(new SilentStepMonitor());
    useStepdocReporter(new PrintStreamStepdocReporter());
    useParanamer(new NullParanamer());
    useParameterControls(new ParameterControls());
    useViewGenerator(new FreemarkerViewGenerator());
}
 
开发者ID:vactowb,项目名称:jbehave-core,代码行数:17,代码来源:MostUsefulConfiguration.java

示例14: configuration

import org.jbehave.core.io.LoadFromClasspath; //导入依赖的package包/类
@Override
  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));
    //  parameterConverters.addConverters(new MyConverter());
   //   parameterConverters.addConverters(new StudentConverter(new ExamplesTableFactory()));

CrossReference xref = new CrossReference();
return new MostUsefulConfiguration()
          .useStoryLoader(new LoadFromClasspath(embeddableClass))
          .useStoryParser(new RegexStoryParser(examplesTableFactory)) 
          .useStoryReporterBuilder(new StoryReporterBuilder()
              .withCodeLocation(CodeLocations.codeLocationFromClass(embeddableClass))
              .withDefaultFormats()
              .withCrossReference(xref )
              .withFormats(CONSOLE, TXT, WebDriverHtmlOutput.WEB_DRIVER_HTML, XML))
          .useParameterConverters(parameterConverters);
  }
 
开发者ID:saikrishna321,项目名称:JBehave-Selendroid-Android-Automation,代码行数:25,代码来源:MyStoriesMaps.java

示例15: configuration

import org.jbehave.core.io.LoadFromClasspath; //导入依赖的package包/类
@Override
public Configuration configuration() {
    return new MostUsefulConfiguration()
        .useStoryLoader(new LoadFromClasspath(this.getClass()))
        .useStoryReporterBuilder(new StoryReporterBuilder()
            .withDefaultFormats()
            .withFormats(Format.CONSOLE, Format.TXT));
}
 
开发者ID:aalmiray,项目名称:javatrove,代码行数:9,代码来源:HelloServiceProducesDefaultGreeting.java


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