test_class.declarator: testParams
test_class.modifier: private static
test_class.original_string: private static Map<String, Object> testParams;
test_class.type: Map<String, Object>
test_class.var_name: testParams
test_class.declarator: s_logger = LoggerFactory.getLogger(LocalNfsSecondaryStorageResourceTest.class.getName())
test_class.modifier: private static final
test_class.original_string: private static final Logger s_logger = LoggerFactory.getLogger(LocalNfsSecondaryStorageResourceTest.class.getName());
test_class.type: Logger
test_class.var_name: s_logger
test_class.declarator: resource
test_class.original_string: LocalNfsSecondaryStorageResource resource;
test_class.type: LocalNfsSecondaryStorageResource
test_class.var_name: resource
test_class.file: services/secondary-storage/server/src/test/java/org/apache/cloudstack/storage/resource/LocalNfsSecondaryStorageResourceTest.java
test_class.identifier: LocalNfsSecondaryStorageResourceTest
test_class.superclass: extends TestCase
test_case.body: @Test
      public void testExecuteRequest() throws Exception {
          TemplateObjectTO template = Mockito.mock(TemplateObjectTO.class);
          NfsTO cacheStore = Mockito.mock(NfsTO.class);
          Mockito.when(cacheStore.getUrl()).thenReturn("nfs://nfs2.lab.vmops.com/export/home/edison/");
          SwiftTO swift = Mockito.mock(SwiftTO.class);
          Mockito.when(swift.getEndPoint()).thenReturn("https://objects.dreamhost.com/auth");
          Mockito.when(swift.getAccount()).thenReturn("cloudstack");
          Mockito.when(swift.getUserName()).thenReturn("images");
          Mockito.when(swift.getKey()).thenReturn("oxvELQaOD1U5_VyosGfA-wpZ7uBWEff-CUBGCM0u");
  
          Mockito.when(template.getDataStore()).thenReturn(swift);
          Mockito.when(template.getPath()).thenReturn("template/1/1/");
          Mockito.when(template.isRequiresHvm()).thenReturn(true);
          Mockito.when(template.getId()).thenReturn(1L);
          Mockito.when(template.getFormat()).thenReturn(Storage.ImageFormat.VHD);
          Mockito.when(template.getOrigUrl()).thenReturn("http://nfs1.lab.vmops.com/templates/test.bz2");
          Mockito.when(template.getName()).thenReturn(UUID.randomUUID().toString());
          Mockito.when(template.getObjectType()).thenReturn(DataObjectType.TEMPLATE);
  
          DownloadCommand cmd = new DownloadCommand(template, 100000L);
          cmd.setCacheStore(cacheStore);
          DownloadAnswer answer = (DownloadAnswer)resource.executeRequest(cmd);
          Assert.assertTrue(answer.getResult());
  
          Mockito.when(template.getPath()).thenReturn(answer.getInstallPath());
          Mockito.when(template.getDataStore()).thenReturn(swift);
          //download swift:
          Mockito.when(cacheStore.getRole()).thenReturn(DataStoreRole.ImageCache);
          TemplateObjectTO destTemplate = Mockito.mock(TemplateObjectTO.class);
          Mockito.when(destTemplate.getPath()).thenReturn("template/1/2");
          Mockito.when(destTemplate.getDataStore()).thenReturn(cacheStore);
          Mockito.when(destTemplate.getObjectType()).thenReturn(DataObjectType.TEMPLATE);
          CopyCommand cpyCmd = new CopyCommand(template, destTemplate, 10000, true);
          CopyCmdAnswer copyCmdAnswer = (CopyCmdAnswer)resource.executeRequest(cpyCmd);
          Assert.assertTrue(copyCmdAnswer.getResult());
  
          //list template
          ListTemplateCommand listCmd = new ListTemplateCommand(swift);
          ListTemplateAnswer listAnswer = (ListTemplateAnswer)resource.executeRequest(listCmd);
  
          Assert.assertTrue(listAnswer.getTemplateInfo().size() > 0);
      }
test_case.class_method_signature: LocalNfsSecondaryStorageResourceTest.testExecuteRequest()
test_case.full_signature: @Test public void testExecuteRequest()
test_case.identifier: testExecuteRequest
test_case.invocations: mock mock thenReturn when getUrl mock thenReturn when getEndPoint thenReturn when getAccount thenReturn when getUserName thenReturn when getKey thenReturn when getDataStore thenReturn when getPath thenReturn when isRequiresHvm thenReturn when getId thenReturn when getFormat thenReturn when getOrigUrl thenReturn when getName toString randomUUID thenReturn when getObjectType setCacheStore executeRequest assertTrue getResult thenReturn when getPath getInstallPath thenReturn when getDataStore thenReturn when getRole mock thenReturn when getPath thenReturn when getDataStore thenReturn when getObjectType executeRequest assertTrue getResult executeRequest assertTrue size getTemplateInfo
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testExecuteRequest()
focal_class.declarator: s_logger = LoggerFactory.getLogger(LocalNfsSecondaryStorageResource.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger s_logger = LoggerFactory.getLogger(LocalNfsSecondaryStorageResource.class);
focal_class.type: Logger
focal_class.var_name: s_logger
focal_class.file: services/secondary-storage/server/src/main/java/org/apache/cloudstack/storage/resource/LocalNfsSecondaryStorageResource.java
focal_class.identifier: LocalNfsSecondaryStorageResource
focal_class.class_method_signature: LocalNfsSecondaryStorageResource.LocalNfsSecondaryStorageResource()
focal_class.full_signature: public  LocalNfsSecondaryStorageResource()
focal_class.identifier: LocalNfsSecondaryStorageResource
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.signature:  LocalNfsSecondaryStorageResource()
focal_class.class_method_signature: LocalNfsSecondaryStorageResource.setParentPath(String path)
focal_class.full_signature: @Override public void setParentPath(String path)
focal_class.identifier: setParentPath
focal_class.modifiers: @Override public
focal_class.parameters: (String path)
focal_class.return: void
focal_class.signature: void setParentPath(String path)
focal_class.class_method_signature: LocalNfsSecondaryStorageResource.executeRequest(Command cmd)
focal_class.full_signature: @Override public Answer executeRequest(Command cmd)
focal_class.identifier: executeRequest
focal_class.modifiers: @Override public
focal_class.parameters: (Command cmd)
focal_class.return: Answer
focal_class.signature: Answer executeRequest(Command cmd)
focal_class.class_method_signature: LocalNfsSecondaryStorageResource.getRootDir(String secUrl)
focal_class.full_signature: @Override synchronized public String getRootDir(String secUrl)
focal_class.identifier: getRootDir
focal_class.modifiers: @Override synchronized public
focal_class.parameters: (String secUrl)
focal_class.return: String
focal_class.signature: String getRootDir(String secUrl)
focal_class.class_method_signature: LocalNfsSecondaryStorageResource.mount(String localRootPath, String remoteDevice, URI uri)
focal_class.full_signature: @Override protected void mount(String localRootPath, String remoteDevice, URI uri)
focal_class.identifier: mount
focal_class.modifiers: @Override protected
focal_class.parameters: (String localRootPath, String remoteDevice, URI uri)
focal_class.return: void
focal_class.signature: void mount(String localRootPath, String remoteDevice, URI uri)
focal_class.superclass: extends NfsSecondaryStorageResource
focal_method.body: @Override
      public Answer executeRequest(Command cmd) {
          return super.executeRequest(cmd);
      }
focal_method.class_method_signature: LocalNfsSecondaryStorageResource.executeRequest(Command cmd)
focal_method.full_signature: @Override public Answer executeRequest(Command cmd)
focal_method.identifier: executeRequest
focal_method.invocations: executeRequest
focal_method.modifiers: @Override public
focal_method.parameters: (Command cmd)
focal_method.return: Answer
focal_method.signature: Answer executeRequest(Command cmd)