Test retrieval of the primary key set and that the retrieved set is not a pointer to the master set in the MapKeyMap.
()
| 150 | * not a pointer to the master set in the MapKeyMap. |
| 151 | */ |
| 152 | @Test |
| 153 | public void testGetKeySet() |
| 154 | { |
| 155 | Set<MapKey<?, ?>> keySet = mapKeyMap.getKeySet(); |
| 156 | |
| 157 | assertEquals(1, keySet.size(), "only one primary key"); |
| 158 | assertEquals(MapKey.ASPECT, keySet |
| 159 | .toArray()[0], "Only element should be an aspect"); |
| 160 | |
| 161 | mapKeyMap.addToMapFor(MapKey.PROPERTY, "foo", "bar"); |
| 162 | assertEquals( |
| 163 | 1, keySet.size(), "Still only one primary key, returned set should be independant of main collection"); |
| 164 | assertFalse(keySet.contains(MapKey.PROPERTY), "Set should not include test yet"); |
| 165 | |
| 166 | keySet = mapKeyMap.getKeySet(); |
| 167 | assertEquals(2, keySet.size(), "Now two primary keys"); |
| 168 | assertTrue(keySet.contains(MapKey.ASPECT), "Set should include aspect"); |
| 169 | assertTrue(keySet.contains(MapKey.PROPERTY), "Set should include test"); |
| 170 | } |
| 171 | |
| 172 | /** |
| 173 | * Test the containsMapFor method and the effect of adding and |
nothing calls this directly
no test coverage detected