Github user nvazquez commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/1518#discussion_r61756168
  
    --- Diff: 
plugins/hypervisors/vmware/test/com/cloud/hypervisor/vmware/resource/VmwareResourceTest.java
 ---
    @@ -117,4 +154,79 @@ public void testStartVm3dgpuEnabled() throws Exception{
             verify(vmMo3dgpu).configureVm(any(VirtualMachineConfigSpec.class));
         }
     
    -}
    +    // 
---------------------------------------------------------------------------------------------------
    +
    +    @Test
    +    public void testgetNfsVersionFromNfsTONull(){
    +        assertFalse(_resource.getStorageNfsVersionFromNfsTO(null));
    +    }
    +
    +    @Test
    +    public void testgetNfsVersionFromNfsTONfsVersionNull(){
    +        
when(srcDataNfsTO.getNfsVersion()).thenReturn(NFS_VERSION_NOT_PRESENT);
    +        assertFalse(_resource.getStorageNfsVersionFromNfsTO(srcDataNfsTO));
    +    }
    +
    +    @Test
    +    public void testgetNfsVersionFromNfsTONfsVersion(){
    +        assertTrue(_resource.getStorageNfsVersionFromNfsTO(srcDataNfsTO));
    +    }
    +
    +    // 
---------------------------------------------------------------------------------------------------
    +
    +    @Test
    +    public void testSetCurrentNfsVersionInProcessorAndHandler(){
    +        _resource.setCurrentNfsVersionInProcessorAndHandler();
    +        verify(storageHandler).reconfigureNfsVersion(any(Integer.class));
    +    }
    +
    +    // 
---------------------------------------------------------------------------------------------------
    +
    +    @Test
    +    public void testExamineStorageSubSystemCommandNfsVersionNotPresent(){
    +        
when(srcDataNfsTO.getNfsVersion()).thenReturn(NFS_VERSION_NOT_PRESENT);
    +        _resource.examineStorageSubSystemCommandNfsVersion(storageCmd);
    +        verify(_resource, 
never()).setCurrentNfsVersionInProcessorAndHandler();
    +    }
    +
    +    @Test
    +    public void testExamineStorageSubSystemCommandNfsVersion(){
    +        _resource.examineStorageSubSystemCommandNfsVersion(storageCmd);
    +        verify(_resource).setCurrentNfsVersionInProcessorAndHandler();
    +    }
    +
    +    // 
---------------------------------------------------------------------------------------------------
    +
    +    @Test
    +    public void testStorageSetNfsVersion(){
    +        
_resource.checkStorageProcessorAndHandlerNfsVersionAttribute(storageCmd);
    +        assertEquals(NFS_VERSION, _resource._storageNfsVersion);
    +
    +        //Call again to verify that version won't be set again once it is 
set (examineStorageSubSystemCommandNfsVersion - only one time)
    +        
_resource.checkStorageProcessorAndHandlerNfsVersionAttribute(storageCmd);
    +        
verify(_resource).examineStorageSubSystemCommandNfsVersion(storageCmd);     
//Only 1 time, default for verify.
    +    }
    +
    +    @Test
    +    public void testStorageNfsVersionNotPresent(){
    --- End diff --
    
    Nice, I'll work on this


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to