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


Java Given类代码示例

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


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

示例1: whenIStartKafkaMonitoring

import org.jbehave.core.annotations.Given; //导入依赖的package包/类
@Given("I start Kafka monitoring")
public void whenIStartKafkaMonitoring() throws InterruptedException {
    try (KafkaMonitor kafkaMonitor = new KafkaMonitorBuilder(kfEndpoints, zkEndpoints)
            .withZookeeperSessionTimeout(1000)
            .withKafkaPollingInitialDelayTime(0)
            .withKafkaPollingDelayTime(1000)
            .build()) {
        kafkaMonitor.start();
        while (kafkaMonitor.getCluster().getKfClusterStatus() != KFClusterStatusName.OK) {
            Thread.sleep(500);
            System.out.println("Waiting for kafka to be up and running ... ");
        }
    } catch (Exception e) {
        fail("Error creating a kafka monitor. Error: " + e.getMessage());
        e.printStackTrace();
    }
    System.out.println("Kafka is up and running");
}
 
开发者ID:mcafee,项目名称:management-sdk-for-kafka,代码行数:19,代码来源:TopicServiceSteps.java

示例2: userIsLoggedIn

import org.jbehave.core.annotations.Given; //导入依赖的package包/类
@Given("the user \"$username\" with the password of \"$password\" is logged into the system expecting \"$datatype\"")
public void userIsLoggedIn(String username, String password, String datatype) {
    WebClient client;

    if (datatype.equals("JSON")) {
        JacksonJsonProvider json = new JacksonJsonProvider();

        client = WebClient.create(baseURL, Collections.singletonList(json), true);
        client.type(MediaType.APPLICATION_JSON_TYPE).accept(MediaType.APPLICATION_JSON_TYPE);
    } else {
        client = WebClient.create(baseURL, true);
        client.type(MediaType.APPLICATION_XML_TYPE).accept(MediaType.APPLICATION_XML_TYPE);
    }
    String authorizationHeader = "Basic " +
            org.apache.cxf.common.util.Base64Utility.encode((username + ":" + password).getBytes());
    client.header("Authorization", authorizationHeader);

    getState().put(KEY_WEB_CLIENT, client);
}
 
开发者ID:apache,项目名称:rave,代码行数:20,代码来源:CommonSteps.java

示例3: addResultDecorator

import org.jbehave.core.annotations.Given; //导入依赖的package包/类
@Given(value = "result has decorator $decorator $param", priority = 1)
public void addResultDecorator(String decorator, String param) {
	switch (decorator) {
	case "Null":
		processor.addResultDecorator(new NullResultDecorator());
		break;
	case "AppendTextToCandidateNameDecorator":
		processor
				.addResultDecorator(new AppendTextToCandidateNameDecorator(
						param));
		break;
	case "SuffixTextToCandidateNameDecorator":
		processor
				.addResultDecorator(new SuffixTextToCandidateNameDecorator(
						param));
		break;
	}
}
 
开发者ID:pau-minoves,项目名称:jseats,代码行数:19,代码来源:Steps.java

示例4: whenIStartKafkaMonitoring

import org.jbehave.core.annotations.Given; //导入依赖的package包/类
@Given("I start Kafka monitoring")
public void whenIStartKafkaMonitoring() throws InterruptedException {
    KafkaMonitor kafkaMonitor = new KafkaMonitorBuilder(kfEndpoints, zkEndpoints)
            .withZookeeperSessionTimeout(1000)
            .withKafkaPollingInitialDelayTime(0)
            .withKafkaPollingDelayTime(1000)
            .build();
    kafkaMonitor.start();
    while (kafkaMonitor.getCluster().getKfClusterStatus() != KFClusterStatusName.OK) {
        Thread.sleep(500);
    }
}
 
开发者ID:mcafee,项目名称:management-sdk-for-kafka,代码行数:13,代码来源:CreateTopicSteps.java

示例5: createStack

import org.jbehave.core.annotations.Given; //导入依赖的package包/类
@Given("a stack with elements")
public void createStack() {
    stack.clear();
    stack.push("a");
    stack.push("b");
    stack.push("c");
}
 
开发者ID:allure-framework,项目名称:allure-java,代码行数:8,代码来源:StackSteps.java

示例6: givenUniqueStringWithPrefixAndLengthSavedToVariable

import org.jbehave.core.annotations.Given; //导入依赖的package包/类
@Given("unique string with prefix '$prefix' and '$length' length saved to '$name' variable")
public void givenUniqueStringWithPrefixAndLengthSavedToVariable(String prefix, int length, String name) {
    String uniqueString = String.valueOf(UUID.randomUUID()).replace("-",
            "");
    String textElement = StringUtils.rightPad(prefix, length, uniqueString);
    SessionVariablesUtils.save(name, textElement);
}
 
开发者ID:tapack,项目名称:satisfy,代码行数:8,代码来源:DataGenerationSteps.java

示例7: webServiceEndpointAndWebServiceSoapAction

import org.jbehave.core.annotations.Given; //导入依赖的package包/类
@Given("web service endpoint '$webServiceEndpointUrl' and web service soap action '$webServiceSoapAction'")
public void webServiceEndpointAndWebServiceSoapAction(String webServiceEndpointUrl, String webServiceSoapAction) {
    Thucydides.getCurrentSession().put(WEB_SERVICE_ENDPOINT_URL_KEY, webServiceEndpointUrl);
    LOGGER.info("Saved web service endpoint is: " + webServiceEndpointUrl);
    Thucydides.getCurrentSession().put(WEB_SERVICE_SOAP_ACTION_KEY, webServiceSoapAction);
    LOGGER.info("Saved web service soap action is: " + webServiceSoapAction);
}
 
开发者ID:tapack,项目名称:satisfy,代码行数:8,代码来源:WebserviceSteps.java

示例8: givenFakeSOAPWebservice

import org.jbehave.core.annotations.Given; //导入依赖的package包/类
@Given("start SOAP webservice port '$port'")
public void givenFakeSOAPWebservice(String port) {
    String serviceUrl = "http://localhost:" + port + "/WheatherServicePort";
    Endpoint endpoint = Endpoint.publish(serviceUrl, new WheatherServiceImpl());
    assertTrue(endpoint.isPublished());
    Assert.assertEquals("http://schemas.xmlsoap.org/wsdl/soap/http", endpoint.getBinding().getBindingID());
}
 
开发者ID:tapack,项目名称:satisfy,代码行数:8,代码来源:FakeSoapServiceSteps.java

示例9: givenFakeSOAPWebserviceThroughHttps

import org.jbehave.core.annotations.Given; //导入依赖的package包/类
@Given("send SOAP web service through https")
public void givenFakeSOAPWebserviceThroughHttps() {
    SpringBusFactory factory = new SpringBusFactory();
    Bus bus = factory.createBus("src/test/resources/META-INF/spring/jaxws-server-with-ssl.xml");
    BusFactory.setDefaultBus(bus);
    Endpoint endpoint = Endpoint.publish("https://localhost:9091/WheatherServicePort", new WheatherServiceImpl());
    assertTrue(endpoint.isPublished());
    Assert.assertEquals("http://schemas.xmlsoap.org/wsdl/soap/http", endpoint.getBinding().getBindingID());
}
 
开发者ID:tapack,项目名称:satisfy,代码行数:10,代码来源:FakeSoapServiceSteps.java

示例10: negative

import org.jbehave.core.annotations.Given; //导入依赖的package包/类
@Given("a negative scenario")
@When("a negative scenario")
@Then("a negative scenario")
default boolean negative(){

    return true;
}
 
开发者ID:kishor32,项目名称:kabo,代码行数:8,代码来源:StepDefinition.java

示例11: positive

import org.jbehave.core.annotations.Given; //导入依赖的package包/类
@Given("a positive scenario")
@When("a positive scenario")
@Then("a positive scenario")
default boolean positive(){

    return true;
}
 
开发者ID:kishor32,项目名称:kabo,代码行数:8,代码来源:StepDefinition.java

示例12: configurePgpPlugin

import org.jbehave.core.annotations.Given; //导入依赖的package包/类
@Given("the user configure pgp plugin")
public void configurePgpPlugin() throws InterruptedException {
    subutaiSteps.clickOnIconPgp();
    subutaiSteps.clickOnButtonOptions();
    subutaiSteps.typeInFieldsPgp();
    subutaiSteps.clickOnButtonSubmit();
    subutaiSteps.waitGeneratedE2EKey();
    subutaiSteps.clickOnSubutaiSocialTab();
}
 
开发者ID:subutai-io,项目名称:playbooks,代码行数:10,代码来源:DefSubutaiStepsGiven.java

示例13: checkDataLunOnEvidenceStore

import org.jbehave.core.annotations.Given; //导入依赖的package包/类
@Given("a readable evidence storagebitmap of disk $lun of $name")
public void checkDataLunOnEvidenceStore(final int lun, final String name) throws IOException {
    final File file = getBitmapFileForClient(lun, name);
    final RandomAccessFile bitmapFile = new RandomAccessFile(file, "r");
    assertTrue("Unable to open bitmapfile", bitmapFile != null);
    final byte[] bitmapBuffer = new byte[(int) bitmapFile.length()];
    bitmapFile.readFully(bitmapBuffer);
    _bitmap = BitSet.valueOf(bitmapBuffer);
}
 
开发者ID:raqet,项目名称:acquisition-server,代码行数:10,代码来源:RaqetSteps.java

示例14: givenAVoidVisitorAdapterWithAVisitMethodThatChangesVariableNamesToUppercase

import org.jbehave.core.annotations.Given; //导入依赖的package包/类
@Given("a VoidVisitorAdapter with a visit method that changes variable names to uppercase")
public void givenAVoidVisitorAdapterWithAVisitMethodThatChangesVariableNamesToUppercase() {
    toUpperCaseVariableNameVisitor = new VoidVisitorAdapter<AtomicReference<String>>() {
        @Override
        public void visit(VariableDeclaratorId n, AtomicReference<String> arg) {
            n.setName(n.getName().toUpperCase());
        }
    };
}
 
开发者ID:plum-umd,项目名称:java-sketch,代码行数:10,代码来源:VisitorSteps.java

示例15: givenAVoidVisitorAdapterWithAVisitMethodThatCollectsTheVariableName

import org.jbehave.core.annotations.Given; //导入依赖的package包/类
@Given("a VoidVisitorAdapter with a visit method and collects the variable names")
public void givenAVoidVisitorAdapterWithAVisitMethodThatCollectsTheVariableName() {
    collectVariableNameVisitor = new VoidVisitorAdapter<AtomicReference<String>>() {
        @Override
        public void visit(VariableDeclaratorId n, AtomicReference<String> arg) {
            arg.set(arg.get() + n.getName() + ";");
        }
    };
}
 
开发者ID:plum-umd,项目名称:java-sketch,代码行数:10,代码来源:VisitorSteps.java


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