auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void updateOldImageAsActive ( org.ovirt.engine.core.common.businessentities.Snapshot.SnapshotType snapshotType , boolean active ) { org.ovirt.engine.core.compat.Guid oldImageId = findImageForSameDrive ( snapshotType ) ; if ( oldImageId == null ) { log.error ( "Can't find image to update to active '{}', snapshot type '{}', original image id '{}'" , active , snapshotType , getImageId ( ) ) ; return ; } org.ovirt.engine.core.common.businessentities.storage.DiskImage oldImage = org.ovirt.engine.core.bll.BaseImagesCommand.getDiskImageDao ( ) . getSnapshotById ( oldImageId ) ; oldImage.setActive ( active ) ; getImageDao ( ) . update ( oldImage.getImage ( ) ) ; }

Target:
protected void updateOldImageAsActive ( org.ovirt.engine.core.common.businessentities.Snapshot.SnapshotType snapshotType , boolean active ) { org.ovirt.engine.core.compat.Guid oldImageId = findImageForSameDrive ( snapshotType ) ; if ( oldImageId == null ) { log.error ( "Can't find image to update to active '{}', snapshot type '{}', original image id '{}'" , active , snapshotType , getImageId ( ) ) ; return ; } org.ovirt.engine.core.common.businessentities.storage.DiskImage oldImage = org.ovirt.engine.core.bll.BaseImagesCommand.getDiskImageDao ( ) . getSnapshotById ( oldImageId ) ; oldImage.setActive ( active ) ; org.ovirt.engine.core.bll.BaseImagesCommand.getImageDao ( ) . update ( oldImage.getImage ( ) ) ; }
Source:
protected org.ovirt.engine.api.model.Permission map ( org.ovirt.engine.core.common.businessentities.Permissions entity , org.ovirt.engine.api.restapi.resource.Permission template ) { java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.aaa.DbUser > users = parent.getUsers ( ) ; return parent.map ( entity , ( users.containsKey ( entity.getAdElementId ( ) ) ? users.get ( entity.getAdElementId ( ) ) : null ) ) ; }

Target:
protected org.ovirt.engine.api.model.Permission map ( org.ovirt.engine.api.model.Permission entity , org.ovirt.engine.api.model.Permission template ) { java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.aaa.DbUser > users = parent.getUsers ( ) ; return parent.map ( entity , ( users.containsKey ( entity.getAdElementId ( ) ) ? users.get ( entity.getAdElementId ( ) ) : null ) ) ; }
Source:
public void writeData ( java.io.ObjectOutputStream dos ) { try { writeString ( this . var_name , dos ) ; writeString ( this . var_value , dos ) ; writeDate ( this . var_datetime , dos ) ; } catch ( java.io.IOException e ) { throw new java.lang.RuntimeException ( e ) ; } }

Target:
public void writeData ( java.io.ObjectOutputStream dos ) { try { writeString ( this . var_name , dos ) ; writeDate ( this . var_datetime , dos ) ; } catch ( java.io.IOException e ) { throw new java.lang.RuntimeException ( e ) ; } }
Source:
public void setUp ( ) throws java.lang.Exception { host = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; host.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; final org.ovirt.engine.core.common.businessentities.VdsDynamic vdsDynamic = new org.ovirt.engine.core.common.businessentities.VdsDynamic ( ) ; host.setDynamicData ( vdsDynamic ) ; bond = new org.ovirt.engine.core.common.businessentities.network.Bond ( ) ; bond.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.mockito.Mockito.when ( mockNetworkExclusivenessValidatorResolver.resolveNetworkExclusivenessValidator ( ) ) . thenReturn ( mockNetworkExclusivenessValidator ) ; org.mockito.Mockito.when ( mockNetworkAttachmentIpConfigurationValidator.validateNetworkAttachmentIpConfiguration ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( ValidationResult.VALID ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { host = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; host.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; final org.ovirt.engine.core.common.businessentities.VdsDynamic vdsDynamic = new org.ovirt.engine.core.common.businessentities.VdsDynamic ( ) ; host.setDynamicData ( vdsDynamic ) ; bond = new org.ovirt.engine.core.common.businessentities.network.Bond ( ) ; bond.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.mockito.Mockito.when ( mockNetworkExclusivenessValidatorResolver.resolveNetworkExclusivenessValidator ( ) ) . thenReturn ( mockNetworkExclusivenessValidator ) ; }
Source:
public void setType ( org.ovirt.engine.ui.common.widget.panel.AlertPanel.Type type ) { this . type = type ; getWidget ( ) . setType ( type.alertType ) ; for ( org.ovirt.engine.ui.common.widget.panel.AlertPanel.Type t : type.getDeclaringClass ( ) . getEnumConstants ( ) ) { getWidget ( ) . removeStyleName ( t.iconStyleName ) ; } icon.addStyleName ( type.iconStyleName ) ; }

Target:
public void setType ( org.ovirt.engine.ui.common.widget.panel.AlertPanel.Type type ) { this . type = type ; getWidget ( ) . setType ( type.alertType ) ; for ( org.ovirt.engine.ui.common.widget.panel.AlertPanel.Type t : type.getDeclaringClass ( ) . getEnumConstants ( ) ) { icon.removeStyleName ( t.iconStyleName ) ; } icon.addStyleName ( type.iconStyleName ) ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( target ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_pool > list = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_pool > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage_pool a : ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_pool > ) ( returnValue ) ) ) { if ( ( a.getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StoragePoolStatus.Up ) ) { list.add ( a ) ; } } model.SetDataCenter ( model , list ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( target ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > list = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ( ) ; for ( org.ovirt.engine.core.common.businessentities.StoragePool a : ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ) ( returnValue ) ) ) { if ( ( a.getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StoragePoolStatus.Up ) ) { list.add ( a ) ; } } model.SetDataCenter ( model , list ) ; }
Source:
public org.ovirt.engine.api.model.Hooks list ( ) { @ java.lang.SuppressWarnings ( value = "unchecked" ) java.util.HashMap < java.lang.String , java.util.HashMap < java.lang.String , java.util.HashMap < java.lang.String , java.lang.String > > > hooksMap = getEntity ( java.util.HashMap.class , QueryType.GetVdsHooksById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( asGuid ( hostId ) ) , null ) ; return mapCollection ( hooksMap ) ; }

Target:
public org.ovirt.engine.api.model.Hooks list ( ) { @ java.lang.SuppressWarnings ( value = "unchecked" ) java.util.Map < java.lang.String , java.util.Map < java.lang.String , java.util.Map < java.lang.String , java.lang.String > > > hooksMap = getEntity ( java.util.Map.class , QueryType.GetVdsHooksById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( asGuid ( hostId ) ) , null ) ; return mapCollection ( hooksMap ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface createBondSlave ( org.ovirt.engine.core.common.businessentities.network.Bond bond , java.lang.String slaveName ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface slave = new org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface ( ) ; slave.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; slave.setName ( slaveName ) ; slave.setBondName ( bond.getName ( ) ) ; slave.setBonded ( true ) ; return slave ; }

Target:
private org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface createBondSlave ( org.ovirt.engine.core.common.businessentities.network.Bond bond , java.lang.String slaveName ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface slave = new org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface ( ) ; slave.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; slave.setName ( slaveName ) ; slave.setBondName ( bond.getName ( ) ) ; slave.setBonded ( false ) ; return slave ; }
Source:
public static void addLdapConfigValues ( java.util.Hashtable < java.lang.String , java.lang.String > env ) { env.put ( "com.sun.jndi.ldap.read.timeout" , java.lang.Long.toString ( ( ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.LDAPQueryTimeout ) ) * 1000 ) ) ) ; env.put ( "com.sun.jndi.ldap.connect.timeout" , java.lang.Long.toString ( ( ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.LDAPConnectTimeout ) ) * 1000 ) ) ) ; }

Target:
public static void addLdapConfigValues ( java.util.Hashtable < java.lang.String , java.lang.String > env ) { env.put ( "com.sun.jndi.ldap.read.timeout" , java.lang.Long.toString ( ( ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.LDAPQueryTimeout ) ) * 1000 ) ) ) ; env.put ( "com.sun.jndi.ldap.connect.timeout" , java.lang.Long.toString ( ( ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.LDAPConnectTimeout ) ) * 1000 ) ) ) ; }
Source:
public double nextDouble ( double d , boolean inclusive ) { if ( d <= 0.0 ) { throw new java.lang.IllegalArgumentException ( "d must be greater than 0!" ) ; } double rand = super . nextDouble ( ) ; if ( ! inclusive ) { while ( rand == 1.0 ) { rand = super . nextDouble ( ) ; } } return rand * d ; }

Target:
public double nextDouble ( double d , boolean inclusive ) { if ( d <= 0.0 ) { throw new java.lang.IllegalArgumentException ( "d must be greater than 0!" ) ; } double rand = nextDouble ( ) ; if ( ! inclusive ) { while ( rand == 1.0 ) { rand = nextDouble ( ) ; } } return rand * d ; }
Source:
public static boolean isMemorySizeLegal ( org.ovirt.engine.core.common.businessentities.VmOsType osType , int memSizeInMB , java.util.ArrayList < java.lang.String > reasons , java.lang.String clsuter_version ) { boolean result = org.ovirt.engine.core.common.utils.VmValidationUtils.isMemorySizeLegal ( osType , memSizeInMB , clsuter_version ) ; if ( ! result ) { reasons.add ( VdcBllMessages.ACTION_TYPE_FAILED_ILLEGAL_MEMORY_SIZE.toString ( ) ) ; reasons.add ( java.lang.String.format ( "$minMemorySize %s" , org.ovirt.engine.core.common.utils.VmValidationUtils.getMinMemorySizeInMb ( ) ) ) ; reasons.add ( java.lang.String.format ( "$maxMemorySize %s" , org.ovirt.engine.core.common.utils.VmValidationUtils.getMaxMemorySizeInMb ( osType , clsuter_version ) ) ) ; } return result ; }

Target:
public static boolean isMemorySizeLegal ( org.ovirt.engine.core.common.businessentities.VmOsType osType , int memSizeInMB , java.util.List < java.lang.String > reasons , java.lang.String clsuter_version ) { boolean result = org.ovirt.engine.core.common.utils.VmValidationUtils.isMemorySizeLegal ( osType , memSizeInMB , clsuter_version ) ; if ( ! result ) { reasons.add ( VdcBllMessages.ACTION_TYPE_FAILED_ILLEGAL_MEMORY_SIZE.toString ( ) ) ; reasons.add ( java.lang.String.format ( "$minMemorySize %s" , org.ovirt.engine.core.common.utils.VmValidationUtils.getMinMemorySizeInMb ( ) ) ) ; reasons.add ( java.lang.String.format ( "$maxMemorySize %s" , org.ovirt.engine.core.common.utils.VmValidationUtils.getMaxMemorySizeInMb ( osType , clsuter_version ) ) ) ; } return result ; }
Source:
public static java.lang.String getRequestParameter ( javax.servlet.http.HttpServletRequest request , java.lang.String paramName ) throws java.lang.Exception { java.lang.String value = org.ovirt.engine.core.sso.utils.SSOUtils.getParameter ( request , paramName ) ; if ( value == null ) { throw new org.ovirt.engine.core.sso.utils.OAuthException ( SSOConstants.ERR_CODE_INVALID_REQUEST , java.lang.String.format ( SSOConstants.ERR_CODE_INVALID_REQUEST_MSG , paramName ) ) ; } return java.net.URLDecoder.decode ( value , java.nio.charset.StandardCharsets.UTF_8.name ( ) ) ; }

Target:
public static java.lang.String getRequestParameter ( javax.servlet.http.HttpServletRequest request , java.lang.String paramName ) throws java.lang.Exception { java.lang.String value = org.ovirt.engine.core.sso.utils.SSOUtils.getParameter ( request , paramName ) ; if ( value == null ) { throw new org.ovirt.engine.core.sso.utils.OAuthException ( SSOConstants.ERR_CODE_INVALID_REQUEST , java.lang.String.format ( SSOConstants.ERR_CODE_INVALID_REQUEST_MSG , paramName ) ) ; } return value ; }
Source:
static org.ovirt.engine.core.common.businessentities.VDSGroup setUpEntityExpectations ( org.ovirt.engine.core.common.businessentities.VDSGroup entity , int index ) { org.easymock.EasyMock.expect ( entity.getId ( ) ) . andReturn ( GUIDS [ index ] ) . anyTimes ( ) ; org.easymock.EasyMock.expect ( entity.getname ( ) ) . andReturn ( NAMES [ index ] ) . anyTimes ( ) ; org.easymock.EasyMock.expect ( entity.getdescription ( ) ) . andReturn ( DESCRIPTIONS [ index ] ) . anyTimes ( ) ; return entity ; }

Target:
static org.ovirt.engine.core.common.businessentities.VDSGroup setUpEntityExpectations ( org.ovirt.engine.core.common.businessentities.VDSGroup entity , int index ) { org.easymock.EasyMock.expect ( entity.getId ( ) ) . andReturn ( GUIDS [ index ] ) . anyTimes ( ) ; org.easymock.EasyMock.expect ( entity.getName ( ) ) . andReturn ( NAMES [ index ] ) . anyTimes ( ) ; org.easymock.EasyMock.expect ( entity.getdescription ( ) ) . andReturn ( DESCRIPTIONS [ index ] ) . anyTimes ( ) ; return entity ; }
Source:
protected boolean canDoAction ( ) { org.ovirt.engine.core.bll.validator.UpgradeHostValidator validator = new org.ovirt.engine.core.bll.validator.UpgradeHostValidator ( org.ovirt.engine.core.bll.hostdeploy.UpgradeHostCommand.getDbFacade ( ) , org.ovirt.engine.core.bll.hostdeploy.UpgradeHostCommand.getVds ( ) ) ; return ( ( ( validate ( validator.hostExists ( ) ) ) && ( validate ( validator.statusSupportedForHostUpgrade ( ) ) ) ) && ( validate ( validator.updatesAvailable ( ) ) ) ) && ( validate ( validator.imageProvidedForOvirtNode ( org.ovirt.engine.core.bll.hostdeploy.UpgradeHostCommand.getParameters ( ) . getoVirtIsoFile ( ) ) ) ) ; }

Target:
protected boolean canDoAction ( ) { org.ovirt.engine.core.bll.validator.UpgradeHostValidator validator = new org.ovirt.engine.core.bll.validator.UpgradeHostValidator ( org.ovirt.engine.core.bll.hostdeploy.UpgradeHostCommand.getVds ( ) ) ; return ( ( ( validate ( validator.hostExists ( ) ) ) && ( validate ( validator.statusSupportedForHostUpgrade ( ) ) ) ) && ( validate ( validator.updatesAvailable ( ) ) ) ) && ( validate ( validator.imageProvidedForOvirtNode ( org.ovirt.engine.core.bll.hostdeploy.UpgradeHostCommand.getParameters ( ) . getoVirtIsoFile ( ) ) ) ) ; }
Source:
public void testAddIncompleteParameters ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Disk model = new org.ovirt.engine.api.model.Disk ( ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; control.replay ( ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Disk" , "testAddIncompleteParameters" , "provisionedSize|size" , "format" ) ; } }

Target:
public void testAddIncompleteParameters ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Disk model = new org.ovirt.engine.api.model.Disk ( ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Disk" , "testAddIncompleteParameters" , "provisionedSize|size" , "format" ) ; } }
Source:
public static void getPoolById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid poolId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmPoolById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( poolId ) , aQuery ) ; }

Target:
public void getPoolById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid poolId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmPoolById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( poolId ) , aQuery ) ; }
Source:
private org.ovirt.engine.core.common.AuditLogType getEndSuccessAuditLogTypeValue ( boolean successful ) { boolean isVmNameExist = org.apache.commons.lang.StringUtils.isNotEmpty ( org.ovirt.engine.core.bll.AddDiskCommand.getVmName ( ) ) ; if ( successful ) { if ( isVmNameExist ) { return org.ovirt.engine.core.common.AuditLogType.USER_ADD_DISK_TO_VM_FINISHED_SUCCESS ; } else { return org.ovirt.engine.core.common.AuditLogType.USER_ADD_DISK_FINISHED_SUCCESS ; } } else { if ( isVmNameExist ) { return org.ovirt.engine.core.common.AuditLogType.USER_ADD_DISK_TO_VM_FINISHED_FAILURE ; } else { return org.ovirt.engine.core.common.AuditLogType.USER_ADD_DISK_FINISHED_FAILURE ; } } }

Target:
protected org.ovirt.engine.core.common.AuditLogType getEndSuccessAuditLogTypeValue ( boolean successful ) { boolean isVmNameExist = org.apache.commons.lang.StringUtils.isNotEmpty ( org.ovirt.engine.core.bll.AddDiskCommand.getVmName ( ) ) ; if ( successful ) { if ( isVmNameExist ) { return org.ovirt.engine.core.common.AuditLogType.USER_ADD_DISK_TO_VM_FINISHED_SUCCESS ; } else { return org.ovirt.engine.core.common.AuditLogType.USER_ADD_DISK_FINISHED_SUCCESS ; } } else { if ( isVmNameExist ) { return org.ovirt.engine.core.common.AuditLogType.USER_ADD_DISK_TO_VM_FINISHED_FAILURE ; } else { return org.ovirt.engine.core.common.AuditLogType.USER_ADD_DISK_FINISHED_FAILURE ; } } }
Source:
public static void addDiskImage ( org.ovirt.engine.core.common.businessentities.DiskImage image , boolean active , org.ovirt.engine.core.common.businessentities.image_storage_domain_map imageStorageDomainMap ) { try { org.ovirt.engine.core.bll.ImagesHandler.addImage ( image , active , imageStorageDomainMap ) ; org.ovirt.engine.core.bll.ImagesHandler.addDiskToVmIfNotExists ( image , image.getvm_guid ( ) ) ; } catch ( java.lang.RuntimeException ex ) { org.ovirt.engine.core.bll.ImagesHandler.log.error ( "Failed adding new disk image and related entities to db" , ex ) ; throw new org.ovirt.engine.core.common.errors.VdcBLLException ( org.ovirt.engine.core.common.errors.VdcBllErrors.DB , ex ) ; } }

Target:
public static void addDiskImage ( org.ovirt.engine.core.common.businessentities.DiskImage image , boolean active , org.ovirt.engine.core.common.businessentities.image_storage_domain_map imageStorageDomainMap , org.ovirt.engine.core.compat.Guid vmId ) { try { org.ovirt.engine.core.bll.ImagesHandler.addImage ( image , active , imageStorageDomainMap ) ; org.ovirt.engine.core.bll.ImagesHandler.addDiskToVmIfNotExists ( image , vmId ) ; } catch ( java.lang.RuntimeException ex ) { org.ovirt.engine.core.bll.ImagesHandler.log.error ( "Failed adding new disk image and related entities to db" , ex ) ; throw new org.ovirt.engine.core.common.errors.VdcBLLException ( org.ovirt.engine.core.common.errors.VdcBllErrors.DB , ex ) ; } }
Source:
public boolean deleteVolume ( final org.ovirt.engine.core.common.businessentities.storage.CinderDisk cinderDisk ) { return execute ( new java.util.concurrent.Callable < java.lang.Boolean > ( ) { @ java.lang.Override public java.lang.Boolean call ( ) { try { proxy.deleteVolume ( cinderDisk.getImageId ( ) . toString ( ) ) ; return true ; } catch ( com.woorea.openstack.base.client.OpenStackResponseException ex ) { if ( ( ex.getStatus ( ) ) == ( org.apache.commons.httpclient.HttpStatus.SC_NOT_FOUND ) ) { return false ; } throw ex ; } } } ) ; }

Target:
public boolean deleteVolume ( final org.ovirt.engine.core.common.businessentities.storage.CinderDisk cinderDisk ) { return execute ( ( ) -> { try { proxy.deleteVolume ( cinderDisk.getImageId ( ) . toString ( ) ) ; return true ; } catch ( com.woorea.openstack.base.client.OpenStackResponseException ex ) { if ( ( ex.getStatus ( ) ) == ( org.apache.commons.httpclient.HttpStatus.SC_NOT_FOUND ) ) { return false ; } throw ex ; } } ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = prepareDAO ( dbFacade.getStorageDomainStaticDao ( ) ) ; dynamicDao = prepareDAO ( dbFacade.getStorageDomainDynamicDao ( ) ) ; diskImageDao = prepareDAO ( dbFacade.getDiskImageDao ( ) ) ; imageDao = prepareDAO ( dbFacade.getImageDao ( ) ) ; existingDomain = dao.get ( new org.ovirt.engine.core.compat.Guid ( "72e3a666-89e1-4005-a7ca-f7548004a9ab" ) ) ; newStaticDomain = new org.ovirt.engine.core.common.businessentities.StorageDomainStatic ( ) ; newStaticDomain.setstorage_name ( "NewStorageDomain" ) ; newStaticDomain.setstorage ( "fDMzhE-wx3s-zo3q-Qcxd-T0li-yoYU-QvVePl" ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getStorageDomainStaticDao ( ) ; dynamicDao = dbFacade.getStorageDomainDynamicDao ( ) ; diskImageDao = dbFacade.getDiskImageDao ( ) ; imageDao = dbFacade.getImageDao ( ) ; existingDomain = dao.get ( new org.ovirt.engine.core.compat.Guid ( "72e3a666-89e1-4005-a7ca-f7548004a9ab" ) ) ; newStaticDomain = new org.ovirt.engine.core.common.businessentities.StorageDomainStatic ( ) ; newStaticDomain.setstorage_name ( "NewStorageDomain" ) ; newStaticDomain.setstorage ( "fDMzhE-wx3s-zo3q-Qcxd-T0li-yoYU-QvVePl" ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.Snapshot addActiveSnapshot ( org.ovirt.engine.core.compat.Guid snapshotId ) { org.ovirt.engine.core.common.businessentities.Snapshot activeSnapshot = getActiveSnapshot ( ) ; java.lang.String memoryVolume = ( ( activeSnapshot != null ) && ( ! ( org.ovirt.engine.core.bll.ImportVmCommand.getParameters ( ) . isImportAsNewEntity ( ) ) ) ) ? activeSnapshot.getMemoryVolume ( ) : org.apache.commons.lang.StringUtils.EMPTY ; return snapshotsManager.addActiveSnapshot ( snapshotId , getVm ( ) , memoryVolume , org.ovirt.engine.core.bll.ImportVmCommand.getCompensationContext ( ) ) ; }

Target:
protected org.ovirt.engine.core.common.businessentities.Snapshot addActiveSnapshot ( org.ovirt.engine.core.compat.Guid snapshotId ) { org.ovirt.engine.core.common.businessentities.Snapshot activeSnapshot = getActiveSnapshot ( ) ; java.lang.String memoryVolume = ( ( activeSnapshot != null ) && ( ! ( org.ovirt.engine.core.bll.ImportVmCommand.getParameters ( ) . isImportAsNewEntity ( ) ) ) ) ? activeSnapshot.getMemoryVolume ( ) : org.apache.commons.lang.StringUtils.EMPTY ; return snapshotsManager.addActiveSnapshot ( snapshotId , org.ovirt.engine.core.bll.ImportVmCommand.getVm ( ) , memoryVolume , org.ovirt.engine.core.bll.ImportVmCommand.getCompensationContext ( ) ) ; }
Source:
public void testVmsWithNoIsoAttached ( ) { mockDomain ( ) ; org.mockito.Mockito.doReturn ( domain ) . when ( cmd ) . getStorageDomain ( ) ; org.mockito.Mockito.doReturn ( vmStaticDao ) . when ( cmd ) . getVmStaticDao ( ) ; org.mockito.Mockito.when ( vmStaticDao.getAllByStoragePoolId ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( java.util.Collections.emptyList ( ) ) ; org.junit.Assert.assertTrue ( cmd.isRunningVmsWithIsoAttached ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getValidationMessages ( ) . isEmpty ( ) ) ; }

Target:
public void testVmsWithNoIsoAttached ( ) { mockDomain ( ) ; org.mockito.Mockito.doReturn ( domain ) . when ( cmd ) . getStorageDomain ( ) ; org.mockito.Mockito.when ( vmStaticDao.getAllByStoragePoolId ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( java.util.Collections.emptyList ( ) ) ; org.junit.Assert.assertTrue ( cmd.isRunningVmsWithIsoAttached ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getValidationMessages ( ) . isEmpty ( ) ) ; }
Source:
private void prepareMocks ( org.ovirt.engine.core.bll.gluster.ManageGlusterServiceCommand command ) { org.mockito.Mockito.doReturn ( serverServiceDao ) . when ( command ) . getGlusterServerServiceDao ( ) ; org.mockito.Mockito.doReturn ( serviceDao ) . when ( command ) . getGlusterServiceDao ( ) ; org.mockito.Mockito.doReturn ( glusterUtils ) . when ( command ) . getGlusterUtils ( ) ; org.mockito.Mockito.doReturn ( getUpServers ( ) ) . when ( glusterUtils ) . getAllUpServers ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; }

Target:
private void prepareMocks ( org.ovirt.engine.core.bll.gluster.ManageGlusterServiceCommand command ) { org.mockito.Mockito.doReturn ( serviceDao ) . when ( command ) . getGlusterServiceDao ( ) ; org.mockito.Mockito.doReturn ( glusterUtils ) . when ( command ) . getGlusterUtils ( ) ; org.mockito.Mockito.doReturn ( getUpServers ( ) ) . when ( glusterUtils ) . getAllUpServers ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; }
Source:
public void testExecuteCommandByClusterIdForStart ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.ManageGlusterServiceCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterServiceParameters ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , null , org.ovirt.engine.core.common.businessentities.gluster.ServiceType.GLUSTER_SWIFT , org.ovirt.engine.core.common.constants.gluster.GlusterConstants.MANAGE_GLUSTER_SERVICE_ACTION_TYPE_START ) ) ) ; setUpMockUpForStart ( ) ; mockBackend ( true , null , GlusterServiceStatus.STOPPED ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( serverServiceDao , org.mockito.Mockito.times ( 4 ) ) . updateByServerIdAndServiceType ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService.class ) ) ; org.junit.Assert.assertEquals ( cmd.getAuditLogTypeValue ( ) , AuditLogType.GLUSTER_SERVICE_STARTED ) ; }

Target:
public void testExecuteCommandByClusterIdForStart ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.ManageGlusterServiceCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterServiceParameters ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , null , org.ovirt.engine.core.common.businessentities.gluster.ServiceType.GLUSTER_SWIFT , org.ovirt.engine.core.common.constants.gluster.GlusterConstants.MANAGE_GLUSTER_SERVICE_ACTION_TYPE_START ) , null ) ) ; setUpMockUpForStart ( ) ; mockBackend ( true , null , GlusterServiceStatus.STOPPED ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( serverServiceDao , org.mockito.Mockito.times ( 4 ) ) . updateByServerIdAndServiceType ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService.class ) ) ; org.junit.Assert.assertEquals ( cmd.getAuditLogTypeValue ( ) , AuditLogType.GLUSTER_SERVICE_STARTED ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = prepareDAO ( dbFacade.getStorageDomainDAO ( ) ) ; existingDomain = dao.get ( new org.ovirt.engine.core.compat.Guid ( org.ovirt.engine.core.dao.StorageDomainDAOTest.EXISTING_DOMAIN_ID ) ) ; newStaticDomain = new org.ovirt.engine.core.common.businessentities.storage_domain_static ( ) ; newStaticDomain.setstorage ( "fDMzhE-wx3s-zo3q-Qcxd-T0li-yoYU-QvVePl" ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = prepareDAO ( dbFacade.getStorageDomainDAO ( ) ) ; existingDomain = dao.get ( org.ovirt.engine.core.dao.StorageDomainDAOTest.EXISTING_DOMAIN_ID ) ; newStaticDomain = new org.ovirt.engine.core.common.businessentities.storage_domain_static ( ) ; newStaticDomain.setstorage ( "fDMzhE-wx3s-zo3q-Qcxd-T0li-yoYU-QvVePl" ) ; }
Source:
public java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > getPermissionCheckSubjects ( ) { return java.util.Collections.singletonList ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( ( ( getStoragePoolId ( ) ) == null ? null : getStoragePoolId ( ) . getValue ( ) ) , org.ovirt.engine.core.common.VdcObjectType.StoragePool , getActionType ( ) . getActionGroup ( ) ) ) ; }

Target:
public java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > getPermissionCheckSubjects ( ) { return java.util.Collections.singletonList ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( getStoragePoolId ( ) , org.ovirt.engine.core.common.VdcObjectType.StoragePool , getActionType ( ) . getActionGroup ( ) ) ) ; }
Source:
public static void getVmConfigurationBySnapshot ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid snapshotSourceId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( org.ovirt.engine.core.common.businessentities.VM ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmConfigurationBySnapshot , new org.ovirt.engine.core.common.queries.IdQueryParameters ( snapshotSourceId ) , aQuery ) ; }

Target:
public static void getVmConfigurationBySnapshot ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid snapshotSourceId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( org.ovirt.engine.core.common.businessentities.VM ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmConfigurationBySnapshot , new org.ovirt.engine.core.common.queries.IdQueryParameters ( snapshotSourceId ) , aQuery ) ; }
Source:
public static void getTemplateById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmTemplate , new org.ovirt.engine.core.common.queries.GetVmTemplateParameters ( templateId ) , aQuery ) ; }

Target:
public static void getTemplateById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmTemplate , new org.ovirt.engine.core.common.queries.GetVmTemplateParameters ( templateId ) , aQuery ) ; }
Source:
public void canDoActionFailedWrongPlugStatus ( ) throws java.lang.Exception { initializeCommand ( ) ; mockVmStatusUp ( ) ; cretaeDiskWrongPlug ( false ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.HOT_UNPLUG_DISK_IS_NOT_PLUGGED.toString ( ) ) ) ; }

Target:
public void canDoActionFailedWrongPlugStatus ( ) throws java.lang.Exception { mockVmStatusUp ( ) ; cretaeDiskWrongPlug ( false ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.HOT_UNPLUG_DISK_IS_NOT_PLUGGED.toString ( ) ) ) ; }
Source:
private static org.ovirt.engine.core.extensions.mgr.ExtensionProxy getExtensionByProfile ( org.ovirt.engine.api.extensions.ExtMap context , java.lang.String name ) { org.ovirt.engine.core.extensions.mgr.ExtensionProxy ret = org.ovirt.engine.exttool.aaa.AAAServiceImpl.getExtensionByConfigKey ( context , Authn.ConfigKeys.PROFILE_NAME , name ) ; if ( ret == null ) { throw new java.lang.IllegalArgumentException ( java.lang.String.format ( "Profile '%1$s' not found" , name ) ) ; } return ret ; }

Target:
private org.ovirt.engine.core.extensions.mgr.ExtensionProxy getExtensionByProfile ( java.lang.String name ) { org.ovirt.engine.core.extensions.mgr.ExtensionProxy ret = getExtensionByConfigKey ( Authn.ConfigKeys.PROFILE_NAME , name ) ; if ( ret == null ) { throw new java.lang.IllegalArgumentException ( java.lang.String.format ( "Profile '%1$s' not found" , name ) ) ; } return ret ; }
Source:
public void testGetIncludeStatistics ( ) throws java.lang.Exception { try { accepts.add ( "application/xml; detail=statistics" ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; setGetVdsQueryExpectations ( 1 ) ; setGetNetworksQueryExpectations ( 1 ) ; setUpEntityQueryExpectations ( ) ; control.replay ( ) ; org.ovirt.engine.api.model.HostNic nic = resource.get ( ) ; assertTrue ( nic.isSetStatistics ( ) ) ; hostNicsResource.verifyModelSpecific ( nic , org.ovirt.engine.api.restapi.resource.BackendHostNicResourceTest.NIC_IDX ) ; } finally { accepts.clear ( ) ; } }

Target:
public void testGetIncludeStatistics ( ) throws java.lang.Exception { try { accepts.add ( "application/xml; detail=statistics" ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; setGetVdsQueryExpectations ( 1 ) ; setGetNetworksQueryExpectations ( 1 ) ; setUpEntityQueryExpectations ( ) ; org.ovirt.engine.api.model.HostNic nic = resource.get ( ) ; assertTrue ( nic.isSetStatistics ( ) ) ; hostNicsResource.verifyModelSpecific ( nic , org.ovirt.engine.api.restapi.resource.BackendHostNicResourceTest.NIC_IDX ) ; } finally { accepts.clear ( ) ; } }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.Quota > quotas = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.Quota > ) ( returnValue ) ) ; quotas = ( quotas != null ) ? quotas : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Quota > ( ) ; getQuota ( ) . setItems ( quotas ) ; getQuota ( ) . setIsEmpty ( quotas.isEmpty ( ) ) ; updateControlsAvailability ( ) ; stopProgress ( ) ; }

Target:
public void onSuccess ( java.lang.Object returnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.Quota > quotas = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.Quota > ) ( returnValue ) ) ; quotas = ( quotas != null ) ? quotas : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Quota > ( ) ; getQuota ( ) . setItems ( quotas ) ; getQuota ( ) . setIsEmpty ( quotas.isEmpty ( ) ) ; updateControlsAvailability ( ) ; stopProgress ( ) ; }
Source:
public java.util.List < org.ovirt.engine.ui.uicommonweb.models.VmConsoles > getAutoConnectableConsoles ( ) { java.util.List < org.ovirt.engine.ui.uicommonweb.models.VmConsoles > autoConnectableConsoles = new java.util.LinkedList < org.ovirt.engine.ui.uicommonweb.models.VmConsoles > ( ) ; for ( java.lang.Object item : items ) { org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel upItem = ( ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel ) ( item ) ) ; if ( ( ! ( upItem.isPool ( ) ) ) && ( upItem.getVmConsoles ( ) . canConnectToConsole ( ) ) ) { autoConnectableConsoles.add ( upItem.getVmConsoles ( ) ) ; } } return autoConnectableConsoles ; }

Target:
public java.util.List < org.ovirt.engine.ui.uicommonweb.models.VmConsoles > getAutoConnectableConsoles ( ) { java.util.List < org.ovirt.engine.ui.uicommonweb.models.VmConsoles > autoConnectableConsoles = new java.util.LinkedList < org.ovirt.engine.ui.uicommonweb.models.VmConsoles > ( ) ; for ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel upItem : items ) { if ( ( ! ( upItem.isPool ( ) ) ) && ( upItem.getVmConsoles ( ) . canConnectToConsole ( ) ) ) { autoConnectableConsoles.add ( upItem.getVmConsoles ( ) ) ; } } return autoConnectableConsoles ; }
Source:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsDao ( ) . get ( org.ovirt.engine.core.bll.GetVdsFenceStatusQuery.getParameters ( ) . getVdsId ( ) ) ; org.ovirt.engine.core.bll.pm.HostFenceActionExecutor executor = new org.ovirt.engine.core.bll.pm.HostFenceActionExecutor ( vds ) ; org.ovirt.engine.core.bll.GetVdsFenceStatusQuery.getQueryReturnValue ( ) . setReturnValue ( executor.fence ( FenceActionType.STATUS ) ) ; }

Target:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsDao ( ) . get ( org.ovirt.engine.core.bll.GetVdsFenceStatusQuery.getParameters ( ) . getId ( ) ) ; org.ovirt.engine.core.bll.pm.HostFenceActionExecutor executor = new org.ovirt.engine.core.bll.pm.HostFenceActionExecutor ( vds ) ; org.ovirt.engine.core.bll.GetVdsFenceStatusQuery.getQueryReturnValue ( ) . setReturnValue ( executor.fence ( FenceActionType.STATUS ) ) ; }
Source:
protected org.ovirt.engine.core.common.utils.ToStringBuilder appendAttributes ( org.ovirt.engine.core.common.utils.ToStringBuilder tsb ) { return super . appendAttributes ( tsb ) . append ( "force" , getForce ( ) ) . append ( "secondsToWait" , getSecondsToWait ( ) ) . append ( "gracefully" , getGracefully ( ) ) . append ( "reason" , getReason ( ) ) . append ( "ignoreNoVm" , isIgnoreNoVm ( ) ) ; }

Target:
protected org.ovirt.engine.core.common.utils.ToStringBuilder appendAttributes ( org.ovirt.engine.core.common.utils.ToStringBuilder tsb ) { return super . appendAttributes ( tsb ) . append ( "secondsToWait" , getSecondsToWait ( ) ) . append ( "gracefully" , getGracefully ( ) ) . append ( "reason" , getReason ( ) ) . append ( "ignoreNoVm" , isIgnoreNoVm ( ) ) ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { final java.util.List < org.ovirt.engine.core.common.businessentities.VDS > hosts = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ) ( returnValue ) ) ; final java.util.List < org.ovirt.engine.core.common.businessentities.VDS > activeHosts = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VDS host : hosts ) { if ( VDSStatus.Up.equals ( host.getStatus ( ) ) ) { activeHosts.add ( host ) ; } } getDefaultHost ( ) . setItems ( activeHosts ) ; if ( activeHosts.isEmpty ( ) ) { setIsHostTabVisible ( false ) ; } }

Target:
public void onSuccess ( java.util.List < org.ovirt.engine.core.common.businessentities.VDS > hosts ) { final java.util.List < org.ovirt.engine.core.common.businessentities.VDS > activeHosts = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VDS host : hosts ) { if ( VDSStatus.Up.equals ( host.getStatus ( ) ) ) { activeHosts.add ( host ) ; } } getDefaultHost ( ) . setItems ( activeHosts ) ; if ( activeHosts.isEmpty ( ) ) { setIsHostTabVisible ( false ) ; } }
Source:
public void testGetNotFound1 ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( new java.util.ArrayList < > ( ) ) ; control.replay ( ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testGetNotFound1 ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( new java.util.ArrayList < > ( ) ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
public void prepareMocks ( ) { org.mockito.Mockito.doReturn ( interfaceDao ) . when ( cmd ) . getInterfaceDao ( ) ; org.mockito.Mockito.doReturn ( getVds ( VDSStatus.Up ) ) . when ( cmd ) . getUpServer ( ) ; org.mockito.Mockito.doReturn ( getVdsStatic ( ) ) . when ( vdsStaticDao ) . get ( org.ovirt.engine.core.bll.gluster.CreateGlusterVolumeCommandTest.serverId ) ; org.mockito.Mockito.doReturn ( getCluster ( true ) ) . when ( clusterDao ) . get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; }

Target:
public void prepareMocks ( ) { org.mockito.Mockito.doReturn ( getVds ( VDSStatus.Up ) ) . when ( cmd ) . getUpServer ( ) ; org.mockito.Mockito.doReturn ( getVdsStatic ( ) ) . when ( vdsStaticDao ) . get ( org.ovirt.engine.core.bll.gluster.CreateGlusterVolumeCommandTest.serverId ) ; org.mockito.Mockito.doReturn ( getCluster ( true ) ) . when ( clusterDao ) . get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; }
Source:
public com.google.gwt.safehtml.shared.SafeHtml getTooltip ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotEntity snapshot ) { if ( snapshot == null ) { return null ; } org.ovirt.engine.core.common.businessentities.gluster.GlusterSnapshotStatus status = snapshot.getStatus ( ) ; com.google.gwt.resources.client.ImageResource statusImage = null ; java.lang.String tooltip ; switch ( status ) { case ACTIVATED : tooltip = org.ovirt.engine.ui.webadmin.widget.table.column.GlusterVolumeSnapshotStatusColumn.constants.up ( ) ; break ; case DEACTIVATED : tooltip = org.ovirt.engine.ui.webadmin.widget.table.column.GlusterVolumeSnapshotStatusColumn.constants.down ( ) ; break ; case UNKNOWN : tooltip = org.ovirt.engine.ui.webadmin.widget.table.column.GlusterVolumeSnapshotStatusColumn.constants.unknown ( ) ; break ; default : tooltip = org.ovirt.engine.ui.webadmin.widget.table.column.GlusterVolumeSnapshotStatusColumn.constants.down ( ) ; } return com.google.gwt.safehtml.shared.SafeHtmlUtils.fromSafeConstant ( tooltip ) ; }

Target:
public com.google.gwt.safehtml.shared.SafeHtml getTooltip ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotEntity snapshot ) { if ( snapshot == null ) { return null ; } org.ovirt.engine.core.common.businessentities.gluster.GlusterSnapshotStatus status = snapshot.getStatus ( ) ; java.lang.String tooltip ; switch ( status ) { case ACTIVATED : tooltip = org.ovirt.engine.ui.webadmin.widget.table.column.GlusterVolumeSnapshotStatusColumn.constants.up ( ) ; break ; case DEACTIVATED : tooltip = org.ovirt.engine.ui.webadmin.widget.table.column.GlusterVolumeSnapshotStatusColumn.constants.down ( ) ; break ; case UNKNOWN : tooltip = org.ovirt.engine.ui.webadmin.widget.table.column.GlusterVolumeSnapshotStatusColumn.constants.unknown ( ) ; break ; default : tooltip = org.ovirt.engine.ui.webadmin.widget.table.column.GlusterVolumeSnapshotStatusColumn.constants.down ( ) ; } return com.google.gwt.safehtml.shared.SafeHtmlUtils.fromSafeConstant ( tooltip ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { dataCenters.addAll ( ( ( java.util.Collection < org.ovirt.engine.core.common.businessentities.StoragePool > ) ( returnValue ) ) ) ; java.util.Collections.sort ( dataCenters , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getExternalNetworkMap ( networkQuery , provider.getId ( ) ) ; }

Target:
public void onSuccess ( java.lang.Object returnValue ) { dataCenters.addAll ( ( ( java.util.Collection < org.ovirt.engine.core.common.businessentities.StoragePool > ) ( returnValue ) ) ) ; java.util.Collections.sort ( dataCenters , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getExternalNetworkMap ( networkQuery , provider.getId ( ) ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > hosts = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ) ( result ) ) ; org.ovirt.engine.ui.uicommonweb.models.ListModel < org.ovirt.engine.core.common.businessentities.VDS > hostNameListModel = getExternalHostName ( ) ; hosts.add ( 0 , null ) ; hostNameListModel.setItems ( hosts ) ; hostNameListModel.setIsChangable ( true ) ; setEnableSearchHost ( true ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > hosts = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ) ( result ) ) ; org.ovirt.engine.ui.uicommonweb.models.ListModel < org.ovirt.engine.core.common.businessentities.VDS > hostNameListModel = getExternalHostName ( ) ; hostNameListModel.setItems ( hosts ) ; hostNameListModel.setIsChangable ( true ) ; setEnableSearchHost ( true ) ; }
Source:
public boolean getHostnameEnabled ( ) { if ( isWindowsOS ) { return ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( ( ( java.lang.String ) ( getWindowsHostname ( ) . getEntity ( ) ) ) ) ) ; } else { return ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( ( ( java.lang.String ) ( getHostname ( ) . getEntity ( ) ) ) ) ) ; } }

Target:
public boolean getHostnameEnabled ( ) { if ( isWindowsOS ) { return ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( getWindowsHostname ( ) . getEntity ( ) ) ) ; } else { return ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( getHostname ( ) . getEntity ( ) ) ) ; } }
Source:
protected javax.ws.rs.core.UriInfo setUpActionExpectations ( org.ovirt.engine.core.common.action.VdcActionType task , java.lang.Class < ? extends org.ovirt.engine.core.common.action.VdcActionParametersBase > clz , java.lang.String [ ] names , java.lang.Object [ ] values , java.util.ArrayList < org.ovirt.engine.core.compat.Guid > asyncTasks , java.util.ArrayList < org.ovirt.engine.core.common.businessentities.AsyncTaskStatus > asyncStatuses ) { java.lang.String uri = ( ( ( "datacenters/" + ( org.ovirt.engine.api.restapi.resource.BackendAttachedStorageDomainResourceTest.DATA_CENTER_ID ) ) + "/storagedomains/" ) + ( org.ovirt.engine.api.restapi.resource.BackendAttachedStorageDomainResourceTest.STORAGE_DOMAIN_ID ) ) + "/action" ; return setUpActionExpectations ( task , clz , names , values , true , true , null , asyncTasks , asyncStatuses , uri , true ) ; }

Target:
protected javax.ws.rs.core.UriInfo setUpActionExpectations ( org.ovirt.engine.core.common.action.VdcActionType task , java.lang.Class < ? extends org.ovirt.engine.core.common.action.VdcActionParametersBase > clz , java.lang.String [ ] names , java.lang.Object [ ] values , java.util.ArrayList < org.ovirt.engine.core.compat.Guid > asyncTasks , java.util.ArrayList < org.ovirt.engine.core.common.businessentities.AsyncTaskStatus > asyncStatuses ) { java.lang.String uri = ( ( ( "datacenters/" + ( org.ovirt.engine.api.restapi.resource.BackendAttachedStorageDomainResourceTest.DATA_CENTER_ID ) ) + "/storagedomains/" ) + ( org.ovirt.engine.api.restapi.resource.BackendAttachedStorageDomainResourceTest.STORAGE_DOMAIN_ID ) ) + "/action" ; return setUpActionExpectations ( task , clz , names , values , true , true , null , asyncTasks , asyncStatuses , null , null , uri , true ) ; }
Source:
public void init ( ) { super . init ( ) ; setTitle ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . runVirtualMachinesTitle ( ) ) ; setIsHostTabVisible ( false ) ; setIsCustomPropertiesSheetVisible ( false ) ; getCustomProperties ( ) . setEntity ( vm.getCustomProperties ( ) ) ; }

Target:
public void init ( ) { super . init ( ) ; setIsHostTabVisible ( false ) ; setIsCustomPropertiesSheetVisible ( false ) ; getCustomProperties ( ) . setEntity ( vm.getCustomProperties ( ) ) ; }