Fix compilation in JVMErgonomicsTests

This issue arose after a cherry-pick from the wrong branch. Sorry. This
commit addresses the issue.
This commit is contained in:
Jason Tedor 2019-05-09 10:23:36 -04:00
parent f3bcc4fc22
commit 598e0962ed
No known key found for this signature in database
GPG Key ID: FA89F05560F16BC5
1 changed files with 9 additions and 9 deletions

View File

@ -135,15 +135,15 @@ public class JvmErgonomicsTests extends LaunchersTestCase {
}
public void testMaxDirectMemorySizeChoice() throws InterruptedException, IOException {
final Map<String, String> heapMaxDirectMemorySize = Map.of(
"64M", Long.toString((64L << 20) / 2),
"512M", Long.toString((512L << 20) / 2),
"1024M", Long.toString((1024L << 20) / 2),
"1G", Long.toString((1L << 30) / 2),
"2048M", Long.toString((2048L << 20) / 2),
"2G", Long.toString((2L << 30) / 2),
"8G", Long.toString((8L << 30) / 2));
final String heapSize = randomFrom(heapMaxDirectMemorySize.keySet().toArray(String[]::new));
final Map<String, String> heapMaxDirectMemorySize = new HashMap<>();
heapMaxDirectMemorySize.put("64M", Long.toString((64L << 20) / 2));
heapMaxDirectMemorySize.put("512M", Long.toString((512L << 20) / 2));
heapMaxDirectMemorySize.put("1024M", Long.toString((1024L << 20) / 2));
heapMaxDirectMemorySize.put("1G", Long.toString((1L << 30) / 2));
heapMaxDirectMemorySize.put("2048M", Long.toString((2048L << 20) / 2));
heapMaxDirectMemorySize.put("2G", Long.toString((2L << 30) / 2));
heapMaxDirectMemorySize.put("8G", Long.toString((8L << 30) / 2));
final String heapSize = randomFrom(heapMaxDirectMemorySize.keySet().toArray(new String[0]));
assertThat(
JvmErgonomics.choose(Arrays.asList("-Xms" + heapSize, "-Xmx" + heapSize)),
hasItem("-XX:MaxDirectMemorySize=" + heapMaxDirectMemorySize.get(heapSize)));