@Test
 public void testExamineStorageSubSystemCommandFullCloneFlagForVmware() {
   EnumMap<VmwareStorageProcessorConfigurableFields, Object> params2 =
       _resource.examineStorageSubSystemCommandFullCloneFlagForVmware(storageCmd, params);
   verify(destDataTO).getDataStore();
   verify(destDataStoreTO, times(2)).isFullCloneFlag();
   assertEquals(1, params2.size());
   assertEquals(
       FULL_CLONE_FLAG, params2.get(VmwareStorageProcessorConfigurableFields.FULL_CLONE_FLAG));
 }
Beispiel #2
0
  private EnumMap<GHOST, MOVE> _completeGhostMoves(EnumMap<GHOST, MOVE> moves) {
    if (moves == null) {
      moves = new EnumMap<GHOST, MOVE>(GHOST.class);

      for (GHOST ghostType : GHOST.values())
        moves.put(ghostType, fantasmas.get(ghostType).lastMoveMade);
    }

    if (moves.size() < NUM_GHOSTS)
      for (GHOST ghostType : GHOST.values())
        if (!moves.containsKey(ghostType)) moves.put(ghostType, MOVE.NEUTRAL);

    return moves;
  }
  public void testEnumMap() throws Exception {
    ObjectMapper mapper = new ObjectMapper();
    String JSON = "{ \"KEY1\" : \"\", \"WHATEVER\" : null }";

    // to get typing, must use type reference
    EnumMap<Key, String> result =
        mapper.readValue(JSON, new TypeReference<EnumMap<Key, String>>() {});

    assertNotNull(result);
    assertEquals(EnumMap.class, result.getClass());
    assertEquals(2, result.size());

    assertEquals("", result.get(Key.KEY1));
    // null should be ok too...
    assertTrue(result.containsKey(Key.WHATEVER));
    assertNull(result.get(Key.WHATEVER));

    // plus we have nothing for this key
    assertFalse(result.containsKey(Key.KEY2));
    assertNull(result.get(Key.KEY2));
  }
 @Test
 public void testExamineStorageSubSystemCommandNfsVersion() {
   _resource.examineStorageSubSystemCommandNfsVersion(storageCmd, params);
   assertEquals(1, params.size());
   assertEquals(NFS_VERSION, params.get(VmwareStorageProcessorConfigurableFields.NFS_VERSION));
 }