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