• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java AfterScenario类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: shouldInvokeAfterStepUponAnyOutcomeMethodWithExpectedParametersFromMeta

import org.jbehave.core.annotations.AfterScenario; //导入依赖的package包/类
@Test
public void shouldInvokeAfterStepUponAnyOutcomeMethodWithExpectedParametersFromMeta() throws Exception {
    // Given
    SomeSteps stepsInstance = new SomeSteps();
    StepCreator stepCreator = stepCreatorUsing(stepsInstance, mock(StepMatcher.class), new ParameterControls());
    Properties properties = new Properties();
    properties.put("theme", "shopping cart");
    properties.put("variant", "book");

    // When
    Step stepWithMeta = stepCreator.createAfterStepUponOutcome(SomeSteps.methodFor("aMethodWithANamedParameter"),
            AfterScenario.Outcome.ANY, new Meta(properties));
    StepResult stepResult = stepWithMeta.perform(null);

    // Then
    assertThat(stepResult, instanceOf(Skipped.class));
    assertThat(stepsInstance.args, instanceOf(Map.class));

    @SuppressWarnings("unchecked")
    Map<String, String> methodArgs = (Map<String, String>) stepsInstance.args;
    assertThat(methodArgs.get("variant"), is("book"));
    assertThat(methodArgs.get("theme"), is("shopping cart"));
}
 
开发者ID:vactowb,项目名称:jbehave-core,代码行数:24,代码来源:StepCreatorBehaviour.java


示例2: shouldInvokeAfterStepUponSuccessOutcomeMethodIfNoFailureOccurred

import org.jbehave.core.annotations.AfterScenario; //导入依赖的package包/类
@Test
public void shouldInvokeAfterStepUponSuccessOutcomeMethodIfNoFailureOccurred() throws Exception {
    // Given
    SomeSteps stepsInstance = new SomeSteps();
    StepCreator stepCreator = stepCreatorUsing(stepsInstance, mock(StepMatcher.class), new ParameterControls());
    Properties properties = new Properties();
    properties.put("theme", "shopping cart");
    properties.put("variant", "book");

    // When
    Step stepWithMeta = stepCreator.createAfterStepUponOutcome(SomeSteps.methodFor("aMethodWithANamedParameter"),
            AfterScenario.Outcome.SUCCESS, new Meta(properties));
    StepResult stepResult = stepWithMeta.perform(null);

    // Then
    assertThat(stepResult, instanceOf(Skipped.class));
    assertThat(stepsInstance.args, instanceOf(Map.class));

    @SuppressWarnings("unchecked")
    Map<String, String> methodArgs = (Map<String, String>) stepsInstance.args;
    assertThat(methodArgs.get("variant"), is("book"));
    assertThat(methodArgs.get("theme"), is("shopping cart"));
}
 
开发者ID:vactowb,项目名称:jbehave-core,代码行数:24,代码来源:StepCreatorBehaviour.java


示例3: shouldInvokeAfterStepUponFailureOutcomeMethodIfFailureOccurred

import org.jbehave.core.annotations.AfterScenario; //导入依赖的package包/类
@Test
public void shouldInvokeAfterStepUponFailureOutcomeMethodIfFailureOccurred() throws Exception {
    // Given
    SomeSteps stepsInstance = new SomeSteps();
    StepCreator stepCreator = stepCreatorUsing(stepsInstance, mock(StepMatcher.class), new ParameterControls());
    Properties properties = new Properties();
    properties.put("theme", "shopping cart");
    properties.put("variant", "book");

    // When
    Step stepWithMeta = stepCreator.createAfterStepUponOutcome(SomeSteps.methodFor("aMethodWithANamedParameter"),
            AfterScenario.Outcome.FAILURE, new Meta(properties));
    StepResult stepResult = stepWithMeta.doNotPerform(null);

    // Then
    assertThat(stepResult, instanceOf(Skipped.class));
    assertThat(stepsInstance.args, instanceOf(Map.class));

    @SuppressWarnings("unchecked")
    Map<String, String> methodArgs = (Map<String, String>) stepsInstance.args;
    assertThat(methodArgs.get("variant"), is("book"));
    assertThat(methodArgs.get("theme"), is("shopping cart"));
}
 
开发者ID:vactowb,项目名称:jbehave-core,代码行数:24,代码来源:StepCreatorBehaviour.java


示例4: teardown

import org.jbehave.core.annotations.AfterScenario; //导入依赖的package包/类
@AfterScenario
public void teardown() throws Throwable {
	try {
		ThreadContext.get().verify();
		ThreadContext.get().teardown();
	} catch (Throwable e) {
		e.printStackTrace(); // Ensures output in Eclipse console
		throw e;
	}
}
 
开发者ID:wmaop,项目名称:wm-jbehave,代码行数:11,代码来源:WmJBehaveSteps.java


示例5: afterScenario

import org.jbehave.core.annotations.AfterScenario; //导入依赖的package包/类
@AfterScenario(uponType = ScenarioType.ANY)
public void afterScenario() throws Exception {
    umountSMB(RaqetConfig.MOUNTPATH2);
    umountSMB(RaqetConfig.MOUNTPATH);
    _config.getServer().stop();
    Thread.sleep(1000);
}
 
开发者ID:raqet,项目名称:acquisition-server,代码行数:8,代码来源:BeforeAfterSteps.java


示例6: afterScenario

import org.jbehave.core.annotations.AfterScenario; //导入依赖的package包/类
@AfterScenario
public void afterScenario(@Named("variant") String variant, @Named("theme") String theme) {
    if (variant.length() > 0 && theme.length() > 0) {
        System.out.println("After scenario with variant '" + variant + "' and theme '" + theme + "'.");
    } else {
        System.out.println("After Any Scenario ...");
    }
}
 
开发者ID:vactowb,项目名称:jbehave-core,代码行数:9,代码来源:BeforeAfterSteps.java


示例7: afterFailedScenario

import org.jbehave.core.annotations.AfterScenario; //导入依赖的package包/类
@AfterScenario(uponOutcome = Outcome.FAILURE)
public void afterFailedScenario(@Named("theme") String theme) {
    if ("parametrisation".equals(theme)) {
        System.out.println("Wow, something failed in a scenario with theme 'parametrisation'.");
    } else {
        System.out.println("After Failed Scenario ...");
    }
}
 
开发者ID:vactowb,项目名称:jbehave-core,代码行数:9,代码来源:BeforeAfterSteps.java


示例8: afterScenarioFailure

import org.jbehave.core.annotations.AfterScenario; //导入依赖的package包/类
@AfterScenario(uponOutcome = Outcome.FAILURE)
public void afterScenarioFailure(UUIDExceptionWrapper failure) throws Exception {
    System.out.println("After Failed Scenario ...");
    File file = new File("target/failures/"+failure.getUUID().toString());
    file.getParentFile().mkdirs();
    file.createNewFile();
    failures.add(file.toString());
    System.out.println("Failure: "+file);
}
 
开发者ID:vactowb,项目名称:jbehave-core,代码行数:10,代码来源:FailureCorrelationStories.java


示例9: scenarioType

import org.jbehave.core.annotations.AfterScenario; //导入依赖的package包/类
private ScenarioType scenarioType(Method method, Class<? extends Annotation> annotationClass) {
    if (annotationClass.isAssignableFrom(BeforeScenario.class)) {
        return ((BeforeScenario) method.getAnnotation(annotationClass)).uponType();
    }
    if (annotationClass.isAssignableFrom(AfterScenario.class)) {
        return ((AfterScenario) method.getAnnotation(annotationClass)).uponType();
    }
    return ScenarioType.NORMAL;
}
 
开发者ID:vactowb,项目名称:jbehave-core,代码行数:10,代码来源:Steps.java


示例10: shouldNotInvokeAfterStepUponSuccessOutcomeMethodIfFailureOccurred

import org.jbehave.core.annotations.AfterScenario; //导入依赖的package包/类
@Test
public void shouldNotInvokeAfterStepUponSuccessOutcomeMethodIfFailureOccurred() throws Exception {
    // Given
    SomeSteps stepsInstance = new SomeSteps();
    StepCreator stepCreator = stepCreatorUsing(stepsInstance, mock(StepMatcher.class), new ParameterControls());

    // When
    Step stepWithMeta = stepCreator.createAfterStepUponOutcome(SomeSteps.methodFor("aFailingMethod"),
            AfterScenario.Outcome.SUCCESS, mock(Meta.class));
    StepResult stepResult = stepWithMeta.doNotPerform(null);

    // Then
    assertThat(stepResult, instanceOf(Skipped.class));
}
 
开发者ID:vactowb,项目名称:jbehave-core,代码行数:15,代码来源:StepCreatorBehaviour.java


示例11: shouldNotInvokeAfterStepUponFailureOutcomeMethodIfNoFailureOccurred

import org.jbehave.core.annotations.AfterScenario; //导入依赖的package包/类
@Test
public void shouldNotInvokeAfterStepUponFailureOutcomeMethodIfNoFailureOccurred() throws Exception {
    // Given
    SomeSteps stepsInstance = new SomeSteps();
    StepCreator stepCreator = stepCreatorUsing(stepsInstance, mock(StepMatcher.class), new ParameterControls());

    // When
    Step stepWithMeta = stepCreator.createAfterStepUponOutcome(SomeSteps.methodFor("aFailingMethod"),
            AfterScenario.Outcome.FAILURE, mock(Meta.class));
    StepResult stepResult = stepWithMeta.perform(null);

    // Then
    assertThat(stepResult, instanceOf(Skipped.class));
}
 
开发者ID:vactowb,项目名称:jbehave-core,代码行数:15,代码来源:StepCreatorBehaviour.java


示例12: shouldPassMetaToStepCreatorWhenCreatingStepUponOutcomeWithMeta

import org.jbehave.core.annotations.AfterScenario; //导入依赖的package包/类
@Test
public void shouldPassMetaToStepCreatorWhenCreatingStepUponOutcomeWithMeta() throws Exception {
    StepCreator stepCreator = mock(StepCreator.class);

    Method method = methodFor("aMethodWith");
    BeforeOrAfterStep beforeOrAfterStep = new BeforeOrAfterStep(Stage.AFTER, method, stepCreator);

    Meta meta = mock(Meta.class);
    beforeOrAfterStep.createStepUponOutcome(meta);

    verify(stepCreator).createAfterStepUponOutcome(method, AfterScenario.Outcome.ANY, meta);
}
 
开发者ID:vactowb,项目名称:jbehave-core,代码行数:13,代码来源:BeforeOrAfterStepBehaviour.java


示例13: afterScenario

import org.jbehave.core.annotations.AfterScenario; //导入依赖的package包/类
@AfterScenario
public void afterScenario() {
}
 
开发者ID:mcafee,项目名称:management-sdk-for-kafka,代码行数:4,代码来源:ZookeeperMonitorSteps.java


示例14: afterScenario

import org.jbehave.core.annotations.AfterScenario; //导入依赖的package包/类
@AfterScenario
public void afterScenario() {
    kfMonitor.stop();
}
 
开发者ID:mcafee,项目名称:management-sdk-for-kafka,代码行数:5,代码来源:KafkaMonitorSteps.java


示例15: afterScenario

import org.jbehave.core.annotations.AfterScenario; //导入依赖的package包/类
@AfterScenario
public void afterScenario() {
    zkMonitor.stop();
}
 
开发者ID:mcafee,项目名称:management-sdk-for-kafka,代码行数:5,代码来源:ZookeeperMonitorEventSteps.java


示例16: afterScenario

import org.jbehave.core.annotations.AfterScenario; //导入依赖的package包/类
@AfterScenario
public void afterScenario() throws Exception {
    docker.stopContainers();
    docker.removeContainers();
}
 
开发者ID:mcafee,项目名称:management-sdk-for-kafka,代码行数:6,代码来源:TopicServiceSteps.java


示例17: resetRestClient

import org.jbehave.core.annotations.AfterScenario; //导入依赖的package包/类
@Override
@AfterScenario
public void resetRestClient() {
	super.resetRestClient();
}
 
开发者ID:grantjforrester,项目名称:bdd-rest,代码行数:6,代码来源:JBehaveRestSteps.java


示例18: disposeScenario

import org.jbehave.core.annotations.AfterScenario; //导入依赖的package包/类
@AfterScenario
public void disposeScenario() {}
 
开发者ID:wemanity,项目名称:Acceptance-Tests-with-JBehave,代码行数:3,代码来源:CalculatorSteps.java


示例19: afterMyScenario

import org.jbehave.core.annotations.AfterScenario; //导入依赖的package包/类
@AfterScenario
public void afterMyScenario() {
    LOGGER.info("<<<<<< AfterScenario >>>>>>");
}
 
开发者ID:wemanity,项目名称:Acceptance-Tests-with-JBehave,代码行数:5,代码来源:DemonstrationSteps.java


示例20: tearDownDatabase

import org.jbehave.core.annotations.AfterScenario; //导入依赖的package包/类
@AfterScenario
public void tearDownDatabase() throws Exception {
    databaseTester.onTearDown();
}
 
开发者ID:wemanity,项目名称:Acceptance-Tests-with-JBehave,代码行数:5,代码来源:TodoSteps.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java IdsQueryBuilder类代码示例发布时间:2022-05-22
下一篇:
Java MathUtils类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap