auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static void getPermissionsByAdElementId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid userId ) { 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 ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.permissions > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.permissions > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetPermissionsByAdElementId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( userId ) , aQuery ) ; }

Target:
public static void getGlusterRebalanceStatus ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId , org.ovirt.engine.core.compat.Guid volumeId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeTaskStatusEntity > ( ) { @ java.lang.Override public org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeTaskStatusEntity Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeTaskStatusEntity ) ( source ) ) ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterVolumeQueriesParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeQueriesParameters ( clusterId , volumeId ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterVolumeRebalanceStatus , parameters , aQuery ) ; }
Source:
public void testWrongPassword ( ) throws java.lang.Exception { client.setPassword ( ( ( TestCommon.password ) + "A" ) ) ; client.connect ( ) ; client.authenticate ( ) ; client.executeCommand ( org.ovirt.engine.core.uutils.ssh.BasicTest.helloCommand , null , null , null ) ; }

Target:
public void testWrongPassword ( ) throws java.lang.Exception { client.setPassword ( ( ( TestCommon.password ) + "A" ) ) ; org.junit.jupiter.api.Assertions.assertThrows ( javax.naming.AuthenticationException.class , ( ) -> { client.connect ( ) ; client.authenticate ( ) ; client.executeCommand ( org.ovirt.engine.core.uutils.ssh.BasicTest.helloCommand , null , null , null ) ; } ) ; }
Source:
public void testGetAllByVdsGroup ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmStatic > result = dao.getAllByVdsGroup ( org.ovirt.engine.core.dao.VmStaticDAOTest.VDS_GROUP_ID ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VmStatic vm : result ) { org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.VmStaticDAOTest.VDS_GROUP_ID , vm.getvds_group_id ( ) ) ; } }

Target:
public void testGetAllByVdsGroup ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmStatic > result = dao.getAllByVdsGroup ( org.ovirt.engine.core.dao.VmStaticDAOTest.VDS_GROUP_ID ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VmStatic vm : result ) { org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.VmStaticDAOTest.VDS_GROUP_ID , vm.getVdsGroupId ( ) ) ; } }
Source:
protected boolean canDoAction ( ) { org.ovirt.engine.core.common.businessentities.tags tag = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getTagDAO ( ) . getByName ( org.ovirt.engine.core.bll.AddTagCommand.getParameters ( ) . getTag ( ) . gettag_name ( ) ) ; if ( tag != null ) { addCanDoActionMessage ( VdcBllMessages.TAGS_SPECIFY_TAG_IS_IN_USE ) ; return false ; } return true ; }

Target:
protected boolean canDoAction ( ) { org.ovirt.engine.core.common.businessentities.tags tag = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getTagDao ( ) . getByName ( org.ovirt.engine.core.bll.AddTagCommand.getParameters ( ) . getTag ( ) . gettag_name ( ) ) ; if ( tag != null ) { addCanDoActionMessage ( VdcBllMessages.TAGS_SPECIFY_TAG_IS_IN_USE ) ; return false ; } return true ; }
Source:
private void domainRecoveredFromProblem ( org.ovirt.engine.core.compat.Guid domainId , org.ovirt.engine.core.compat.Guid vdsId , java.lang.String vdsName ) { java.lang.String domainIdTuple = org.ovirt.engine.core.vdsbroker.irsbroker.IrsProxyData.getDomainIdTuple ( domainId ) ; org.ovirt.engine.core.vdsbroker.irsbroker.IrsProxyData.log.infoFormat ( "Domain {0} recovered from problem. vds: {1}" , domainIdTuple , vdsName ) ; _domainsInProblem.get ( domainId ) . remove ( vdsId ) ; if ( ( _domainsInProblem.get ( domainId ) . size ( ) ) == 0 ) { org.ovirt.engine.core.vdsbroker.irsbroker.IrsProxyData.log.infoFormat ( ( "Domain {0} has recovered from problem. No active host in the DC is reporting it as" + " problematic, so clearing the domain recovery timer." ) , domainIdTuple ) ; _domainsInProblem.remove ( domainId ) ; clearTimer ( domainId ) ; } }

Target:
private void updateDomainInProblemData ( org.ovirt.engine.core.compat.Guid domainId , org.ovirt.engine.core.compat.Guid vdsId , java.lang.String vdsName ) { org.ovirt.engine.core.vdsbroker.irsbroker.IrsProxyData.log.debug ( "domain '{}' still in problem. vds: '{}'" , org.ovirt.engine.core.vdsbroker.irsbroker.IrsProxyData.getDomainIdTuple ( domainId ) , vdsName ) ; _domainsInProblem.get ( domainId ) . add ( vdsId ) ; }
Source:
private java.lang.Boolean isSameNetworkAddress ( org.ovirt.engine.core.compat.Guid hostId , java.lang.String glusterNetworkName , java.lang.String networkAddress ) { final java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > nics = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getInterfaceDao ( ) . getAllInterfacesForVds ( hostId ) ; for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic : nics ) { if ( glusterNetworkName.equals ( nic.getNetworkName ( ) ) ) { return networkAddress.equals ( nic.getAddress ( ) ) ; } } return false ; }

Target:
private java.lang.Boolean isSameNetworkAddress ( org.ovirt.engine.core.compat.Guid hostId , java.lang.String glusterNetworkName , java.lang.String networkAddress ) { final java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > nics = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getInterfaceDao ( ) . getAllInterfacesForVds ( hostId ) ; for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic : nics ) { if ( glusterNetworkName.equals ( nic.getNetworkName ( ) ) ) { return networkAddress.equals ( nic.getIpv4Address ( ) ) ; } } return false ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult isMacAssignableValidator ( ) { java.lang.Boolean allowDupMacs = macPool.isDuplicateMacAddressesAllowed ( ) ; boolean macIsAlreadyUsed = macPool.isMacInUse ( macAddress ) ; boolean illegalDuplicateMacUsage = macIsAlreadyUsed && ( ! allowDupMacs ) ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( EngineMessage.NETWORK_MAC_ADDRESS_IN_USE ) . when ( illegalDuplicateMacUsage ) ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult isMacAssignableValidator ( ) { boolean allowDupMacs = macPool.isDuplicateMacAddressesAllowed ( ) ; boolean illegalDuplicateMacUsage = ( ! allowDupMacs ) && ( macPool.isMacInUse ( macAddress ) ) ; org.ovirt.engine.core.common.errors.EngineMessage failMessage = org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_MAC_ADDRESS_IN_USE ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( failMessage , org.ovirt.engine.core.utils.ReplacementUtils.getVariableAssignmentString ( failMessage , macAddress ) ) . when ( illegalDuplicateMacUsage ) ; }
Source:
public static void getRedirectServletReportsPage ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { 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 ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.RedirectServletReportsPage , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public static void getUpHostListByCluster ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String clusterName ) { 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 ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > list = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VDS > cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getUpHostListByCluster ( aQuery , clusterName , null ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.VM doPersist ( ) { vmStaticDao.save ( object.getStaticData ( ) ) ; vmDynamicDao.save ( object.getDynamicData ( ) ) ; vmStatisticsDao.save ( object.getStatisticsData ( ) ) ; return object ; }

Target:
protected org.ovirt.engine.core.common.businessentities.VM doPersist ( ) { vmStaticDao.save ( object.getStaticData ( ) ) ; vmDynamicDao.save ( object.getDynamicData ( ) ) ; vmStatisticsDao.save ( object.getStatisticsData ( ) ) ; return vmDao.get ( object.getId ( ) ) ; }
Source:
public org.ovirt.engine.ui.uicommonweb.models.configure.roles_ui.RoleListModel getModel ( ) { return getCommonModel ( ) . getRoleListModel ( ) ; }

Target:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.Model , ? > getModelPopup ( org.ovirt.engine.ui.uicommonweb.models.configure.roles_ui.RoleListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand , org.ovirt.engine.ui.uicommonweb.models.Model windowModel ) { if ( ( ( lastExecutedCommand.equals ( getModel ( ) . getNewCommand ( ) ) ) || ( lastExecutedCommand.equals ( getModel ( ) . getEditCommand ( ) ) ) ) || ( lastExecutedCommand.equals ( getModel ( ) . getCloneCommand ( ) ) ) ) { return rolePopupProvider.get ( ) ; } else { return super . getModelPopup ( source , lastExecutedCommand , windowModel ) ; } }
Source:
private void removeHost ( ) { org.ovirt.engine.core.itests.BasicTestSetup.DB_FACADE.getVdsDynamicDAO ( ) . remove ( host.getId ( ) ) ; org.ovirt.engine.core.itests.BasicTestSetup.DB_FACADE.getVdsStatisticsDAO ( ) . remove ( host.getId ( ) ) ; org.ovirt.engine.core.itests.BasicTestSetup.DB_FACADE.getVdsStaticDAO ( ) . remove ( host.getId ( ) ) ; java.lang.System.out.println ( ( ( "-- removed Host " + ( host.gethost_name ( ) ) ) + " -- " ) ) ; }

Target:
private void removeHost ( ) { org.ovirt.engine.core.itests.BasicTestSetup.DB_FACADE.getVdsDynamicDao ( ) . remove ( host.getId ( ) ) ; org.ovirt.engine.core.itests.BasicTestSetup.DB_FACADE.getVdsStatisticsDao ( ) . remove ( host.getId ( ) ) ; org.ovirt.engine.core.itests.BasicTestSetup.DB_FACADE.getVdsStaticDao ( ) . remove ( host.getId ( ) ) ; java.lang.System.out.println ( ( ( "-- removed Host " + ( host.gethost_name ( ) ) ) + " -- " ) ) ; }
Source:
public void getLunsByVgId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String vgId , org.ovirt.engine.core.compat.Guid vdsId ) { 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 ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.LUNs > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.LUNs > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters params = new org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters ( vgId , vdsId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetLunsByVgId , params , aQuery ) ; }

Target:
public void getClustersHavingHosts ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { 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 ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( source ) ) ; java.util.Collections.sort ( list , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllClustersHavingHosts , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
private boolean canRemoveTemplateDisk ( ) { if ( ( org.ovirt.engine.core.bll.RemoveDiskCommand.getVmTemplate ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VmTemplateStatus.Locked ) ) { return failCanDoAction ( VdcBllMessages.VM_TEMPLATE_IMAGE_IS_LOCKED ) ; } org.ovirt.engine.core.common.businessentities.DiskImage diskImage = getDiskImage ( ) ; if ( ( diskImage.getStorageIds ( ) . size ( ) ) == 1 ) { return failCanDoAction ( VdcBllMessages.VM_TEMPLATE_IMAGE_LAST_DOMAIN ) ; } if ( ( ! ( checkDerivedVmFromTemplateExists ( diskImage ) ) ) || ( ! ( checkDerivedDisksFromDiskNotExist ( diskImage ) ) ) ) { return false ; } return true ; }

Target:
private boolean canRemoveTemplateDisk ( ) { if ( ( org.ovirt.engine.core.bll.RemoveDiskCommand.getVmTemplate ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VmTemplateStatus.Locked ) ) { return failCanDoAction ( VdcBllMessages.VM_TEMPLATE_IMAGE_IS_LOCKED ) ; } org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = getDiskImage ( ) ; if ( ( diskImage.getStorageIds ( ) . size ( ) ) == 1 ) { return failCanDoAction ( VdcBllMessages.VM_TEMPLATE_IMAGE_LAST_DOMAIN ) ; } if ( ( ! ( checkDerivedVmFromTemplateExists ( diskImage ) ) ) || ( ! ( checkDerivedDisksFromDiskNotExist ( diskImage ) ) ) ) { return false ; } return true ; }
Source:
public void ExecuteCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . ExecuteCommand ( command ) ; if ( command.getName ( ) . equals ( "OnEditClusterQuota" ) ) { onEditClusterQuota ( ) ; } else if ( command.getName ( ) . equals ( "OnEditStorageQuota" ) ) { onEditStorageQuota ( ) ; } else if ( command.getName ( ) . equals ( "Cancel" ) ) { setWindow ( null ) ; } }

Target:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . executeCommand ( command ) ; if ( command.getName ( ) . equals ( "OnEditClusterQuota" ) ) { onEditClusterQuota ( ) ; } else if ( command.getName ( ) . equals ( "OnEditStorageQuota" ) ) { onEditStorageQuota ( ) ; } else if ( command.getName ( ) . equals ( "Cancel" ) ) { setWindow ( null ) ; } }
Source:
public static void getClusterGlusterServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { 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.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters ( clusterId , null , null , false ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeAdvancedDetails , parameters , aQuery ) ; }

Target:
public static void getGlusterHooks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { 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 ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterHooks , new org.ovirt.engine.core.common.queries.gluster.GlusterParameters ( clusterId ) , aQuery ) ; }
Source:
void addStyles ( ) { pathEditor.addContentWidgetContainerStyleName ( style.pathEditorContent ( ) ) ; expanderContent.setStyleName ( style.expanderContent ( ) ) ; }

Target:
void addStyles ( ) { pathEditor.addContentWidgetContainerStyleName ( style.pathEditorContent ( ) ) ; expanderContent.setStyleName ( style.expanderContent ( ) ) ; versionListEditor.setStyleName ( style.versionListEditor ( ) ) ; retransmissionsEditor.setStyleName ( style.storageTextBoxEditor ( ) ) ; timeoutEditor.setStyleName ( style.storageTextBoxEditor ( ) ) ; mountOptionsEditor.setStyleName ( style.mountTextBoxEditor ( ) ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.DbUser getTargetDbUser ( ) { org.ovirt.engine.core.common.businessentities.DbUser dbUser = new org.ovirt.engine.core.common.businessentities.DbUser ( ) ; dbUser.setLoginName ( getSearchString ( ) ) ; dbUser.setDomain ( getDomain ( ) . getSelectedItem ( ) . toString ( ) ) ; return dbUser ; }

Target:
private org.ovirt.engine.core.common.businessentities.DbUser getTargetDbUser ( ) { org.ovirt.engine.core.common.businessentities.DbUser dbUser = new org.ovirt.engine.core.common.businessentities.DbUser ( ) ; dbUser.setLoginName ( getSearchString ( ) ) ; dbUser.setDomain ( ( ( org.ovirt.engine.core.aaa.ProfileEntry ) ( getProfile ( ) . getSelectedItem ( ) ) ) . getAuthz ( ) ) ; return dbUser ; }
Source:
public void testSave ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.RepoImage > listOfRepoFiles = repoFileMetaDataDao.getRepoListForStorageDomain ( FixturesTool.STORAGE_DOAMIN_NFS_ISO , ImageFileType.ISO ) ; org.junit.Assert.assertNotNull ( listOfRepoFiles ) ; org.junit.Assert.assertTrue ( listOfRepoFiles.isEmpty ( ) ) ; org.ovirt.engine.core.common.businessentities.storage.RepoImage newRepoFileMap = org.ovirt.engine.core.dao.RepoFileMetaDataDaoTest.getNewIsoRepoFile ( ) ; repoFileMetaDataDao.addRepoFileMap ( newRepoFileMap ) ; listOfRepoFiles = repoFileMetaDataDao.getRepoListForStorageDomain ( FixturesTool.STORAGE_DOAMIN_NFS_ISO , ImageFileType.ISO ) ; org.junit.Assert.assertFalse ( listOfRepoFiles.isEmpty ( ) ) ; }

Target:
public void testSave ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.RepoImage > listOfRepoFiles = repoFileMetaDataDao.getRepoListForStorageDomain ( FixturesTool.STORAGE_DOMAIN_NFS_ISO , ImageFileType.ISO ) ; org.junit.Assert.assertNotNull ( listOfRepoFiles ) ; org.junit.Assert.assertTrue ( listOfRepoFiles.isEmpty ( ) ) ; org.ovirt.engine.core.common.businessentities.storage.RepoImage newRepoFileMap = org.ovirt.engine.core.dao.RepoFileMetaDataDaoTest.getNewIsoRepoFile ( ) ; repoFileMetaDataDao.addRepoFileMap ( newRepoFileMap ) ; listOfRepoFiles = repoFileMetaDataDao.getRepoListForStorageDomain ( FixturesTool.STORAGE_DOMAIN_NFS_ISO , ImageFileType.ISO ) ; org.junit.Assert.assertFalse ( listOfRepoFiles.isEmpty ( ) ) ; }
Source:
public void testExpireTokenCachesToken ( ) { java.lang.String result1 = tokenProvider.getToken ( ) ; java.lang.String result2 = tokenProvider.getToken ( ) ; org.mockito.Mockito.verify ( mockAuthenticate , org.mockito.Mockito.times ( 1 ) ) . execute ( ) ; org.junit.Assert.assertThat ( result1 , org.hamcrest.Matchers.is ( org.ovirt.engine.core.bll.provider.network.openstack.ExternalNetworkTokenProviderTest.TOKEN_ID ) ) ; org.junit.Assert.assertThat ( result2 , org.hamcrest.Matchers.is ( org.ovirt.engine.core.bll.provider.network.openstack.ExternalNetworkTokenProviderTest.TOKEN_ID ) ) ; }

Target:
public void testExpireTokenCachesToken ( ) { java.lang.String result1 = tokenProvider.getToken ( ) ; java.lang.String result2 = tokenProvider.getToken ( ) ; org.mockito.Mockito.verify ( mockAuthenticate , org.mockito.Mockito.times ( 1 ) ) . execute ( ) ; org.hamcrest.MatcherAssert.assertThat ( result1 , org.hamcrest.Matchers.is ( org.ovirt.engine.core.bll.provider.network.openstack.ExternalNetworkTokenProviderTest.TOKEN_ID ) ) ; org.hamcrest.MatcherAssert.assertThat ( result2 , org.hamcrest.Matchers.is ( org.ovirt.engine.core.bll.provider.network.openstack.ExternalNetworkTokenProviderTest.TOKEN_ID ) ) ; }
Source:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.OpenStackSubnet subnet ) { org.ovirt.engine.core.common.action.AddExternalSubnetParameters parameters = new org.ovirt.engine.core.common.action.AddExternalSubnetParameters ( ) ; parameters.setSubnet ( map ( subnet ) ) ; parameters.setProviderId ( asGuid ( providerId ) ) ; parameters.setNetworkId ( networkId ) ; return performCreate ( VdcActionType.AddSubnetToProvider , parameters , new org.ovirt.engine.api.restapi.resource.openstack.BackendOpenStackSubnetsResource.SubnetNameResolver ( subnet.getName ( ) ) ) ; }

Target:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.OpenStackSubnet subnet ) { org.ovirt.engine.core.common.action.AddExternalSubnetParameters parameters = new org.ovirt.engine.core.common.action.AddExternalSubnetParameters ( ) ; parameters.setSubnet ( map ( subnet ) ) ; parameters.setProviderId ( asGuid ( providerId ) ) ; parameters.setNetworkId ( networkId ) ; return performCreate ( ActionType.AddSubnetToProvider , parameters , new org.ovirt.engine.api.restapi.resource.openstack.BackendOpenStackSubnetsResource.SubnetNameResolver ( subnet.getName ( ) ) ) ; }
Source:
protected void setUpCreationExpectations ( ) { setUpCreationExpectations ( ActionType.AddVmTemplate , org.ovirt.engine.core.common.action.AddVmTemplateParameters.class , new java.lang.String [ ] { "Name" , "Description" } , new java.lang.Object [ ] { NAMES [ 0 ] , DESCRIPTIONS [ 0 ] } , true , true , GUIDS [ 0 ] , asList ( GUIDS [ 2 ] ) , asList ( new org.ovirt.engine.core.common.businessentities.AsyncTaskStatus ( org.ovirt.engine.core.common.businessentities.AsyncTaskStatusEnum.finished ) ) , VdcQueryType.GetInstanceType , org.ovirt.engine.core.common.queries.GetVmTemplateParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , getEntity ( 0 ) ) ; }

Target:
protected void setUpCreationExpectations ( ) { setUpCreationExpectations ( ActionType.AddVmTemplate , org.ovirt.engine.core.common.action.AddVmTemplateParameters.class , new java.lang.String [ ] { "Name" , "Description" } , new java.lang.Object [ ] { NAMES [ 0 ] , DESCRIPTIONS [ 0 ] } , true , true , GUIDS [ 0 ] , asList ( GUIDS [ 2 ] ) , asList ( new org.ovirt.engine.core.common.businessentities.AsyncTaskStatus ( org.ovirt.engine.core.common.businessentities.AsyncTaskStatusEnum.finished ) ) , QueryType.GetInstanceType , org.ovirt.engine.core.common.queries.GetVmTemplateParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , getEntity ( 0 ) ) ; }
Source:
public void testUpdateSetAndUploadIconFailure ( ) throws java.lang.Exception { final org.ovirt.engine.api.model.Template model = getRestModel ( 0 ) ; model.setSmallIcon ( org.ovirt.engine.api.restapi.resource.IconTestHelpler.createIcon ( GUIDS [ 2 ] ) ) ; model.setLargeIcon ( org.ovirt.engine.api.restapi.resource.IconTestHelpler.createIconWithData ( ) ) ; try { verifyModel ( resource.update ( model ) , 0 ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.BAD_REQUEST ) ; } }

Target:
public void testUpdateSetAndUploadIconFailure ( ) throws java.lang.Exception { final org.ovirt.engine.api.model.Template model = getRestModel ( 0 ) ; model.setSmallIcon ( org.ovirt.engine.api.restapi.resource.IconTestHelpler.createIcon ( GUIDS [ 2 ] ) ) ; model.setLargeIcon ( org.ovirt.engine.api.restapi.resource.IconTestHelpler.createIconWithData ( ) ) ; try { verifyModel ( resource.update ( model ) , 0 ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.BAD_REQUEST ) ; } }
Source:
public static void GetCustomPropertiesList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { 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 ? ( ( java.util.HashMap < org.ovirt.engine.core.compat.Version , java.lang.String > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmCustomProperties , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
public static void GetClusterServerMemoryOverCommit ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { 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 ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxVdsMemOverCommitForServers ) , aQuery ) ; }
Source:
public void onValueChange ( com.google.gwt.event.logical.shared.ValueChangeEvent < java.lang.Object > event ) { for ( java.lang.Object item : object.getBondingOptions ( ) . getItems ( ) ) { org.ovirt.engine.core.compat.KeyValuePairCompat < java.lang.String , org.ovirt.engine.ui.uicommonweb.models.EntityModel > pair = ( ( org.ovirt.engine.core.compat.KeyValuePairCompat < java.lang.String , org.ovirt.engine.ui.uicommonweb.models.EntityModel > ) ( item ) ) ; if ( "custom" . equals ( pair.getKey ( ) ) ) { pair.getValue ( ) . setEntity ( event.getValue ( ) ) ; } } }

Target:
public void onValueChange ( com.google.gwt.event.logical.shared.ValueChangeEvent < java.lang.String > event ) { for ( java.util.Map.Entry < java.lang.String , org.ovirt.engine.ui.uicommonweb.models.EntityModel < java.lang.String > > item : object.getBondingOptions ( ) . getItems ( ) ) { if ( "custom" . equals ( item.getKey ( ) ) ) { item.getValue ( ) . setEntity ( event.getValue ( ) ) ; } } }
Source:
public void testGetDeviceListWithDeviceListAndLunsIds ( ) { org.ovirt.engine.core.common.businessentities.storage.LUNs lun1 = new org.ovirt.engine.core.common.businessentities.storage.LUNs ( ) ; lun1.setId ( "lun1" ) ; org.ovirt.engine.core.common.businessentities.storage.LUNs lun2 = new org.ovirt.engine.core.common.businessentities.storage.LUNs ( ) ; lun2.setId ( "lun2" ) ; parameters.setDeviceList ( java.util.Arrays.asList ( lun1 , lun2 ) ) ; java.util.List < java.lang.String > lunsIds = java.util.Collections.singletonList ( "lun2" ) ; org.junit.Assert.assertEquals ( command.getDeviceList ( lunsIds ) , java.util.Collections.singletonList ( lun2 ) ) ; }

Target:
public void testGetDeviceListWithDeviceListAndLunsIds ( ) { org.ovirt.engine.core.common.businessentities.storage.LUNs lun1 = new org.ovirt.engine.core.common.businessentities.storage.LUNs ( ) ; lun1.setId ( "lun1" ) ; org.ovirt.engine.core.common.businessentities.storage.LUNs lun2 = new org.ovirt.engine.core.common.businessentities.storage.LUNs ( ) ; lun2.setId ( "lun2" ) ; parameters.setDeviceList ( java.util.Arrays.asList ( lun1 , lun2 ) ) ; java.util.Set < java.lang.String > lunsIds = java.util.Collections.singleton ( "lun2" ) ; org.junit.Assert.assertEquals ( command.getDeviceList ( lunsIds ) , java.util.Collections.singletonList ( lun2 ) ) ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { getConnectivityTimeout ( ) . setEntity ( ( ( java.lang.Integer ) ( returnValue ) ) ) ; postOnSetupNetworks ( ) ; }

Target:
private void initNetworkIdToExistingAttachmentMap ( ) { java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.compat.Guid > networkIdToExistingAttachmentId = new java.util.HashMap < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment : hostSetupNetworksParametersData.getNetworkAttachments ( ) ) { networkIdToExistingAttachmentId.put ( attachment.getNetworkId ( ) , attachment.getId ( ) ) ; } hostSetupNetworksParametersData.setNetworkIdToExistingAttachmentId ( networkIdToExistingAttachmentId ) ; }
Source:
protected void updateMenuItem ( com.google.gwt.user.client.ui.MenuItem item , org.ovirt.engine.ui.common.widget.action.ActionButtonDefinition < T > buttonDef ) { item.setVisible ( ( ( buttonDef.isAccessible ( org.ovirt.engine.ui.common.widget.action.AbstractActionPanel.getSelectedItems ( ) ) ) && ( buttonDef.isVisible ( org.ovirt.engine.ui.common.widget.action.AbstractActionPanel.getSelectedItems ( ) ) ) ) ) ; item.setEnabled ( buttonDef.isEnabled ( org.ovirt.engine.ui.common.widget.action.AbstractActionPanel.getSelectedItems ( ) ) ) ; if ( ( buttonDef.getMenuItemTooltip ( ) ) != null ) { org.ovirt.engine.ui.common.widget.tooltip.TooltipMixin.addTooltipToElement ( buttonDef.getMenuItemTooltip ( ) , item.getElement ( ) ) ; } }

Target:
protected void updateMenuItem ( com.google.gwt.user.client.ui.MenuItem item , org.ovirt.engine.ui.common.widget.action.ActionButtonDefinition < T > buttonDef ) { item.setVisible ( ( ( buttonDef.isAccessible ( org.ovirt.engine.ui.common.widget.action.AbstractActionPanel.getSelectedItems ( ) ) ) && ( buttonDef.isVisible ( org.ovirt.engine.ui.common.widget.action.AbstractActionPanel.getSelectedItems ( ) ) ) ) ) ; item.setEnabled ( buttonDef.isEnabled ( org.ovirt.engine.ui.common.widget.action.AbstractActionPanel.getSelectedItems ( ) ) ) ; if ( ( buttonDef.getMenuItemTooltip ( ) ) != null ) { org.ovirt.engine.ui.common.utils.ElementTooltipUtils.setTooltipOnElement ( item.getElement ( ) , buttonDef.getMenuItemTooltip ( ) ) ; } }
Source:
public static void countAllTemplates ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { 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.GetVmTemplateCount , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
public static void getClusterGlusterServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { 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.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters ( clusterId , null , null , false ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeAdvancedDetails , parameters , aQuery ) ; }
Source:
public void ExecuteCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { if ( ! ( interfaceDialogModel.Validate ( ) ) ) { return ; } entity.setBootProtocol ( interfaceDialogModel.getBootProtocol ( ) ) ; entity.setAddress ( ( ( java.lang.String ) ( interfaceDialogModel.getAddress ( ) . getEntity ( ) ) ) ) ; entity.setSubnet ( ( ( java.lang.String ) ( interfaceDialogModel.getSubnet ( ) . getEntity ( ) ) ) ) ; hostInterfaceListModel.CancelConfirm ( ) ; }

Target:
public void ExecuteCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { if ( ! ( networkDialogModel.Validate ( ) ) ) { return ; } entity.setBootProtocol ( networkDialogModel.getBootProtocol ( ) ) ; entity.setAddress ( ( ( java.lang.String ) ( networkDialogModel.getAddress ( ) . getEntity ( ) ) ) ) ; entity.setSubnet ( ( ( java.lang.String ) ( networkDialogModel.getSubnet ( ) . getEntity ( ) ) ) ) ; hostInterfaceListModel.CancelConfirm ( ) ; }
Source:
protected void initProfiles ( ) { java.util.List < org.ovirt.engine.ui.uicommonweb.models.profiles.VnicProfileModel > profiles = new java.util.LinkedList < org.ovirt.engine.ui.uicommonweb.models.profiles.VnicProfileModel > ( ) ; org.ovirt.engine.ui.uicommonweb.models.profiles.NewVnicProfileModel newModel = new org.ovirt.engine.ui.uicommonweb.models.profiles.NewVnicProfileModel ( getSourceListModel ( ) , getSelectedDc ( ) . getcompatibility_version ( ) , false , getSelectedDc ( ) . getId ( ) ) ; profiles.add ( newModel ) ; getProfiles ( ) . setItems ( profiles ) ; }

Target:
private org.ovirt.engine.ui.uicommonweb.models.profiles.VnicProfileModel createDefaultProfile ( ) { final org.ovirt.engine.ui.uicommonweb.models.profiles.NewVnicProfileModel newModel = new org.ovirt.engine.ui.uicommonweb.models.profiles.NewVnicProfileModel ( getSourceListModel ( ) , getSelectedDc ( ) . getcompatibility_version ( ) , false , getSelectedDc ( ) . getId ( ) ) ; getName ( ) . getEntityChangedEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { newModel.getName ( ) . setEntity ( getName ( ) . getEntity ( ) ) ; } } ) ; return newModel ; }
Source:
protected void migrateVM ( final org.ovirt.engine.core.common.businessentities.VM vmToMigrate ) { org.ovirt.engine.core.common.action.MigrateVmParameters parameters = new org.ovirt.engine.core.common.action.MigrateVmParameters ( false , vmToMigrate.getId ( ) ) ; parameters.setReason ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.getMessage ( AuditLogType.MIGRATION_REASON_AFFINITY_ENFORCEMENT ) ) ; backend.runInternalAction ( VdcActionType.BalanceVm , parameters , org.ovirt.engine.core.bll.job.ExecutionHandler.createInternalJobContext ( ) ) ; }

Target:
protected void migrateVM ( final org.ovirt.engine.core.common.businessentities.VM vmToMigrate ) { org.ovirt.engine.core.common.action.MigrateVmParameters parameters = new org.ovirt.engine.core.common.action.MigrateVmParameters ( false , vmToMigrate.getId ( ) ) ; parameters.setReason ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.MessageBundler.getMessage ( AuditLogType.MIGRATION_REASON_AFFINITY_ENFORCEMENT ) ) ; backend.runInternalAction ( VdcActionType.BalanceVm , parameters , org.ovirt.engine.core.bll.job.ExecutionHandler.createInternalJobContext ( ) ) ; }
Source:
private void doTestBadUpdate ( boolean canDo , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpEntityQueryExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateNetwork , org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters.class , new java.lang.String [ ] { "StoragePoolId" } , new java.lang.Object [ ] { GUIDS [ 1 ] } , canDo , success ) ) ; try { resource.update ( org.ovirt.engine.api.restapi.resource.AbstractBackendNetworksResourceTest.getModel ( 0 ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
private void doTestBadUpdate ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpEntityQueryExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateNetwork , org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters.class , new java.lang.String [ ] { "StoragePoolId" } , new java.lang.Object [ ] { GUIDS [ 1 ] } , valid , success ) ) ; try { resource.update ( org.ovirt.engine.api.restapi.resource.AbstractBackendNetworksResourceTest.getModel ( 0 ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
public static void getMaximalVmMemSize64OS ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String version ) { 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 ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : - 1 ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.VM64BitMaxMemorySizeInMB ) ; tempVar.setVersion ( version ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( tempVar , aQuery ) ; }

Target:
public static java.lang.Boolean isMigrationSupported ( org.ovirt.engine.core.common.businessentities.ArchitectureType architecture , org.ovirt.engine.core.compat.Version version ) { return org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.migrationSupport.get ( architecture ) . get ( version ) ; }
Source:
public static void getVmList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String poolName ) { 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 ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > vms = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VM > cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return vms ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( "Vms: pool=" + poolName ) , org.ovirt.engine.core.common.interfaces.SearchType.VM ) , 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:
private void connectStorageToHost ( org.ovirt.engine.core.compat.Guid hostId , org.ovirt.engine.core.common.businessentities.StorageType storageType , org.ovirt.engine.api.model.LogicalUnit unit ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections cnx = org.ovirt.engine.api.restapi.util.StorageDomainHelper.getConnection ( storageType , unit.getAddress ( ) , unit.getTarget ( ) , unit.getUsername ( ) , unit.getPassword ( ) , unit.getPort ( ) ) ; performAction ( VdcActionType.ConnectStorageToVds , new org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase ( cnx , hostId ) ) ; }

Target:
private void connectStorageToHost ( org.ovirt.engine.core.compat.Guid hostId , org.ovirt.engine.core.common.businessentities.storage.StorageType storageType , org.ovirt.engine.api.model.LogicalUnit unit ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections cnx = org.ovirt.engine.api.restapi.util.StorageDomainHelper.getConnection ( storageType , unit.getAddress ( ) , unit.getTarget ( ) , unit.getUsername ( ) , unit.getPassword ( ) , unit.getPort ( ) ) ; performAction ( VdcActionType.ConnectStorageToVds , new org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase ( cnx , hostId ) ) ; }
Source:
public static void getTemplateDiskList ( 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 ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmTemplatesDisks , new org.ovirt.engine.core.common.queries.IdQueryParameters ( templateId ) , aQuery ) ; }

Target:
public static void isSoundcardEnabled ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { 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 ) { if ( source != null ) { return ( ( ( java.util.List < java.lang.String > ) ( source ) ) . size ( ) ) > 0 ; } return false ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetSoundDevices , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
public void testRemoveStorageConnectionFromIscsiBond ( ) { java.util.List < java.lang.String > connections = dao.getStorageConnectionIdsByIscsiBondId ( FixturesTool.ISCSI_BOND_ID ) ; java.lang.String connectionId = connections.get ( 0 ) ; dao.removeStorageConnectionFromIscsiBond ( FixturesTool.ISCSI_BOND_ID , connectionId ) ; connections = dao.getStorageConnectionIdsByIscsiBondId ( FixturesTool.ISCSI_BOND_ID ) ; org.junit.Assert.assertEquals ( 1 , connections.size ( ) ) ; org.junit.Assert.assertFalse ( connections.contains ( connectionId ) ) ; }

Target:
public void testRemoveStorageConnectionFromIscsiBond ( ) { java.util.List < java.lang.String > connections = dao.getStorageConnectionIdsByIscsiBondId ( FixturesTool.ISCSI_BOND_ID ) ; java.lang.String connectionId = connections.get ( 0 ) ; dao.removeStorageConnectionFromIscsiBond ( FixturesTool.ISCSI_BOND_ID , connectionId ) ; connections = dao.getStorageConnectionIdsByIscsiBondId ( FixturesTool.ISCSI_BOND_ID ) ; org.junit.jupiter.api.Assertions.assertEquals ( 1 , connections.size ( ) ) ; org.junit.jupiter.api.Assertions.assertFalse ( connections.contains ( connectionId ) ) ; }
Source:
protected boolean validateGraphicsAndDisplay ( ) { return org.ovirt.engine.core.bll.VmHandler.isGraphicsAndDisplaySupported ( org.ovirt.engine.core.bll.ImportVmCommandBase.getParameters ( ) . getVm ( ) . getOs ( ) , getGraphicsTypesForVm ( ) , org.ovirt.engine.core.bll.ImportVmCommandBase.getParameters ( ) . getVm ( ) . getDefaultDisplayType ( ) , org.ovirt.engine.core.bll.ImportVmCommandBase.getReturnValue ( ) . getCanDoActionMessages ( ) , org.ovirt.engine.core.bll.ImportVmCommandBase.getVdsGroup ( ) . getCompatibilityVersion ( ) ) ; }

Target:
protected boolean validateGraphicsAndDisplay ( ) { return org.ovirt.engine.core.bll.VmHandler.isGraphicsAndDisplaySupported ( org.ovirt.engine.core.bll.ImportVmCommandBase.getParameters ( ) . getVm ( ) . getOs ( ) , getGraphicsTypesForVm ( ) , org.ovirt.engine.core.bll.ImportVmCommandBase.getParameters ( ) . getVm ( ) . getDefaultDisplayType ( ) , org.ovirt.engine.core.bll.ImportVmCommandBase.getReturnValue ( ) . getValidationMessages ( ) , getEffectiveCompatibilityVersion ( ) ) ; }
Source:
private void assertNetworkModified ( org.ovirt.engine.core.bll.SetupNetworksHelper helper , org.ovirt.engine.core.common.businessentities.network expectedNetwork ) { org.junit.Assert.assertEquals ( "Expected a modified network." , 1 , helper.getNetworks ( ) . size ( ) ) ; org.junit.Assert.assertEquals ( java.text.MessageFormat.format ( "Expected network '{0}' to be modified but it wasn't. Modified networks: {1}" , expectedNetwork , helper.getNetworks ( ) ) , expectedNetwork , helper.getNetworks ( ) . get ( 0 ) ) ; }

Target:
private void assertNetworkModified ( org.ovirt.engine.core.bll.SetupNetworksHelper helper , org.ovirt.engine.core.common.businessentities.network expectedNetwork ) { org.junit.Assert.assertEquals ( "Expected a modified network." , 1 , helper.getNetworks ( ) . size ( ) ) ; org.junit.Assert.assertEquals ( java.text.MessageFormat.format ( "Expected network ''{0}'' to be modified but it wasn''t. Modified networks: {1}" , expectedNetwork , helper.getNetworks ( ) ) , expectedNetwork , helper.getNetworks ( ) . get ( 0 ) ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.network.Network getNetwork ( ) { if ( ( ( org.ovirt.engine.core.bll.network.vm.ActivateDeactivateVmNicCommand.getParameters ( ) . getNic ( ) . getVnicProfileId ( ) ) != null ) && ( ( network ) == null ) ) { network = org.ovirt.engine.core.bll.network.cluster.NetworkHelper.getNetworkByVnicProfileId ( org.ovirt.engine.core.bll.network.vm.ActivateDeactivateVmNicCommand.getParameters ( ) . getNic ( ) . getVnicProfileId ( ) ) ; } return network ; }

Target:
public org.ovirt.engine.core.common.businessentities.network.Network getNetwork ( ) { if ( ( ( org.ovirt.engine.core.bll.network.vm.ActivateDeactivateVmNicCommand.getParameters ( ) . getNic ( ) . getVnicProfileId ( ) ) != null ) && ( ( network ) == null ) ) { vnicProfile = org.ovirt.engine.core.bll.network.vm.ActivateDeactivateVmNicCommand.getDbFacade ( ) . getVnicProfileDao ( ) . get ( org.ovirt.engine.core.bll.network.vm.ActivateDeactivateVmNicCommand.getParameters ( ) . getNic ( ) . getVnicProfileId ( ) ) ; network = org.ovirt.engine.core.bll.network.cluster.NetworkHelper.getNetworkByVnicProfile ( vnicProfile ) ; } return network ; }
Source:
private void fillDisksToParameters ( ) { for ( org.ovirt.engine.core.common.businessentities.Disk image : getAdjustedDiskImagesFromConfiguration ( ) ) { diskInfoDestinationMap.put ( image.getId ( ) , ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( image ) ) ) ; } org.ovirt.engine.core.bll.CloneVmCommand.getParameters ( ) . setDiskInfoDestinationMap ( diskInfoDestinationMap ) ; }

Target:
private void fillDisksToParameters ( ) { for ( org.ovirt.engine.core.common.businessentities.storage.Disk image : getAdjustedDiskImagesFromConfiguration ( ) ) { diskInfoDestinationMap.put ( image.getId ( ) , ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( image ) ) ) ; } org.ovirt.engine.core.bll.CloneVmCommand.getParameters ( ) . setDiskInfoDestinationMap ( diskInfoDestinationMap ) ; }