@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" }); }
@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(); } }
@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); }
@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!"); } }
@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++; } }); }
@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); }
@BeforeAll @BeforeClass public static void setupContext() { DatabaseTestContext.setupInMemoryContext(); setupContext( ApplicationConfig.class ); }
@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(); } }
@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()); }
@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(); }
@BeforeAll static void createUnprocessedItem() { given() .multiPart("file", Paths.get("../sample-files/CPCPlus_Success_PreProd.xml").toFile()) .when() .post("/"); }
@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(); }
@BeforeAll public static void initClass(){ restController.setControllerPort(0); restController.startTheControllerServer(); RestAssured.baseURI = "http://localhost"; RestAssured.port = restController.getControllerServerPort(); RestAssured.basePath = "/controller/api"; RestAssured.enableLoggingOfRequestAndResponseIfValidationFails(); }
@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); } }
@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); } }
@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(); }
@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); }
@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); }
@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"); }
@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); } }
@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(); }
@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); } }
@BeforeAll static void initMock() { ObjectMetadata meta = new ObjectMetadata(); meta.setContentLength(100); when(amazonS3.getObjectMetadata(anyString(), anyString())) .thenReturn(meta); }
@BeforeAll public static void indent() { ObjectMapperFactory.INSTANCE.configure(SerializationFeature.INDENT_OUTPUT, true); }
@BeforeAll public static void setUp() throws Exception { curator = new TestingServer(true); }
@BeforeAll @SuppressWarnings("unchecked") static void setup() { client = HttpClientBuilder.create().build(); }
@BeforeAll static void setup() throws IOException { expected = TestHelper.getFixture("clinicalDocument.json"); }
@BeforeAll static void beforeClass() throws IOException { helper = new JsonPathToXpathHelper(path, wrapper); }
@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); }
@BeforeAll public static void initClass() throws Exception { SpringTestBase.initClass(new CPGController()); }
@BeforeAll static void init() throws IOException { InputStream stream = ClasspathHelper.contextClassLoader().getResourceAsStream("valid-QRDA-III-abridged.xml"); xmlFragment = IOUtils.toString(stream, StandardCharsets.UTF_8); }
@BeforeAll static void setup() throws IOException { happy = TestHelper.getFixture("measureDataWithPerformanceRate.xml"); nullHappy = TestHelper.getFixture("measureDataWithNullPerformanceRate.xml"); }
@BeforeAll static void setup() throws IOException { happy = TestHelper.getFixture("measureDataHappy.xml"); }
@BeforeAll static void setup() throws IOException { successFile = TestHelper.getFixture("successfulSupplementalDataFile.xml"); }
@BeforeAll public static void createShaEncoder() throws NoSuchAlgorithmException { shaDigester = MessageDigest.getInstance("SHA-512"); }
@BeforeAll public static void initClass() throws Exception { RestTestBase.initClass(new SFController()); }