Author: mbenson
Date: Thu Feb 10 23:50:23 2011
New Revision: 1069618
URL: http://svn.apache.org/viewvc?rev=1069618&view=rev
Log:
[COLLECTIONS-330] remove unreasonable expectations from LRUMap synchronized
iteration tests
Modified:
commons/proper/collections/trunk/src/test/org/apache/commons/collections/map/TestLRUMap.java
Modified:
commons/proper/collections/trunk/src/test/org/apache/commons/collections/map/TestLRUMap.java
URL:
http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/test/org/apache/commons/collections/map/TestLRUMap.java?rev=1069618&r1=1069617&r2=1069618&view=diff
==============================================================================
---
commons/proper/collections/trunk/src/test/org/apache/commons/collections/map/TestLRUMap.java
(original)
+++
commons/proper/collections/trunk/src/test/org/apache/commons/collections/map/TestLRUMap.java
Thu Feb 10 23:50:23 2011
@@ -475,8 +475,7 @@ public class TestLRUMap<K, V> extends Ab
} 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 Ab
}
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 Ab
+ 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 Ab
}
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();
}
}