* FYI: tiny extra tests on unmodifiableMap linked to PR 27128
@ 2006-04-23 16:36 Olivier Jolly
0 siblings, 0 replies; only message in thread
From: Olivier Jolly @ 2006-04-23 16:36 UTC (permalink / raw)
To: Mauve Patch List
[-- Attachment #1: Type: text/plain, Size: 342 bytes --]
Hi,
I added a little check to David tests on the mutability of a map via
UnmodifiableMap.entrySet().toArray(Object[]).
Cheers
+Olivier
2006-04-23 Olivier Jolly <olivier.jolly@pcedev.com>
* gnu/testlet/java/util/Collections/unmodifiableMap.java(testMap):
Added regression test on UnmodifiableMap.entrySet().toArray(Object[]).
[-- Attachment #2: unmodifiableMapToArray2.patch --]
[-- Type: text/x-patch, Size: 879 bytes --]
Index: unmodifiableMap.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/java/util/Collections/unmodifiableMap.java,v
retrieving revision 1.1
diff -u -r1.1 unmodifiableMap.java
--- unmodifiableMap.java 12 Apr 2006 09:32:06 -0000 1.1
+++ unmodifiableMap.java 23 Apr 2006 16:31:43 -0000
@@ -135,5 +135,22 @@
harness.check(pass);
}
+ // check a Map.Entry item from entrySet().toArray(Object[])
+ pass = false;
+ Object[] entries2 = new Object[umap.size()];
+ umap.entrySet().toArray(entries2);
+ if (entries2.length > 0)
+ {
+ try
+ {
+ ((Map.Entry) entries2[0]).setValue("XYZ");
+ }
+ catch (UnsupportedOperationException e)
+ {
+ pass = true;
+ }
+ harness.check(pass);
+ }
+
}
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2006-04-23 16:36 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-04-23 16:36 FYI: tiny extra tests on unmodifiableMap linked to PR 27128 Olivier Jolly
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).