--- jsr166/src/test/tck/ConcurrentSkipListSubMapTest.java 2006/04/20 20:35:00 1.5 +++ jsr166/src/test/tck/ConcurrentSkipListSubMapTest.java 2009/11/16 04:57:10 1.7 @@ -11,7 +11,7 @@ import java.io.*; public class ConcurrentSkipListSubMapTest extends JSR166TestCase { public static void main(String[] args) { - junit.textui.TestRunner.run (suite()); + junit.textui.TestRunner.run (suite()); } public static Test suite() { return new TestSuite(ConcurrentSkipListSubMapTest.class); @@ -20,7 +20,7 @@ public class ConcurrentSkipListSubMapTes /** * Create a map from Integers 1-5 to Strings "A"-"E". */ - private static ConcurrentNavigableMap map5() { + private static ConcurrentNavigableMap map5() { ConcurrentSkipListMap map = new ConcurrentSkipListMap(); assertTrue(map.isEmpty()); map.put(zero, "Z"); @@ -38,7 +38,7 @@ public class ConcurrentSkipListSubMapTes /** * Create a map from Integers -5 to -1 to Strings "A"-"E". */ - private static ConcurrentNavigableMap dmap5() { + private static ConcurrentNavigableMap dmap5() { ConcurrentSkipListMap map = new ConcurrentSkipListMap(); assertTrue(map.isEmpty()); map.put(m1, "A"); @@ -51,13 +51,13 @@ public class ConcurrentSkipListSubMapTes return map.descendingMap(); } - private static ConcurrentNavigableMap map0() { + private static ConcurrentNavigableMap map0() { ConcurrentSkipListMap map = new ConcurrentSkipListMap(); assertTrue(map.isEmpty()); return map.tailMap(one, true); } - private static ConcurrentNavigableMap dmap0() { + private static ConcurrentNavigableMap dmap0() { ConcurrentSkipListMap map = new ConcurrentSkipListMap(); assertTrue(map.isEmpty()); return map; @@ -239,7 +239,7 @@ public class ConcurrentSkipListSubMapTes Iterator it = s.iterator(); while (it.hasNext()) { Map.Entry e = (Map.Entry) it.next(); - assertTrue( + assertTrue( (e.getKey().equals(one) && e.getValue().equals("A")) || (e.getKey().equals(two) && e.getValue().equals("B")) || (e.getKey().equals(three) && e.getValue().equals("C")) || @@ -497,7 +497,7 @@ public class ConcurrentSkipListSubMapTes for (int i = 1; i <= 5; ++i) { assertTrue(s.indexOf(String.valueOf(i)) >= 0); } - } + } // Exception tests @@ -509,7 +509,7 @@ public class ConcurrentSkipListSubMapTes ConcurrentNavigableMap c = map5(); c.get(null); shouldThrow(); - } catch(NullPointerException e){} + } catch (NullPointerException e){} } /** @@ -520,7 +520,7 @@ public class ConcurrentSkipListSubMapTes ConcurrentNavigableMap c = map5(); c.containsKey(null); shouldThrow(); - } catch(NullPointerException e){} + } catch (NullPointerException e){} } /** @@ -531,7 +531,7 @@ public class ConcurrentSkipListSubMapTes ConcurrentNavigableMap c = map0(); c.containsValue(null); shouldThrow(); - } catch(NullPointerException e){} + } catch (NullPointerException e){} } @@ -543,7 +543,7 @@ public class ConcurrentSkipListSubMapTes ConcurrentNavigableMap c = map5(); c.put(null, "whatever"); shouldThrow(); - } catch(NullPointerException e){} + } catch (NullPointerException e){} } /** @@ -554,7 +554,7 @@ public class ConcurrentSkipListSubMapTes ConcurrentNavigableMap c = map5(); c.putIfAbsent(null, "whatever"); shouldThrow(); - } catch(NullPointerException e){} + } catch (NullPointerException e){} } /** @@ -565,7 +565,7 @@ public class ConcurrentSkipListSubMapTes ConcurrentNavigableMap c = map5(); c.replace(null, "whatever"); shouldThrow(); - } catch(NullPointerException e){} + } catch (NullPointerException e){} } /** @@ -576,7 +576,7 @@ public class ConcurrentSkipListSubMapTes ConcurrentNavigableMap c = map5(); c.replace(null, one, "whatever"); shouldThrow(); - } catch(NullPointerException e){} + } catch (NullPointerException e){} } /** @@ -587,7 +587,7 @@ public class ConcurrentSkipListSubMapTes ConcurrentNavigableMap c = map5(); c.remove(null); shouldThrow(); - } catch(NullPointerException e){} + } catch (NullPointerException e){} } /** @@ -598,7 +598,7 @@ public class ConcurrentSkipListSubMapTes ConcurrentNavigableMap c = map5(); c.remove(null, "whatever"); shouldThrow(); - } catch(NullPointerException e){} + } catch (NullPointerException e){} } /** @@ -619,7 +619,7 @@ public class ConcurrentSkipListSubMapTes assertEquals(q.size(), r.size()); assertTrue(q.equals(r)); assertTrue(r.equals(q)); - } catch(Exception e){ + } catch (Exception e){ e.printStackTrace(); unexpectedException(); } @@ -938,7 +938,7 @@ public class ConcurrentSkipListSubMapTes Iterator it = s.iterator(); while (it.hasNext()) { Map.Entry e = (Map.Entry) it.next(); - assertTrue( + assertTrue( (e.getKey().equals(m1) && e.getValue().equals("A")) || (e.getKey().equals(m2) && e.getValue().equals("B")) || (e.getKey().equals(m3) && e.getValue().equals("C")) || @@ -1196,7 +1196,7 @@ public class ConcurrentSkipListSubMapTes for (int i = 1; i <= 5; ++i) { assertTrue(s.indexOf(String.valueOf(i)) >= 0); } - } + } // Exception testDescendings @@ -1208,7 +1208,7 @@ public class ConcurrentSkipListSubMapTes ConcurrentNavigableMap c = dmap5(); c.get(null); shouldThrow(); - } catch(NullPointerException e){} + } catch (NullPointerException e){} } /** @@ -1219,7 +1219,7 @@ public class ConcurrentSkipListSubMapTes ConcurrentNavigableMap c = dmap5(); c.containsKey(null); shouldThrow(); - } catch(NullPointerException e){} + } catch (NullPointerException e){} } /** @@ -1230,7 +1230,7 @@ public class ConcurrentSkipListSubMapTes ConcurrentNavigableMap c = dmap0(); c.containsValue(null); shouldThrow(); - } catch(NullPointerException e){} + } catch (NullPointerException e){} } @@ -1242,7 +1242,7 @@ public class ConcurrentSkipListSubMapTes ConcurrentNavigableMap c = dmap5(); c.put(null, "whatever"); shouldThrow(); - } catch(NullPointerException e){} + } catch (NullPointerException e){} } /** @@ -1253,7 +1253,7 @@ public class ConcurrentSkipListSubMapTes ConcurrentNavigableMap c = dmap5(); c.putIfAbsent(null, "whatever"); shouldThrow(); - } catch(NullPointerException e){} + } catch (NullPointerException e){} } /** @@ -1264,7 +1264,7 @@ public class ConcurrentSkipListSubMapTes ConcurrentNavigableMap c = dmap5(); c.replace(null, "whatever"); shouldThrow(); - } catch(NullPointerException e){} + } catch (NullPointerException e){} } /** @@ -1275,7 +1275,7 @@ public class ConcurrentSkipListSubMapTes ConcurrentNavigableMap c = dmap5(); c.replace(null, m1, "whatever"); shouldThrow(); - } catch(NullPointerException e){} + } catch (NullPointerException e){} } /** @@ -1286,7 +1286,7 @@ public class ConcurrentSkipListSubMapTes ConcurrentNavigableMap c = dmap5(); c.remove(null); shouldThrow(); - } catch(NullPointerException e){} + } catch (NullPointerException e){} } /** @@ -1297,7 +1297,7 @@ public class ConcurrentSkipListSubMapTes ConcurrentNavigableMap c = dmap5(); c.remove(null, "whatever"); shouldThrow(); - } catch(NullPointerException e){} + } catch (NullPointerException e){} } /** @@ -1318,7 +1318,7 @@ public class ConcurrentSkipListSubMapTes assertEquals(q.size(), r.size()); assertTrue(q.equals(r)); assertTrue(r.equals(q)); - } catch(Exception e){ + } catch (Exception e){ e.printStackTrace(); unexpectedException(); } @@ -1460,5 +1460,5 @@ public class ConcurrentSkipListSubMapTes assertEquals(3, sm.size()); assertEquals(4, map.size()); } - + }