test_class.declarator: processor
test_class.original_string: VhdProcessor processor;
test_class.type: VhdProcessor
test_class.var_name: processor
test_class.declarator: mockStorageLayer
test_class.modifier: @Mock
test_class.original_string: @Mock
      StorageLayer mockStorageLayer;
test_class.type: StorageLayer
test_class.var_name: mockStorageLayer
test_class.file: nucleo/src/test/java/com/cloud/storage/template/VhdProcessorTest.java
test_class.identifier: VhdProcessorTest
test_case.body: @Test
      public void testGetVirtualSize() throws Exception{
          long virtualSize = 2000;
          long actualSize = 1000;
          File mockFile = Mockito.mock(File.class);
          Mockito.when(mockFile.length()).thenReturn(actualSize);
          Mockito.doReturn(virtualSize).when(processor).getTemplateVirtualSize((File) Mockito.any());
          Assert.assertEquals(virtualSize, processor.getVirtualSize(mockFile));
          Mockito.verify(mockFile,Mockito.times(0)).length();
      }
test_case.class_method_signature: VhdProcessorTest.testGetVirtualSize()
test_case.full_signature: @Test public void testGetVirtualSize()
test_case.identifier: testGetVirtualSize
test_case.invocations: mock thenReturn when length getTemplateVirtualSize when doReturn any assertEquals getVirtualSize length verify times
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testGetVirtualSize()
focal_class.declarator: s_logger = LoggerFactory.getLogger(VhdProcessor.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger s_logger = LoggerFactory.getLogger(VhdProcessor.class);
focal_class.type: Logger
focal_class.var_name: s_logger
focal_class.declarator: _storage
focal_class.original_string: StorageLayer _storage;
focal_class.type: StorageLayer
focal_class.var_name: _storage
focal_class.declarator: vhdFooterSize = 512
focal_class.modifier: private
focal_class.original_string: private int vhdFooterSize = 512;
focal_class.type: int
focal_class.var_name: vhdFooterSize
focal_class.declarator: vhdFooterCreatorAppOffset = 28
focal_class.modifier: private
focal_class.original_string: private int vhdFooterCreatorAppOffset = 28;
focal_class.type: int
focal_class.var_name: vhdFooterCreatorAppOffset
focal_class.declarator: vhdFooterCreatorVerOffset = 32
focal_class.modifier: private
focal_class.original_string: private int vhdFooterCreatorVerOffset = 32;
focal_class.type: int
focal_class.var_name: vhdFooterCreatorVerOffset
focal_class.declarator: vhdFooterCurrentSizeOffset = 48
focal_class.modifier: private
focal_class.original_string: private int vhdFooterCurrentSizeOffset = 48;
focal_class.type: int
focal_class.var_name: vhdFooterCurrentSizeOffset
focal_class.declarator: citrixCreatorApp = { {0x74, 0x61, 0x70, 0x00}, {0x43, 0x54, 0x58, 0x53}}
focal_class.modifier: private
focal_class.original_string: private byte[][] citrixCreatorApp = { {0x74, 0x61, 0x70, 0x00}, {0x43, 0x54, 0x58, 0x53}};
focal_class.type: byte[][]
focal_class.var_name: citrixCreatorApp
focal_class.file: nucleo/src/main/java/com/cloud/storage/template/VhdProcessor.java
focal_class.identifier: VhdProcessor
focal_class.interfaces: implements Processor
focal_class.class_method_signature: VhdProcessor.process(String templatePath, ImageFormat format, String templateName)
focal_class.full_signature: @Override public FormatInfo process(String templatePath, ImageFormat format, String templateName)
focal_class.identifier: process
focal_class.modifiers: @Override public
focal_class.parameters: (String templatePath, ImageFormat format, String templateName)
focal_class.return: FormatInfo
focal_class.signature: FormatInfo process(String templatePath, ImageFormat format, String templateName)
focal_class.class_method_signature: VhdProcessor.getVirtualSize(File file)
focal_class.full_signature: @Override public long getVirtualSize(File file)
focal_class.identifier: getVirtualSize
focal_class.modifiers: @Override public
focal_class.parameters: (File file)
focal_class.return: long
focal_class.signature: long getVirtualSize(File file)
focal_class.class_method_signature: VhdProcessor.getTemplateVirtualSize(File file)
focal_class.full_signature: protected long getTemplateVirtualSize(File file)
focal_class.identifier: getTemplateVirtualSize
focal_class.modifiers: protected
focal_class.parameters: (File file)
focal_class.return: long
focal_class.signature: long getTemplateVirtualSize(File file)
focal_class.class_method_signature: VhdProcessor.configure(String name, Map<String, Object> params)
focal_class.full_signature: @Override public boolean configure(String name, Map<String, Object> params)
focal_class.identifier: configure
focal_class.modifiers: @Override public
focal_class.parameters: (String name, Map<String, Object> params)
focal_class.return: boolean
focal_class.signature: boolean configure(String name, Map<String, Object> params)
focal_class.superclass: extends AdapterBase
focal_method.body: @Override
      public long getVirtualSize(File file) throws IOException {
          try {
              long size = getTemplateVirtualSize(file);
              return size;
          } catch (Exception e) {
              s_logger.info("[ignored]" + "failed to get template virtual size for VHD: " + e.getLocalizedMessage());
          }
          return file.length();
      }
focal_method.class_method_signature: VhdProcessor.getVirtualSize(File file)
focal_method.full_signature: @Override public long getVirtualSize(File file)
focal_method.identifier: getVirtualSize
focal_method.invocations: getTemplateVirtualSize info getLocalizedMessage length
focal_method.modifiers: @Override public
focal_method.parameters: (File file)
focal_method.return: long
focal_method.signature: long getVirtualSize(File file)