[COLLECTIONS-330] remove unreasonable expectations from LRUMap synchronized iteration tests

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/collections/trunk@1069618 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Matthew Jason Benson 2011-02-10 23:50:23 +00:00
parent 9b3bfe2fb9
commit a6d51b8d2f
1 changed files with 6 additions and 8 deletions

View File

@ -475,8 +475,7 @@ public class TestLRUMap<K, V> extends AbstractTestOrderedMap<K, V> {
} catch (IndexOutOfBoundsException ex) {}
}
// TODO: COLLECTIONS-330
public void todoTestSynchronizedRemoveFromMapIterator() throws InterruptedException {
public void testSynchronizedRemoveFromMapIterator() throws InterruptedException {
final LRUMap<Object, Thread> map = new LRUMap<Object, Thread>(10000);
@ -511,8 +510,8 @@ public class TestLRUMap<K, V> extends AbstractTestOrderedMap<K, V> {
}
synchronized (map) {
for (MapIterator<Object, Thread> iter = map.mapIterator(); iter.hasNext();) {
String name = (String)iter.next();
if (map.get(name) == this) {
iter.next();
if (iter.getValue() == this) {
iter.remove();
}
}
@ -642,8 +641,7 @@ public class TestLRUMap<K, V> extends AbstractTestOrderedMap<K, V> {
+ counter[0] + " did succeed", counter[0] >= threads.length);
}
// TODO: COLLECTIONS-330
public void todoTestSynchronizedRemoveFromKeySet() throws InterruptedException {
public void testSynchronizedRemoveFromKeySet() throws InterruptedException {
final Map<Object, Thread> map = new LRUMap<Object, Thread>(10000);
@ -678,8 +676,8 @@ public class TestLRUMap<K, V> extends AbstractTestOrderedMap<K, V> {
}
synchronized (map) {
for (Iterator<Object> iter = map.keySet().iterator(); iter.hasNext();) {
String name = (String)iter.next();
if (map.get(name) == this) {
String name = (String) iter.next();
if (name.substring(0, name.indexOf('[')).equals(getName())) {
iter.remove();
}
}