diff options
author | Bernard Normier <bernard@zeroc.com> | 2007-07-12 11:25:26 -0400 |
---|---|---|
committer | Bernard Normier <bernard@zeroc.com> | 2007-07-12 11:26:12 -0400 |
commit | da39c048b64539f5fb658d262dfd5f31d0a3abfd (patch) | |
tree | d723fc487a9f8373d7bd969f4320491bad4b2d98 /java/test/Freeze/dbmap/Client.java | |
parent | Fixed bug #1982 (diff) | |
download | ice-da39c048b64539f5fb658d262dfd5f31d0a3abfd.tar.bz2 ice-da39c048b64539f5fb658d262dfd5f31d0a3abfd.tar.xz ice-da39c048b64539f5fb658d262dfd5f31d0a3abfd.zip |
Fixed bug #2299 (findByMEMBER in Java) + tests
Diffstat (limited to 'java/test/Freeze/dbmap/Client.java')
-rw-r--r-- | java/test/Freeze/dbmap/Client.java | 40 |
1 files changed, 35 insertions, 5 deletions
diff --git a/java/test/Freeze/dbmap/Client.java b/java/test/Freeze/dbmap/Client.java index e68989b526c..a985fa937d8 100644 --- a/java/test/Freeze/dbmap/Client.java +++ b/java/test/Freeze/dbmap/Client.java @@ -441,15 +441,16 @@ public class Client } // + // 2 items at 17 + // + m.put(new Byte((byte)alphabet.charAt(21)), new Integer(17)); + + // // Non-existent index value // - p = typedM.findByValue(100); + p = typedM.findByValue(21); test(!p.hasNext()); - // - // 2 items at 17 - // - m.put(new Byte((byte)alphabet.charAt(21)), new Integer(17)); p = typedM.findByValue(17); @@ -500,6 +501,35 @@ public class Client v = ((Byte)e.getKey()).byteValue(); test(v == (byte)alphabet.charAt(17) || v == (byte)alphabet.charAt(21)); test(typedM.valueCount(17) == 1); + + m.put(new Byte((byte)alphabet.charAt(21)), new Integer(17)); + + // + // Non-exact match + // + p = typedM.findByValue(21); + test(!p.hasNext()); + + test(typedM.valueCount(21) == 0); + + p = typedM.findByValue(21, false); + test(!p.hasNext()); + + p = typedM.findByValue(22, false); + int previous = 21; + int count = 0; + while(p.hasNext()) + { + e = (java.util.Map.Entry)p.next(); + + int val = ((Integer)e.getValue()).intValue(); + + test(val > previous); + previous = val; + count++; + } + test(count == 4); + System.out.println("ok"); } |