kirklund commented on code in PR #7571: URL: https://github.com/apache/geode/pull/7571#discussion_r878594421
########## geode-assembly/src/acceptanceTest/java/org/apache/geode/management/internal/rest/StandaloneClientManagementAPIAcceptanceTest.java: ########## @@ -69,72 +65,94 @@ public static Collection<Boolean> data() { @Parameter public Boolean useSsl; + private String trustStorePath; private ProcessLogger clientProcessLogger; + private Path rootFolder; + + @Rule(order = 0) + public FolderRule folderRule = new FolderRule(); + @Rule(order = 1) + public GfshRule gfshRule = new GfshRule(folderRule::getFolder); + + @Before + public void setUp() { + rootFolder = folderRule.getFolder().toPath(); - @BeforeClass - public static void beforeClass() { /* * This file was generated with: * keytool -genkey -dname "CN=localhost" -alias self -validity 3650 -keyalg EC \ * -keystore trusted.keystore -keypass password -storepass password \ * -ext san=ip:127.0.0.1,dns:localhost -storetype jks */ - trustStorePath = - createTempFileFromResource(StandaloneClientManagementAPIAcceptanceTest.class, - "/ssl/trusted.keystore").getAbsolutePath(); - assertThat(trustStorePath).as("java file resource not found").isNotBlank(); + trustStorePath = createTempFileFromResource( + StandaloneClientManagementAPIAcceptanceTest.class, "/ssl/trusted.keystore") + .getAbsolutePath(); + assertThat(trustStorePath) + .as("java file resource not found") + .isNotBlank(); } @After - public void tearDown() throws Exception { - clientProcessLogger.awaitTermination(GeodeAwaitility.getTimeout().toMillis(), MILLISECONDS); + public void tearDown() throws InterruptedException, ExecutionException, TimeoutException { + clientProcessLogger.awaitTermination(getTimeout().toMillis(), MILLISECONDS); clientProcessLogger.close(); } @Test - public void clientCreatesRegionUsingClusterManagementService() throws Exception { + public void clientCreatesRegionUsingClusterManagementService() + throws IOException, InterruptedException { JarBuilder jarBuilder = new JarBuilder(); String filePath = createTempFileFromResource(getClass(), "/ManagementClientCreateRegion.java") .getAbsolutePath(); assertThat(filePath).as("java file resource not found").isNotBlank(); - File outputJar = new File(tempDir.getRoot(), "output.jar"); + File outputJar = new File(rootFolder.toFile(), "output.jar"); jarBuilder.buildJar(outputJar, new File(filePath)); - int[] availablePorts = AvailablePortHelper.getRandomAvailableTCPPorts(3); + int[] availablePorts = getRandomAvailableTCPPorts(3); int locatorPort = availablePorts[0]; int httpPort = availablePorts[1]; int jmxPort = availablePorts[2]; GfshExecution startCluster = - GfshScript.of( - String.format( - "start locator --port=%d --http-service-port=%d --J=-Dgemfire.JMX_MANAGER_PORT=%d %s", - locatorPort, httpPort, jmxPort, getSslParameters()), - String.format("start server --locators=localhost[%d] --server-port=0", locatorPort)) - .withName("startCluster").execute(gfsh); - + GfshScript Review Comment: Optionally reformat block to match similar blocks of code. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@geode.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org