mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 23:04:50 +02:00
8193300: Miscellaneous changes imported from jsr166 CVS 2018-01
Reviewed-by: martin
This commit is contained in:
parent
c19d18871c
commit
d771fc3a6b
149 changed files with 872 additions and 571 deletions
|
@ -357,7 +357,7 @@ public class CompletableFutureTest extends JSR166TestCase {
|
|||
* toString indicates current completion state
|
||||
*/
|
||||
public void testToString_incomplete() {
|
||||
CompletableFuture<String> f = new CompletableFuture<String>();
|
||||
CompletableFuture<String> f = new CompletableFuture<>();
|
||||
assertTrue(f.toString().matches(".*\\[.*Not completed.*\\]"));
|
||||
if (testImplementationDetails)
|
||||
assertEquals(identityString(f) + "[Not completed]",
|
||||
|
@ -365,7 +365,7 @@ public class CompletableFutureTest extends JSR166TestCase {
|
|||
}
|
||||
|
||||
public void testToString_normal() {
|
||||
CompletableFuture<String> f = new CompletableFuture<String>();
|
||||
CompletableFuture<String> f = new CompletableFuture<>();
|
||||
assertTrue(f.complete("foo"));
|
||||
assertTrue(f.toString().matches(".*\\[.*Completed normally.*\\]"));
|
||||
if (testImplementationDetails)
|
||||
|
@ -374,7 +374,7 @@ public class CompletableFutureTest extends JSR166TestCase {
|
|||
}
|
||||
|
||||
public void testToString_exception() {
|
||||
CompletableFuture<String> f = new CompletableFuture<String>();
|
||||
CompletableFuture<String> f = new CompletableFuture<>();
|
||||
assertTrue(f.completeExceptionally(new IndexOutOfBoundsException()));
|
||||
assertTrue(f.toString().matches(".*\\[.*Completed exceptionally.*\\]"));
|
||||
if (testImplementationDetails)
|
||||
|
@ -384,7 +384,7 @@ public class CompletableFutureTest extends JSR166TestCase {
|
|||
|
||||
public void testToString_cancelled() {
|
||||
for (boolean mayInterruptIfRunning : new boolean[] { true, false }) {
|
||||
CompletableFuture<String> f = new CompletableFuture<String>();
|
||||
CompletableFuture<String> f = new CompletableFuture<>();
|
||||
assertTrue(f.cancel(mayInterruptIfRunning));
|
||||
assertTrue(f.toString().matches(".*\\[.*Completed exceptionally.*\\]"));
|
||||
if (testImplementationDetails)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue