test_class.declarator: virtualImageGenerator
test_class.modifier: private
test_class.original_string: private VirtualMachineTemplateGenerator virtualImageGenerator;
test_class.type: VirtualMachineTemplateGenerator
test_class.var_name: virtualImageGenerator
test_class.declarator: enterpriseGenerator
test_class.modifier: private
test_class.original_string: private EnterpriseGenerator enterpriseGenerator;
test_class.type: EnterpriseGenerator
test_class.var_name: enterpriseGenerator
test_class.declarator: virtualMachineGenerator
test_class.modifier: private
test_class.original_string: private VirtualMachineGenerator virtualMachineGenerator;
test_class.type: VirtualMachineGenerator
test_class.var_name: virtualMachineGenerator
test_class.declarator: hypervisorGenerator
test_class.modifier: private
test_class.original_string: private HypervisorGenerator hypervisorGenerator;
test_class.type: HypervisorGenerator
test_class.var_name: hypervisorGenerator
test_class.declarator: machineGenerator
test_class.modifier: private
test_class.original_string: private MachineGenerator machineGenerator;
test_class.type: MachineGenerator
test_class.var_name: machineGenerator
test_class.declarator: datacenterGenerator
test_class.modifier: private
test_class.original_string: private DatacenterGenerator datacenterGenerator;
test_class.type: DatacenterGenerator
test_class.var_name: datacenterGenerator
test_class.declarator: userGenerator
test_class.modifier: private
test_class.original_string: private UserGenerator userGenerator;
test_class.type: UserGenerator
test_class.var_name: userGenerator
test_class.declarator: roleGenerator
test_class.modifier: private
test_class.original_string: private RoleGenerator roleGenerator;
test_class.type: RoleGenerator
test_class.var_name: roleGenerator
test_class.file: model/src/test/java/com/abiquo/server/core/appslibrary/VirtualImageConversionDAOTest.java
test_class.identifier: VirtualImageConversionDAOTest
test_class.superclass: extends
      DefaultDAOTestBase<VirtualImageConversionDAO, VirtualImageConversion>
test_case.body: @Test(enabled = false)
      public void getUnbundledConversionTest()
      {
          Datacenter datacenter = datacenterGenerator.createUniqueInstance();
          Machine machine = machineGenerator.createMachine(datacenter);
          Enterprise enterprise = enterpriseGenerator.createUniqueInstance();
          Role role = roleGenerator.createInstanceSysAdmin();
          User user = userGenerator.createInstance(enterprise, role);
          VirtualMachineTemplate image =
              virtualImageGenerator.createVirtualMachineTemplateWithConversions(enterprise);
          Hypervisor hypervisor = hypervisorGenerator.createInstance(machine);
          VirtualMachine virtualMachine =
              virtualMachineGenerator.createInstance(image, enterprise, hypervisor, user, "name");
          VirtualImageConversion imageConversion =
              eg().createInstance(image, DiskFormatType.VDI_SPARSE);
  
          List<Object> entitiesToSetup = new ArrayList<Object>();
          entitiesToSetup.add(datacenter);
          entitiesToSetup.add(enterprise);
          entitiesToSetup.add(role);
          entitiesToSetup.add(user);
          entitiesToSetup.add(machine);
          entitiesToSetup.add(hypervisor);
          entitiesToSetup.add(image);
          entitiesToSetup.add(virtualMachine);
  
          entitiesToSetup.add(imageConversion);
  
          ds().persistAll(entitiesToSetup.toArray());
          VirtualImageConversionDAO dao = createDaoForReadWriteTransaction();
          dao.getUnbundledConversion(image, virtualMachine.getHypervisor().getType().baseFormat);
          Assert.assertEquals(DiskFormatType.VDI_SPARSE, virtualMachine.getVirtualMachineTemplate()
              .getDiskFormatType());
      }
test_case.class_method_signature: VirtualImageConversionDAOTest.getUnbundledConversionTest()
test_case.full_signature: @Test(enabled = false) public void getUnbundledConversionTest()
test_case.identifier: getUnbundledConversionTest
test_case.invocations: createUniqueInstance createMachine createUniqueInstance createInstanceSysAdmin createInstance createVirtualMachineTemplateWithConversions createInstance createInstance createInstance eg add add add add add add add add add persistAll ds toArray createDaoForReadWriteTransaction getUnbundledConversion getType getHypervisor assertEquals getDiskFormatType getVirtualMachineTemplate
test_case.modifiers: @Test(enabled = false) public
test_case.parameters: ()
test_case.return: void
test_case.signature: void getUnbundledConversionTest()
focal_class.declarator: QUERY_IMAGE_CONVERTED = "SELECT count(vic) " + //
          "FROM com.abiquo.server.core.appslibrary.VirtualImageConversion vic " + //
          "WHERE vic.virtualImage.id = :idVirtualImage"
focal_class.modifier: private final
focal_class.original_string: private final String QUERY_IMAGE_CONVERTED = "SELECT count(vic) " + //
          "FROM com.abiquo.server.core.appslibrary.VirtualImageConversion vic " + //
          "WHERE vic.virtualImage.id = :idVirtualImage";
focal_class.type: String
focal_class.var_name: QUERY_IMAGE_CONVERTED
focal_class.declarator: VIRTUALIMAGECONVERSION_BY_NODEVIRTUALIMAGE = "SELECT "
          + "vic FROM com.abiquo.server.core.appslibrary.VirtualImageConversion vic, "
          + "com.abiquo.server.core.cloud.NodeVirtualImage nvi "
          + "WHERE nvi.id = :idVirtualImageConversion AND nvi.virtualImage.id = vic.virtualImage.id"
focal_class.modifier: private final
focal_class.original_string: private final String VIRTUALIMAGECONVERSION_BY_NODEVIRTUALIMAGE = "SELECT "
          + "vic FROM com.abiquo.server.core.appslibrary.VirtualImageConversion vic, "
          + "com.abiquo.server.core.cloud.NodeVirtualImage nvi "
          + "WHERE nvi.id = :idVirtualImageConversion AND nvi.virtualImage.id = vic.virtualImage.id";
focal_class.type: String
focal_class.var_name: VIRTUALIMAGECONVERSION_BY_NODEVIRTUALIMAGE
focal_class.declarator: DATACENTERUUID_BY_VIRTUALIMAGECONVERSION =
          "select distinct(dc.uuid) from virtualimage_conversions vic left outer join virtualimage vi on vic.idImage = vi.idImage left outer join repository rep on vi.idRepository = rep.idRepository left outer join datacenter dc on rep.idDataCenter = dc.idDatacenter where vic.id = :idVirtualImageConversion"
focal_class.modifier: private final
focal_class.original_string: private final String DATACENTERUUID_BY_VIRTUALIMAGECONVERSION =
          "select distinct(dc.uuid) from virtualimage_conversions vic left outer join virtualimage vi on vic.idImage = vi.idImage left outer join repository rep on vi.idRepository = rep.idRepository left outer join datacenter dc on rep.idDataCenter = dc.idDatacenter where vic.id = :idVirtualImageConversion";
focal_class.type: String
focal_class.var_name: DATACENTERUUID_BY_VIRTUALIMAGECONVERSION
focal_class.file: model/src/main/java/com/abiquo/server/core/appslibrary/VirtualImageConversionDAO.java
focal_class.identifier: VirtualImageConversionDAO
focal_class.class_method_signature: VirtualImageConversionDAO.VirtualImageConversionDAO()
focal_class.full_signature: public  VirtualImageConversionDAO()
focal_class.identifier: VirtualImageConversionDAO
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.signature:  VirtualImageConversionDAO()
focal_class.class_method_signature: VirtualImageConversionDAO.VirtualImageConversionDAO(final EntityManager entityManager)
focal_class.full_signature: public  VirtualImageConversionDAO(final EntityManager entityManager)
focal_class.identifier: VirtualImageConversionDAO
focal_class.modifiers: public
focal_class.parameters: (final EntityManager entityManager)
focal_class.signature:  VirtualImageConversionDAO(final EntityManager entityManager)
focal_class.class_method_signature: VirtualImageConversionDAO.sameImage(final VirtualMachineTemplate image)
focal_class.full_signature: private static Criterion sameImage(final VirtualMachineTemplate image)
focal_class.identifier: sameImage
focal_class.modifiers: private static
focal_class.parameters: (final VirtualMachineTemplate image)
focal_class.return: Criterion
focal_class.signature: Criterion sameImage(final VirtualMachineTemplate image)
focal_class.class_method_signature: VirtualImageConversionDAO.sameImage(final VirtualImageConversion conversion)
focal_class.full_signature: private static Criterion sameImage(final VirtualImageConversion conversion)
focal_class.identifier: sameImage
focal_class.modifiers: private static
focal_class.parameters: (final VirtualImageConversion conversion)
focal_class.return: Criterion
focal_class.signature: Criterion sameImage(final VirtualImageConversion conversion)
focal_class.class_method_signature: VirtualImageConversionDAO.sameSourceFormat(final VirtualImageConversion image)
focal_class.full_signature: private static Criterion sameSourceFormat(final VirtualImageConversion image)
focal_class.identifier: sameSourceFormat
focal_class.modifiers: private static
focal_class.parameters: (final VirtualImageConversion image)
focal_class.return: Criterion
focal_class.signature: Criterion sameSourceFormat(final VirtualImageConversion image)
focal_class.class_method_signature: VirtualImageConversionDAO.sameTargetFormat(final VirtualImageConversion image)
focal_class.full_signature: private static Criterion sameTargetFormat(final VirtualImageConversion image)
focal_class.identifier: sameTargetFormat
focal_class.modifiers: private static
focal_class.parameters: (final VirtualImageConversion image)
focal_class.return: Criterion
focal_class.signature: Criterion sameTargetFormat(final VirtualImageConversion image)
focal_class.class_method_signature: VirtualImageConversionDAO.targetFormatIn(final Collection<DiskFormatType> formats)
focal_class.full_signature: private static Criterion targetFormatIn(final Collection<DiskFormatType> formats)
focal_class.identifier: targetFormatIn
focal_class.modifiers: private static
focal_class.parameters: (final Collection<DiskFormatType> formats)
focal_class.return: Criterion
focal_class.signature: Criterion targetFormatIn(final Collection<DiskFormatType> formats)
focal_class.class_method_signature: VirtualImageConversionDAO.targetFormatIn(final DiskFormatType format)
focal_class.full_signature: private static Criterion targetFormatIn(final DiskFormatType format)
focal_class.identifier: targetFormatIn
focal_class.modifiers: private static
focal_class.parameters: (final DiskFormatType format)
focal_class.return: Criterion
focal_class.signature: Criterion targetFormatIn(final DiskFormatType format)
focal_class.class_method_signature: VirtualImageConversionDAO.sourceFormatNull()
focal_class.full_signature: private static Criterion sourceFormatNull()
focal_class.identifier: sourceFormatNull
focal_class.modifiers: private static
focal_class.parameters: ()
focal_class.return: Criterion
focal_class.signature: Criterion sourceFormatNull()
focal_class.class_method_signature: VirtualImageConversionDAO.compatilbeConversions(
          final VirtualMachineTemplate virtualImage, final HypervisorType hypervisorType)
focal_class.full_signature: @SuppressWarnings("unchecked") public List<VirtualImageConversion> compatilbeConversions(
          final VirtualMachineTemplate virtualImage, final HypervisorType hypervisorType)
focal_class.identifier: compatilbeConversions
focal_class.modifiers: @SuppressWarnings("unchecked") public
focal_class.parameters: (
          final VirtualMachineTemplate virtualImage, final HypervisorType hypervisorType)
focal_class.return: List<VirtualImageConversion>
focal_class.signature: List<VirtualImageConversion> compatilbeConversions(
          final VirtualMachineTemplate virtualImage, final HypervisorType hypervisorType)
focal_class.class_method_signature: VirtualImageConversionDAO.isVirtualImageConverted(final Integer vImageId, final DiskFormatType format)
focal_class.full_signature: public boolean isVirtualImageConverted(final Integer vImageId, final DiskFormatType format)
focal_class.identifier: isVirtualImageConverted
focal_class.modifiers: public
focal_class.parameters: (final Integer vImageId, final DiskFormatType format)
focal_class.return: boolean
focal_class.signature: boolean isVirtualImageConverted(final Integer vImageId, final DiskFormatType format)
focal_class.class_method_signature: VirtualImageConversionDAO.getUnbundledConversion(final VirtualMachineTemplate image,
          final DiskFormatType format)
focal_class.full_signature: @Deprecated // use selectConversion TODO delthis @SuppressWarnings("unchecked") public VirtualImageConversion getUnbundledConversion(final VirtualMachineTemplate image,
          final DiskFormatType format)
focal_class.identifier: getUnbundledConversion
focal_class.modifiers: @Deprecated // use selectConversion TODO delthis @SuppressWarnings("unchecked") public
focal_class.parameters: (final VirtualMachineTemplate image,
          final DiskFormatType format)
focal_class.return: VirtualImageConversion
focal_class.signature: VirtualImageConversion getUnbundledConversion(final VirtualMachineTemplate image,
          final DiskFormatType format)
focal_class.class_method_signature: VirtualImageConversionDAO.isConverted(final VirtualMachineTemplate image, final DiskFormatType targetType)
focal_class.full_signature: public boolean isConverted(final VirtualMachineTemplate image, final DiskFormatType targetType)
focal_class.identifier: isConverted
focal_class.modifiers: public
focal_class.parameters: (final VirtualMachineTemplate image, final DiskFormatType targetType)
focal_class.return: boolean
focal_class.signature: boolean isConverted(final VirtualMachineTemplate image, final DiskFormatType targetType)
focal_class.class_method_signature: VirtualImageConversionDAO.findByVirtualImage(
          final VirtualMachineTemplate virtualImage)
focal_class.full_signature: public Collection<VirtualImageConversion> findByVirtualImage(
          final VirtualMachineTemplate virtualImage)
focal_class.identifier: findByVirtualImage
focal_class.modifiers: public
focal_class.parameters: (
          final VirtualMachineTemplate virtualImage)
focal_class.return: Collection<VirtualImageConversion>
focal_class.signature: Collection<VirtualImageConversion> findByVirtualImage(
          final VirtualMachineTemplate virtualImage)
focal_class.class_method_signature: VirtualImageConversionDAO.findByVirtualImageConversionByNodeVirtualImage(
          final NodeVirtualImage nodeVirtualImage)
focal_class.full_signature: public Collection<VirtualImageConversion> findByVirtualImageConversionByNodeVirtualImage(
          final NodeVirtualImage nodeVirtualImage)
focal_class.identifier: findByVirtualImageConversionByNodeVirtualImage
focal_class.modifiers: public
focal_class.parameters: (
          final NodeVirtualImage nodeVirtualImage)
focal_class.return: Collection<VirtualImageConversion>
focal_class.signature: Collection<VirtualImageConversion> findByVirtualImageConversionByNodeVirtualImage(
          final NodeVirtualImage nodeVirtualImage)
focal_class.class_method_signature: VirtualImageConversionDAO.getDatacenterUUIDByVirtualImageConversionID(final Integer idVirtualImageConversion)
focal_class.full_signature: public String getDatacenterUUIDByVirtualImageConversionID(final Integer idVirtualImageConversion)
focal_class.identifier: getDatacenterUUIDByVirtualImageConversionID
focal_class.modifiers: public
focal_class.parameters: (final Integer idVirtualImageConversion)
focal_class.return: String
focal_class.signature: String getDatacenterUUIDByVirtualImageConversionID(final Integer idVirtualImageConversion)
focal_class.class_method_signature: VirtualImageConversionDAO.existDuplicatedConversion(final VirtualImageConversion conversion)
focal_class.full_signature: public boolean existDuplicatedConversion(final VirtualImageConversion conversion)
focal_class.identifier: existDuplicatedConversion
focal_class.modifiers: public
focal_class.parameters: (final VirtualImageConversion conversion)
focal_class.return: boolean
focal_class.signature: boolean existDuplicatedConversion(final VirtualImageConversion conversion)
focal_class.superclass: extends DefaultDAOBase<Integer, VirtualImageConversion>
focal_method.body: @Deprecated
      // use selectConversion TODO delthis
      @SuppressWarnings("unchecked")
      public VirtualImageConversion getUnbundledConversion(final VirtualMachineTemplate image,
          final DiskFormatType format)
      {
          // There can be no images
          List<VirtualImageConversion> conversions =
              createCriteria(sameImage(image)).add(targetFormatIn(format)).add(sourceFormatNull())
                  .list();
          // Are there any?
          if (conversions != null && !conversions.isEmpty())
          {
              // This function should be returning the only object
              if (conversions.size() > 1)
              {
                  throw new NonUniqueObjectException("There is more than one conversion!",
                      image.getId(),
                      VirtualImageConversion.class.getSimpleName());
              }
              return conversions.get(0);
          }
          return null;
      }
focal_method.class_method_signature: VirtualImageConversionDAO.getUnbundledConversion(final VirtualMachineTemplate image,
          final DiskFormatType format)
focal_method.full_signature: @Deprecated // use selectConversion TODO delthis @SuppressWarnings("unchecked") public VirtualImageConversion getUnbundledConversion(final VirtualMachineTemplate image,
          final DiskFormatType format)
focal_method.identifier: getUnbundledConversion
focal_method.invocations: list add add createCriteria sameImage targetFormatIn sourceFormatNull isEmpty size getId getSimpleName get
focal_method.modifiers: @Deprecated // use selectConversion TODO delthis @SuppressWarnings("unchecked") public
focal_method.parameters: (final VirtualMachineTemplate image,
          final DiskFormatType format)
focal_method.return: VirtualImageConversion
focal_method.signature: VirtualImageConversion getUnbundledConversion(final VirtualMachineTemplate image,
          final DiskFormatType format)