01: /*
02: * Copyright 2007 Google Inc.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License"); you may not
05: * use this file except in compliance with the License. You may obtain a copy of
06: * the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12: * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13: * License for the specific language governing permissions and limitations under
14: * the License.
15: */
16: package com.google.gwt.emultest.java.util;
17:
18: import org.apache.commons.collections.TestSet;
19:
20: import java.util.HashMap;
21: import java.util.HashSet;
22: import java.util.Map;
23: import java.util.Set;
24:
25: /**
26: * TODO: document me.
27: */
28: public class HashSetTest extends TestSet {
29:
30: public HashSetTest() {
31: super ("Dummy");
32: }
33:
34: public void testAddingKeys() {
35: Map map = new HashMap();
36: Set keys = new HashSet(map.keySet());
37: keys.add(new Object()); // Throws exception in IE6 (web-mode) but not GWT
38: }
39:
40: public void testAddWatch() {
41: HashSet s = new HashSet();
42: s.add("watch");
43: assertTrue(s.contains("watch"));
44: }
45:
46: protected Set makeEmptySet() {
47: return new HashSet();
48: }
49:
50: public Object makeObject() {
51: return new HashSet();
52: }
53:
54: }
|