Java 类org.junit.jupiter.api.BeforeAll 实例源码

项目:selenium-jupiter    文件:RemoteWebDriverJupiterTest.java   
@BeforeAll
static void setup() throws Exception {
    // Start hub
    GridLauncherV3.main(new String[] { "-role", "hub", "-port", "4444" });

    // Register Chrome in hub
    ChromeDriverManager.getInstance().setup();
    GridLauncherV3.main(new String[] { "-role", "node", "-hub",
            "http://localhost:4444/grid/register", "-browser",
            "browserName=chrome", "-port", "5555" });

    // Register Firefox in hub
    FirefoxDriverManager.getInstance().setup();
    GridLauncherV3.main(new String[] { "-role", "node", "-hub",
            "http://localhost:4444/grid/register", "-browser",
            "browserName=firefox", "-port", "5556" });
}
项目:qpp-conversion-tool    文件:ConversionReportTest.java   
@BeforeAll
static void setup() {
    inputSource = new PathSource(Paths.get("../qrda-files/valid-QRDA-III-latest.xml"));
    Converter converter = new Converter(inputSource);
    wrapper = converter.transform();
    report = converter.getReport();

    Converter otherConverter = new Converter(
            new PathSource(Paths.get("../qrda-files/QRDA-III-without-required-measure.xml")));
    try {
        otherConverter.transform();
    } catch (TransformException ex) {
        //no worries
        errorReport = ex.getConversionReport();
    }
}
项目:dragoman    文件:AbstractMongoDBTest.java   
@BeforeAll
public static void start() throws Exception {
  StopWatch stopWatch = StopWatch.startForSplits();
  port = Network.getFreeServerPort();
  mongodExe =
      starter.prepare(
          new MongodConfigBuilder()
              .version(Version.Main.DEVELOPMENT)
              .net(new Net("localhost", port, Network.localhostIsIPv6()))
              .build());
  long prepareElapsedTime = stopWatch.split();
  mongod = mongodExe.start();
  long startElapsedTime = stopWatch.split();
  logger.info(
      "Started embedded Mongo in {}ms (prepareElapsedTime={}ms, startElapsedTime={}ms)",
      stopWatch.stop(),
      prepareElapsedTime,
      startElapsedTime);
}
项目:dragoman    文件:AbstractHttpTestCase.java   
@BeforeAll
public static void start() {
  port = getFreePort();

  httpDataProvider = mock(HttpDataProvider.class);
  logger.info("Starting embedded HTTP server on port: {}", port);
  vertx = Vertx.vertx();
  DeploymentOptions options =
      new DeploymentOptions().setConfig(new JsonObject().put("http.port", port)).setInstances(1);

  CountDownLatch latch = new CountDownLatch(1);
  vertx.deployVerticle(
      new HttpServerSimulatorVerticle(httpDataProvider),
      options,
      result -> {
        logger.info("Started embedded HTTP server with result: {}", result);
        latch.countDown();
      });

  try {
    latch.await();
  } catch (InterruptedException e) {
    logger.warn("Failed to wait for the embedded HTTP server to start!");
  }
}
项目:qpp-conversion-tool    文件:SingularAttributeTest.java   
@BeforeAll
@SuppressWarnings("unchecked")
static void before() throws NoSuchFieldException, IllegalAccessException,
        IOException, SAXException, ParserConfigurationException {
    manipulationHandler = new MarkupManipulationHandler("../qrda-files/valid-QRDA-III-latest.xml");

    Field corrMapField = PathCorrelator.class.getDeclaredField("pathCorrelationMap");
    corrMapField.setAccessible(true);
    corrMap = (Map<String, Goods>) corrMapField.get(null);

    exclusions = new HashSet<>(
            Arrays.asList(
                    //MultipleTinsDecoder maps multiple tin/npi combination
                    ClinicalDocumentDecoder.TAX_PAYER_IDENTIFICATION_NUMBER,
                    ClinicalDocumentDecoder.NATIONAL_PROVIDER_IDENTIFIER,
                    //There are no validations currently for entity type
                    ClinicalDocumentDecoder.ENTITY_ID,
                    ClinicalDocumentDecoder.PRACTICE_SITE_ADDR,
                    PerformanceRateProportionMeasureDecoder.PERFORMANCE_RATE,
                    PerformanceRateProportionMeasureDecoder.NULL_PERFORMANCE_RATE,
                    //There are no validations for performanceYear
                    ReportingParametersActDecoder.PERFORMANCE_YEAR,
                    SupplementalDataEthnicityDecoder.SUPPLEMENTAL_DATA_CODE,
                    SupplementalDataPayerDecoder.SUPPLEMENTAL_DATA_PAYER_CODE,
                    //stratum is not currently mapped
                    "stratum")
    );

    corrMap.keySet().forEach(key -> {
        String[] components = key.split(PathCorrelator.KEY_DELIMITER);
        if (!exclusions.contains(components[1])) {
            inclusionCount++;
        }
    });
}
项目:qpp-conversion-tool    文件:CpcPlusAcceptanceTest.java   
@BeforeAll
static void initMockApmIds() throws IOException {
    ApmEntityIds.setApmDataFile("test_apm_entity_ids.json");
    TypeReference<Map<String, CPCAcceptanceFixture>> ref =
            new TypeReference<Map<String, CPCAcceptanceFixture>>() { };
    fixtureValues = JsonHelper.readJson(FAILURE_FIXTURE, ref);
}
项目:fo-veilarbjobbsokerkompetanse    文件:IntegrasjonsTest.java   
@BeforeAll
@BeforeClass
public static void setupContext() {
    DatabaseTestContext.setupInMemoryContext();
    setupContext(
        ApplicationConfig.class
    );
}
项目:light-session-4j    文件:JdbcSessionSingleTest.java   
@BeforeAll
public static void setUp() {
    if(server == null) {
        logger.info("starting server");
        HttpHandler handler = getTestHandler();
        server = Undertow.builder()
                .addHttpListener(8080, "localhost")
                .setHandler(handler)
                .build();
        server.start();
    }
}
项目:qpp-conversion-tool    文件:CpcPlusRoundTripTest.java   
@BeforeAll
static void setup() throws URISyntaxException, IOException {
    ApmEntityIds.setApmDataFile("test_apm_entity_ids.json");
    URL sample = CpcPlusRoundTripTest.class.getClassLoader()
            .getResource("cpc_plus/success/CPCPlus_CMSPrgrm_LowerCase_SampleQRDA-III.xml");
    Path path = Paths.get(sample.toURI());
    new JsonPathToXpathHelper(path, wrapper, false);
    ctx = JsonPath.parse(wrapper.toString());
}
项目:qpp-conversion-tool    文件:ConverterLoadTest.java   
@BeforeAll
static void setupClass() throws IOException {
    jmeter = new StandardJMeterEngine();

    //JMeter initialization (properties, log levels, locale, etc)
    JMeterUtils.setJMeterHome("src/test/resources/");
    JMeterUtils.loadJMeterProperties("src/test/resources/jmeter.properties");
    JMeterUtils.initLocale();
}
项目:qpp-conversion-tool    文件:CpcApiAcceptance.java   
@BeforeAll
static void createUnprocessedItem() {
    given()
        .multiPart("file", Paths.get("../sample-files/CPCPlus_Success_PreProd.xml").toFile())
        .when()
        .post("/");
}
项目:qpp-conversion-tool    文件:ValidationServiceImplTest.java   
@BeforeAll
static void setup() throws IOException {
    service = new ValidationServiceImpl(null);
    pathToSubmissionError = Paths.get("src/test/resources/submissionErrorFixture.json");
    pathToSubmissionDuplicateEntryError = Paths.get("src/test/resources/submissionDuplicateEntryErrorFixture.json");
    Path toConvert = Paths.get("../qrda-files/valid-QRDA-III-latest.xml");
    qppWrapper = new JsonWrapper(new Converter(new PathSource(toConvert)).transform(), false);
    prepAllErrors();
}
项目:light-session-4j    文件:HazelCastSessionSingleTest.java   
@BeforeAll
public static void setUp() {
    if(server == null) {
        logger.info("starting server");
        HttpHandler handler = getTestHandler();
        server = Undertow.builder()
                .addHttpListener(8080, "localhost")
                .setHandler(handler)
                .build();
        server.start();
    }
}
项目:light-session-4j    文件:MapSessionManagerTest.java   
@BeforeAll
public static void setUp() {
    if(server == null) {
        logger.info("starting server");
        HttpHandler handler = getTestHandler();
        server = Undertow.builder()
                .addHttpListener(8080, "localhost")
                .setHandler(handler)
                .build();
        server.start();
    }
}
项目:EvoMaster    文件:SutControllerTest.java   
@BeforeAll
public static void initClass(){
    restController.setControllerPort(0);
    restController.startTheControllerServer();

    RestAssured.baseURI = "http://localhost";
    RestAssured.port = restController.getControllerServerPort();
    RestAssured.basePath = "/controller/api";
    RestAssured.enableLoggingOfRequestAndResponseIfValidationFails();
}
项目:PetBlocks    文件:PlayerMetaMySQLControllerIT.java   
@BeforeAll
public static void startMariaDB() {
    try {
        Factory.disable();
        database = DB.newEmbeddedDB(3306);
        database.start();
        try (Connection conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/?user=root&password=")) {
            try (Statement statement = conn.createStatement()) {
                statement.executeUpdate("CREATE DATABASE db");
            }
        }
    } catch (SQLException | ManagedProcessException e) {
        Logger.getLogger(PlayerMetaMySQLControllerIT.class.getSimpleName()).log(Level.WARNING, "Failed to start mariadb.", e);
    }
}
项目:PetBlocks    文件:PetMetaMySQLControllerIT.java   
@BeforeAll
public static void startMariaDB() {
    try {
        Factory.disable();
        database = DB.newEmbeddedDB(3306);
        database.start();
        try (Connection conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/?user=root&password=")) {
            try (Statement statement = conn.createStatement()) {
                statement.executeUpdate("CREATE DATABASE db");
            }
        }
    } catch (SQLException | ManagedProcessException e) {
        Logger.getLogger(PetMetaMySQLControllerIT.class.getSimpleName()).log(Level.WARNING, "Failed start maria db.", e);
    }
}
项目:webdriver-junit5-archetype    文件:JUnitTestBase.java   
@BeforeAll
public static void loadConfig() throws Throwable {
  SuiteConfiguration config = new SuiteConfiguration();
  baseUrl = config.getProperty("site.url");
  if (config.hasProperty("grid.url") && !"".equals(config.getProperty("grid.url"))) {
    gridHubUrl = new URL(config.getProperty("grid.url"));
  }
  capabilities = config.getCapabilities();
}
项目:Yggdrasil    文件:YggdrasilServiceTest.java   
@BeforeAll
public static void setup() throws IOException {
    server.setDispatcher(new YggdrasilDispatcher());
    server.start();

    service = new Retrofit.Builder()
            .baseUrl(server.url("/"))
            .client(new YggdrasilClient())
            .addCallAdapterFactory(Java8CallAdapterFactory.create())
            .addConverterFactory(GsonConverterFactory.create())
            .build().create(YggdrasilService.class);
}
项目:kafka-connect-cdc-mssql    文件:MsSqlTest.java   
@BeforeAll
public static void beforeClass(
    @DockerFormatString(container = MsSqlTestConstants.CONTAINER_NAME, port = MsSqlTestConstants.PORT, format = MsSqlTestConstants.JDBCURL_FORMAT_MASTER) String masterJdbcUrl,
    @DockerFormatString(container = MsSqlTestConstants.CONTAINER_NAME, port = MsSqlTestConstants.PORT, format = MsSqlTestConstants.JDBCURL_FORMAT_CDC_TESTING) String cdcTestingJdbcUrl
) throws SQLException, InterruptedException, IOException {
  createDatabase(masterJdbcUrl);
  flywayMigrate(cdcTestingJdbcUrl);
}
项目:light-session-4j    文件:RedisSessionSingleIT.java   
@BeforeAll
public static void setUp() {
    if(server == null) {
        logger.info("starting server");
        HttpHandler handler = getTestHandler();
        server = Undertow.builder()
                .addHttpListener(8080, "localhost")
                .setHandler(handler)
                .build();
        server.start();
    }
}
项目:selenium-jupiter    文件:SelenoidConfigTest.java   
@BeforeAll
static void setup() {
    setProperty("sel.jup.chrome.latest.version", "63.0");
    setProperty("sel.jup.firefox.latest.version", "57.0");
    setProperty("sel.jup.opera.latest.version", "50.0");
    setProperty("sel.jup.browser.list.from.docker.hub", "false");
}
项目:BlockBall    文件:PlayerMetaMySQLControllerTest.java   
@BeforeAll
public static void startMariaDB() {
    try {
        Factory.disable();
        database = DB.newEmbeddedDB(3306);
        database.start();
        try (Connection conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/?user=root&password=")) {
            try (Statement statement = conn.createStatement()) {
                statement.executeUpdate("CREATE DATABASE db");
            }
        }
    } catch (SQLException | ManagedProcessException e) {
        Logger.getLogger(PlayerMetaMySQLControllerTest.class.getSimpleName()).log(Level.WARNING, "Failed to start mariadb.", e);
    }
}
项目:moppepojkar    文件:ProcessRunnerImplTest.java   
@BeforeAll
static void setup() throws IOException, InterruptedException {
    List<String> source = Arrays.asList("public class ProcessRunnerImplTestSource{ \npublic static void main(String[] args){", "while(true){", "java.util.Scanner sc = new java.util.Scanner(System.in);", "String input = sc.nextLine();", "if(input.equals(\"exit\")){ break; ", "}else{ System.out.print(input + \"123\"); } } }}");

    Path sourceFile = Paths.get("ProcessRunnerImplTestSource.java");
    Files.write(sourceFile, source, Charset.forName("UTF-8"));

    ProcessBuilder compilerProcess = new ProcessBuilder("javac", "ProcessRunnerImplTestSource.java");
    compilerProcess.start().waitFor();
}
项目:Lavalink    文件:LavalinkTest.java   
@BeforeAll
static void setUp() {
    try {
        jda = new JDABuilder(AccountType.BOT)
                .setToken(System.getenv("TEST_TOKEN"))
                .addEventListener(lavalink)
                .buildBlocking();

        lavalink = new Lavalink("152691313123393536", 1, integer -> jda);
        lavalink.addNode(new URI("ws://localhost"), "youshallnotpass");
    } catch (Exception e) {
        throw new RuntimeException(e);
    }
}
项目:s3-channels    文件:S3ReadableObjectChannelBuilderTest.java   
@BeforeAll
static void initMock() {
    ObjectMetadata meta = new ObjectMetadata();
    meta.setContentLength(100);
    when(amazonS3.getObjectMetadata(anyString(), anyString()))
            .thenReturn(meta);
}
项目:kafka-connect-transform-cef    文件:CEFTransformationTest.java   
@BeforeAll
public static void indent() {
  ObjectMapperFactory.INSTANCE.configure(SerializationFeature.INDENT_OUTPUT, true);
}
项目:trellis-rosid    文件:NamespacesTest.java   
@BeforeAll
public static void setUp() throws Exception {
    curator = new TestingServer(true);
}
项目:qpp-conversion-tool    文件:SubmissionIntegrationTest.java   
@BeforeAll
@SuppressWarnings("unchecked")
static void setup() {
    client = HttpClientBuilder.create().build();
}
项目:qpp-conversion-tool    文件:ClinicalDocumentRoundTripTest.java   
@BeforeAll
static void setup() throws IOException {
    expected = TestHelper.getFixture("clinicalDocument.json");
}
项目:qpp-conversion-tool    文件:XpathJsonPathComparisonTest.java   
@BeforeAll
static void beforeClass() throws IOException {
    helper = new JsonPathToXpathHelper(path, wrapper);
}
项目:kafka-connect-cdc-oracle    文件:Oracle11gTest.java   
@BeforeAll
public static void beforeClass(@DockerFormatString(container = XStreamTestConstants.ORACLE_CONTAINER, port = XStreamTestConstants.ORACLE_PORT, format = XStreamTestConstants.JDBC_URL_FORMAT_11G) String jdbcUrl) throws SQLException, InterruptedException, IOException {
  flywayMigrate(jdbcUrl);
}
项目:EvoMaster    文件:CPGTestBase.java   
@BeforeAll
public static void initClass() throws Exception {

    SpringTestBase.initClass(new CPGController());
}
项目:qpp-conversion-tool    文件:ClinicalDocumentDecoderTest.java   
@BeforeAll
static void init() throws IOException {
    InputStream stream =
            ClasspathHelper.contextClassLoader().getResourceAsStream("valid-QRDA-III-abridged.xml");
    xmlFragment = IOUtils.toString(stream, StandardCharsets.UTF_8);
}
项目:qpp-conversion-tool    文件:PerformanceRateProportionMeasureDecoderTest.java   
@BeforeAll
static void setup() throws IOException {
    happy = TestHelper.getFixture("measureDataWithPerformanceRate.xml");
    nullHappy = TestHelper.getFixture("measureDataWithNullPerformanceRate.xml");
}
项目:qpp-conversion-tool    文件:MeasureDataDecoderTest.java   
@BeforeAll
static void setup() throws IOException {
    happy = TestHelper.getFixture("measureDataHappy.xml");
}
项目:qpp-conversion-tool    文件:SupplementalDataPayerDecoderTest.java   
@BeforeAll
static void setup() throws IOException {
    successFile = TestHelper.getFixture("successfulSupplementalDataFile.xml");
}
项目:qpp-conversion-tool    文件:SupplementalDataEthnicityDecoderTest.java   
@BeforeAll
static void setup() throws IOException {
    successFile = TestHelper.getFixture("successfulSupplementalDataFile.xml");
}
项目:ServerBrowser    文件:FileUtilityTest.java   
@BeforeAll
public static void createShaEncoder() throws NoSuchAlgorithmException {
    shaDigester = MessageDigest.getInstance("SHA-512");
}
项目:EvoMaster    文件:SFTest.java   
@BeforeAll
public static void initClass() throws Exception {

    RestTestBase.initClass(new SFController());
}