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


Java Before类代码示例

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


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

示例1: prepare

import cucumber.api.java.Before; //导入依赖的package包/类
@Before
public void prepare() {
    pugTSDB = new PugTSDB("/tmp/pug-rollup-test", "test", "test");

    repositories = Stream.of(pugTSDB.getClass().getDeclaredFields())
            .filter(field -> {
                field.setAccessible(true);
                return field.isAccessible();
            })
            .filter(field -> field.getType().equals(Repositories.class))
            .map(field -> {
                try {
                    return (Repositories) field.get(pugTSDB);
                } catch (IllegalAccessException e) {
                    return null;
                }
            })
            .findFirst()
            .get();
}
 
开发者ID:StefaniniInspiring,项目名称:pugtsdb,代码行数:21,代码来源:SelectionSteps.java

示例2: prepare

import cucumber.api.java.Before; //导入依赖的package包/类
@Before
public void prepare() {
    pugTSDB = new PugTSDB("/tmp/pug-rollup-test", "test", "test");

    repositories = Stream.of(pugTSDB.getClass().getDeclaredFields())
            .filter(field -> {
                field.setAccessible(true);
                return field.isAccessible();
            })
            .filter(field -> field.getType().equals(Repositories.class))
            .map(field -> {
                try {
                    return (Repositories) field.get(pugTSDB);
                } catch (IllegalAccessException e) {
                    return null;
                }
            })
            .findFirst()
            .get();

    executionInstant = Instant.now();
}
 
开发者ID:StefaniniInspiring,项目名称:pugtsdb,代码行数:23,代码来源:RollUpAggregationSteps.java

示例3: setUpScenario

import cucumber.api.java.Before; //导入依赖的package包/类
@Before()
public static void setUpScenario(Scenario scenario) throws TechnicalException {
    logger.debug("setUpScenario {} scenario.", scenario.getName());

    if (Context.getCurrentScenarioData() == 0) {
        // Retrieve Excel filename to read
        String scenarioName = System.getProperty("excelfilename") != null ? System.getProperty("excelfilename") : getFirstNonEnvironmentTag(scenario.getSourceTagNames());

        Context.setScenarioName(scenarioName);

        Context.getDataInputProvider().prepare(Context.getScenarioName());
        Context.getDataOutputProvider().prepare(Context.getScenarioName());
        Context.startCurrentScenario();
    }

    // Increment current Excel file line to read
    Context.goToNextData();
    Context.emptyScenarioRegistry();
    Context.saveValue(Constants.IS_CONNECTED_REGISTRY_KEY, String.valueOf(Auth.isConnected()));

    Context.setCurrentScenario(scenario);
    new Result.Success<>(Context.getScenarioName(), Messages.getMessage(SUCCESS_MESSAGE_BY_DEFAULT));

}
 
开发者ID:NoraUi,项目名称:NoraUi,代码行数:25,代码来源:CucumberHooks.java

示例4: beforeClass

import cucumber.api.java.Before; //导入依赖的package包/类
@Before
  public static void beforeClass() throws Exception {
/*
 * This runs under maven, and I'm not sure how else to figure out the target directory from code..
 */
      if (validator == null) {
          /* TODO STU3
          FhirInstanceValidator instanceValidator = new FhirInstanceValidator();
          validator.registerValidatorModule(instanceValidator);

          IValidationSupport valSupport = new CareConnectValidation();
          ValidationSupportChain support = new ValidationSupportChain(new DefaultProfileValidationSupport(), valSupport);
          instanceValidator.setValidationSupport(support);
          */
      }
      else {
         // ourLog.info("START - CALLED NOT Creating Server");
      }
  }
 
开发者ID:nhsconnect,项目名称:careconnect-reference-implementation,代码行数:20,代码来源:JPAStepsDef.java

示例5: beforeFeature

import cucumber.api.java.Before; //导入依赖的package包/类
@Before(order=4)
public void beforeFeature(Scenario scenario) throws SQLException, ClassNotFoundException {
    logger.info("Start scenario: " + scenario.getName());

    //To run the after hook methods in the last scenario of the features
    currentFeature = scenario.getId().split(";")[0];
    System.out.println(currentFeature);
    if (!currentFeature.equals(lastFeature)) {
        executeAfterHookMethod();
        lastFeature = currentFeature;
        featureFlag = false;
    }
}
 
开发者ID:PenielDVP,项目名称:RoomManagerAutomation,代码行数:14,代码来源:FeatureHooks.java

示例6: before

import cucumber.api.java.Before; //导入依赖的package包/类
@Before
public void before(){
    try {
        TestNGBase.jdiSetUp();

        getDriverFactory().setDriverPath("C:/Selenium");
        initFromProperties();
        //Assert.noScreenOnFail();
        WebSite.init(EpamJDISite.class);
        homePage.open();
        login.submit(User.DEFAULT_USER);
        logger.info("Run Tests");
        Verify.getFails();

    } catch (Exception e) {
        e.printStackTrace();
    }
}
 
开发者ID:epam,项目名称:JDI,代码行数:19,代码来源:baseCucumberScenario.java

示例7: shellSetup

import cucumber.api.java.Before; //导入依赖的package包/类
@Before(order = 10, value = "@shell")
public void shellSetup() throws IOException, InterruptedException {

    commonspec.getLogger().info("Stratio Streaming shell setup");
    String streamingHome = System.getProperty("STRATIO-STREAMING_SHELL_HOME", "../stratio-streaming/");

    File shell = new File(streamingHome);

    ProcessBuilder pb = new ProcessBuilder(shell.getAbsolutePath());
    Map<String, String> env = pb.environment();
    env.put("SHELL_OPTS", System.getProperty("SHELL_OPTS", ""));

    Process process = pb.start();

    Expect expect = new ExpectBuilder().withInputs(process.getInputStream())
            .withInputFilters(removeNonPrintable(), removeColors()).withOutput(process.getOutputStream())
                    // .withEchoInput(System.out).withEchoOutput(System.out)
            .withTimeout(20, TimeUnit.SECONDS)
                    // .withErrorOnTimeout(true)
            .build();

    Thread.sleep(1000);

    commonspec.setShellIface(expect);
}
 
开发者ID:Stratio,项目名称:Decision,代码行数:26,代码来源:HookSpec.java

示例8: streamingApiSetup

import cucumber.api.java.Before; //导入依赖的package包/类
@Before(order = 20, value = "@api")
public void streamingApiSetup() {
    commonspec.getLogger().info("Stratio Decision API setup");
    try {
        commonspec.getLogger().info("Starting Stratio Decision factory on {}:{}, {}:{}",
                commonspec.getKAFKA_HOST(), commonspec.getKAFKA_PORT(), commonspec.getZOOKEEPER_HOST(),
                commonspec.getZOOKEEPER_PORT());
        IStratioStreamingAPI stratioStreamingAPI = StratioStreamingAPIFactory.create().initializeWithServerConfig(
                commonspec.getKAFKA_HOST(), commonspec.getKAFKA_PORT(), commonspec.getZOOKEEPER_HOST(),
                commonspec.getZOOKEEPER_PORT(), commonspec.getZOOKEEPER_PATH());
        commonspec.setStratioStreamingAPI(stratioStreamingAPI);

    } catch (StratioStreamingException e) {
        commonspec.getLogger().error("Got Exception on connecting to Stratio Decision", e);
        fail("Unable to create Stratio Streaming Factory");
    }
}
 
开发者ID:Stratio,项目名称:Decision,代码行数:18,代码来源:HookSpec.java

示例9: before

import cucumber.api.java.Before; //导入依赖的package包/类
@Before
public void before(){
    try {
        TestNGBase.jdiSetUp();

        getDriverFactory().setDriverPath("C:\\Selenium");
        initFromProperties();
        //Assert.noScreenOnFail();
        Init(EpamJDISite.class);
        homePage.open();
        login.submit(User.DEFAULT_USER);
        logger.info("Run Tests");
        Verify.getFails();

    } catch (Exception e) {
        e.printStackTrace();
    }
}
 
开发者ID:ggasoftware,项目名称:gga-selenium-framework,代码行数:19,代码来源:baseCucumberScenario.java

示例10: setup

import cucumber.api.java.Before; //导入依赖的package包/类
@Before("@rest")
public void setup() {
    if (config == null) {
        config = new CompositeConfiguration();
        config.addConfiguration(new SystemConfiguration());
        try {
            config.addConfiguration(new PropertiesConfiguration(CONFIG_FILE));
        } catch (ConfigurationException e) {
            logger.error("Can not load properties file " + CONFIG_FILE);
            e.printStackTrace();
        }

    }
}
 
开发者ID:mariaklimenko,项目名称:jeta,代码行数:15,代码来源:RestSteps.java

示例11: beforeScenario

import cucumber.api.java.Before; //导入依赖的package包/类
@Before
public void beforeScenario( Scenario scenario ) throws Exception
{
    log( "***************************************************************************");
    log( "Executing Scenario : " + scenario.getName() );
    log( "***************************************************************************");

    //Read all parameters from preferences.properties and make it available to the SessionContextManager
    Map allParams = new MyPropertyReader("preferences.properties").getAllParams();
    SessionContextManager.registerParameters(MyContextSupport.getParameters(allParams));

    //attach the Spring Application Context to the SessionContextManager
    SessionContextManager.attachSpringContext(ctx);

    //Get the object of WebDriverWebController(gives access to all WebUI actions)
    WebDriverWebController webController = (WebDriverWebController)ctx.getBean("webDriverWebController");

    //Making driver available to the WebController
    webController.setDriver(DriverFactory.getDriver());

    //making webController available to SessionContextManager
    SessionContextManager.setController(webController);

    //Lunches the driver
    SessionContextManager.getInstance().setAttribute( "execution_type", "browser" );

    getDriver().manage().window().maximize();
    getDriver().manage().deleteAllCookies();
}
 
开发者ID:hemano,项目名称:cucumber-framework-java,代码行数:30,代码来源:StartingSteps.java

示例12: beforeFeatures

import cucumber.api.java.Before; //导入依赖的package包/类
@Before
public void beforeFeatures() {
	if (!loadedOnce) {
		try {

			loadConfiguration();
			loadedOnce = true;
		} catch (Exception e) {
			e.printStackTrace();
			throw new RuntimeException(String.format("You do not have a configuration file in `%s`. Please specify one there or use -DcukeConfig to manually specify one.", getConfigFilePath()), e);
		}
	}
}
 
开发者ID:ClearPointNZ,项目名称:connect-sample-apps,代码行数:14,代码来源:LoadConfiguration.java

示例13: setup

import cucumber.api.java.Before; //导入依赖的package包/类
@Before
public void setup() throws JsonParseException, JsonMappingException, IOException {
    this.acsitSetUpFactory.setUp();
    this.acsUrl = this.acsitSetUpFactory.getAcsUrl();
    this.zone1Headers =this.acsitSetUpFactory.getZone1Headers();
    this.acsAdminRestTemplate=this.acsitSetUpFactory.getAcsZoneAdminRestTemplate();      
}
 
开发者ID:eclipse,项目名称:keti,代码行数:8,代码来源:PolicyEvaluationStepsDefinitions.java

示例14: setup

import cucumber.api.java.Before; //导入依赖的package包/类
@Before
public void setup() throws JsonParseException, JsonMappingException, IOException {
    this.acsitSetUpFactory.setUp();
    this.acsUrl = this.acsitSetUpFactory.getAcsUrl();
    this.zone1Headers = this.acsitSetUpFactory.getZone1Headers();
    this.acsZone1Template = this.acsitSetUpFactory.getAcsZoneAdminRestTemplate();
    this.acsZone2Template = this.acsitSetUpFactory.getAcsZone2AdminRestTemplate();
    this.zone1Name = this.acsitSetUpFactory.getZone1().getName();
    this.zone2Name = this.acsitSetUpFactory.getZone2().getName();
}
 
开发者ID:eclipse,项目名称:keti,代码行数:11,代码来源:ZoneEnforcementStepsDefinitions.java

示例15: beforeScenarioIntegrationScope

import cucumber.api.java.Before; //导入依赖的package包/类
@Before(value={"@integration"}, order=100)
public void beforeScenarioIntegrationScope() {
    org.apache.log4j.PropertyConfigurator.configure("logging.properties");
    DomainAppSystemInitializer.initIsft();
    
    before(ScenarioExecutionScope.INTEGRATION);
}
 
开发者ID:leandrogonqn,项目名称:Proyecto2017Seguros,代码行数:8,代码来源:BootstrappingGlue.java


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