Update tests to allow them to run on Java 19

Closes gh-32280
This commit is contained in:
Andy Wilkinson
2022-09-08 15:16:30 +01:00
parent 78f4242e46
commit 23c2f73b3f
10 changed files with 182 additions and 53 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2019 the original author or authors.
* Copyright 2012-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -105,7 +105,11 @@ class ThreadDumpEndpointTests {
.contains(String.format("\t- waiting to lock <%s> (a java.lang.Object) owned by \"%s\" t@%d",
hexIdentityHashCode(contendedMonitor), Thread.currentThread().getName(),
Thread.currentThread().getId()))
.contains(String.format("\t- waiting on <%s> (a java.lang.Object)", hexIdentityHashCode(monitor)))
.satisfiesAnyOf(
(dump) -> dump.contains(String.format("\t- waiting on <%s> (a java.lang.Object)",
hexIdentityHashCode(monitor))),
(dump) -> dump.contains(String.format("\t- parking to wait for <%s> (a java.lang.Object)",
hexIdentityHashCode(monitor))))
.containsPattern(
String.format("Locked ownable synchronizers:%n\t- Locked <[0-9a-z]+> \\(a %s\\$NonfairSync\\)",
ReentrantReadWriteLock.class.getName().replace(".", "\\.")));