當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。