コード例 #1
0
 /**
  * Return a List of all other vms except for one along with a parallel stop mode list, and also
  * return the one vm not in the list.
  *
  * @return [0] (List<ClientVmInfo>)A List of ClientVmInfo instances; this includes all vms except
  *     the current vm and except for one other vm. [1] (List<String>) A parallel List to [0]
  *     containing stop modes. [2] (ClientVMInfo) The ClientVmInfo instance of the one vm excluded
  *     from [0] (other than this vm) [3] (String) The stop mode for [2] [4] (List<ClientVmInfo>) A
  *     List of ClientVmInfo instances for all vms except this one. [5] (List<String>) A parallel
  *     List to [4] of stop modes.
  */
 public static Object[] getOtherVMsDivided(String[] excludedClientNames) {
   Vector<Integer> otherVmIDs = ClientVmMgr.getOtherClientVmids();
   List<ClientVmInfo> allOtherVMs = new ArrayList();
   List<String> stopModeList = new ArrayList();
   for (int i = 0; i < otherVmIDs.size(); i++) {
     ClientVmInfo info = new ClientVmInfo(otherVmIDs.get(i));
     ClientVmInfo infoFromBB =
         (ClientVmInfo) StopStartBB.getBB().getSharedMap().get(VmInfoKey + otherVmIDs.get(i));
     if (infoFromBB != null) {
       info = infoFromBB;
     }
     String clientName = info.getClientName();
     if (clientName == null) {
       allOtherVMs.add(info);
       stopModeList.add(TestConfig.tab().stringAt(StopStartPrms.stopModes));
     } else {
       boolean inExcludedNames = false;
       for (String excludeName : excludedClientNames) {
         if (clientName.indexOf(excludeName) >= 0) inExcludedNames = true;
         break;
       }
       if (!inExcludedNames) {
         allOtherVMs.add(info);
         stopModeList.add(TestConfig.tab().stringAt(StopStartPrms.stopModes));
       }
     }
   }
   List<ClientVmInfo> allOtherVMsExceptOne = allOtherVMs.subList(0, allOtherVMs.size() - 1);
   List<String> stopModesExceptOne = stopModeList.subList(0, stopModeList.size() - 1);
   ClientVmInfo remainingVM = allOtherVMs.get(allOtherVMs.size() - 1);
   String remainingStopMode = stopModeList.get(stopModeList.size() - 1);
   return new Object[] {
     allOtherVMsExceptOne,
     stopModesExceptOne,
     remainingVM,
     remainingStopMode,
     allOtherVMs,
     stopModeList
   };
 }
コード例 #2
0
 /**
  * Return a List of all other vms except for one along with a parallel stop mode list, and also
  * return the one vm not in the list.
  *
  * @return [0] (List<ClientVmInfo>)A List of ClientVmInfo instances; this includes all vms except
  *     the current vm and except for one other vm. [1] (List<String>) A parallel List to [0]
  *     containing stop modes. [2] (ClientVMInfo) The ClientVmInfo instance of the one vm excluded
  *     from [0] (other than this vm) [3] (String) The stop mode for [2] [4] (List<ClientVmInfo>) A
  *     List of ClientVmInfo instances for all vms except this one. [5] (List<String>) A parallel
  *     List to [4] of stop modes.
  */
 public static Object[] getOtherVMsDivided() {
   Vector<Integer> otherVmIDs = ClientVmMgr.getOtherClientVmids();
   List<ClientVmInfo> allOtherVMs = new ArrayList();
   List<String> stopModeList = new ArrayList();
   for (int i = 0; i < otherVmIDs.size(); i++) {
     ClientVmInfo info = new ClientVmInfo(otherVmIDs.get(i));
     allOtherVMs.add(info);
     stopModeList.add(TestConfig.tab().stringAt(StopStartPrms.stopModes));
   }
   List<ClientVmInfo> allOtherVMsExceptOne = allOtherVMs.subList(0, allOtherVMs.size() - 1);
   List<String> stopModesExceptOne = stopModeList.subList(0, stopModeList.size() - 1);
   ClientVmInfo remainingVM = allOtherVMs.get(allOtherVMs.size() - 1);
   String remainingStopMode = stopModeList.get(stopModeList.size() - 1);
   return new Object[] {
     allOtherVMsExceptOne,
     stopModesExceptOne,
     remainingVM,
     remainingStopMode,
     allOtherVMs,
     stopModeList
   };
 }