Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 0 additions & 30 deletions test/jdk/java/util/concurrent/ConcurrentLinkedQueue/WhiteBox.java
Original file line number Diff line number Diff line change
Expand Up @@ -281,36 +281,6 @@ public void pollActionsOneNodeSlack(
assertInvariants(q);
}

/**
* Actions that append an element, and are expected to
* leave at most one slack node at tail.
*/
@DataProvider
public Object[][] addActions() {
return List.<Consumer<ConcurrentLinkedQueue>>of(
q -> q.add(1),
q -> q.offer(1))
.stream().map(x -> new Object[]{ x }).toArray(Object[][]::new);
}

@Test(dataProvider = "addActions")
public void addActionsOneNodeSlack(
Consumer<ConcurrentLinkedQueue> addAction) {
ConcurrentLinkedQueue q = new ConcurrentLinkedQueue();
int n = 1 + rnd.nextInt(5);
for (int i = 0; i < n; i++) {
boolean slack = next(tail(q)) != null;
addAction.accept(q);
if (slack)
assertNull(next(tail(q)));
else {
assertNotNull(next(tail(q)));
assertNull(next(next(tail(q))));
}
assertInvariants(q);
}
}

byte[] serialBytes(Object o) {
try {
ByteArrayOutputStream bos = new ByteArrayOutputStream();
Expand Down