test_class.declarator: processor
test_class.original_string: QCOW2Processor processor;
test_class.type: QCOW2Processor
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/QCOW2ProcessorTest.java
test_class.identifier: QCOW2ProcessorTest
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: QCOW2ProcessorTest.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(QCOW2Processor.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger s_logger = LoggerFactory.getLogger(QCOW2Processor.class);
focal_class.type: Logger
focal_class.var_name: s_logger
focal_class.declarator: VIRTUALSIZE_HEADER_LOCATION = 24
focal_class.modifier: private static final
focal_class.original_string: private static final int VIRTUALSIZE_HEADER_LOCATION = 24;
focal_class.type: int
focal_class.var_name: VIRTUALSIZE_HEADER_LOCATION
focal_class.declarator: _storage
focal_class.modifier: private
focal_class.original_string: private StorageLayer _storage;
focal_class.type: StorageLayer
focal_class.var_name: _storage
focal_class.file: nucleo/src/main/java/com/cloud/storage/template/QCOW2Processor.java
focal_class.identifier: QCOW2Processor
focal_class.interfaces: implements Processor
focal_class.class_method_signature: QCOW2Processor.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: QCOW2Processor.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: QCOW2Processor.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: QCOW2Processor.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 QCOW2: " + e.getLocalizedMessage());
          }
          return file.length();
      }
focal_method.class_method_signature: QCOW2Processor.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)