auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private static boolean hasAttribute ( int id , java.sql.Connection conn , org.ovirt.engine.api.extensions.ExtMap attribute , boolean user ) throws java.sql.SQLException { return ( new org.ovirt.engine.extension.aaa.jdbc.core.datasource.Sql.Query ( org.ovirt.engine.extension.aaa.jdbc.Formatter.format ( "SELECT value FROM WHERE = and name = {}" , ( user ? "user_attributes" : "group_attributes" ) , ( user ? "user_id" : "group_id" ) , id , org.ovirt.engine.extension.aaa.jdbc.Formatter.escapeString ( attribute.get ( org.ovirt.engine.extension.aaa.jdbc.core.Schema.SharedKeys.ATTRIBUTE_NAME , java.lang.String.class ) ) ) ) . asString ( conn , "value" ) ) != null ; }

Target:
private static boolean hasAttribute ( int id , java.sql.Connection conn , org.ovirt.engine.api.extensions.ExtMap attribute , boolean user ) throws java.sql.SQLException { return ( new org.ovirt.engine.extension.aaa.jdbc.core.datasource.Sql.Query ( org.ovirt.engine.extension.aaa.jdbc.Formatter.format ( "SELECT value FROM WHERE = and name = {}" , ( user ? "@SCHEMA_NAME@.user_attributes" : "@SCHEMA_NAME@.group_attributes" ) , ( user ? "user_id" : "group_id" ) , id , org.ovirt.engine.extension.aaa.jdbc.Formatter.escapeString ( attribute.get ( org.ovirt.engine.extension.aaa.jdbc.core.Schema.SharedKeys.ATTRIBUTE_NAME , java.lang.String.class ) ) ) ) . asString ( conn , "value" ) ) != null ; }
Source:
public void unsyncedNetworkModified ( ) { org.ovirt.engine.core.common.businessentities.Network net = createNetwork ( "net" ) ; org.ovirt.engine.core.common.businessentities.VdsNetworkInterface nic = createNicSyncedWithNetwork ( "nic0" , net ) ; nic.setBridged ( ( ! ( net.isVmNetwork ( ) ) ) ) ; nic.setBootProtocol ( NetworkBootProtocol.None ) ; mockExistingNetworks ( net ) ; mockExistingIfaces ( nic ) ; nic.setBootProtocol ( NetworkBootProtocol.Dhcp ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( nic ) ) ; validateAndExpectViolation ( helper , VdcBllMessages.NETWORKS_NOT_IN_SYNC , net.getName ( ) ) ; }

Target:
public void unsyncedNetworkModified ( ) { org.ovirt.engine.core.common.businessentities.network.Network net = createNetwork ( "net" ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic = createNicSyncedWithNetwork ( "nic0" , net ) ; nic.setBridged ( ( ! ( net.isVmNetwork ( ) ) ) ) ; nic.setBootProtocol ( NetworkBootProtocol.None ) ; mockExistingNetworks ( net ) ; mockExistingIfaces ( nic ) ; nic.setBootProtocol ( NetworkBootProtocol.Dhcp ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( nic ) ) ; validateAndExpectViolation ( helper , VdcBllMessages.NETWORKS_NOT_IN_SYNC , net.getName ( ) ) ; }
Source:
private void setVdsStatusToPrepareForMaintaice ( org.ovirt.engine.core.common.businessentities.VDS vds ) { if ( ( ( ( vds.getstatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VDSStatus.PreparingForMaintenance ) ) && ( ( vds.getstatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VDSStatus.NonResponsive ) ) ) && ( ( vds.getstatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VDSStatus.Down ) ) ) { runVdsCommand ( VDSCommandType.SetVdsStatus , new org.ovirt.engine.core.common.vdscommands.SetVdsStatusVDSCommandParameters ( vds.getId ( ) , org.ovirt.engine.core.common.businessentities.VDSStatus.PreparingForMaintenance ) ) ; } }

Target:
private void setVdsStatusToPrepareForMaintaice ( org.ovirt.engine.core.common.businessentities.VDS vds ) { if ( ( ( ( vds.getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VDSStatus.PreparingForMaintenance ) ) && ( ( vds.getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VDSStatus.NonResponsive ) ) ) && ( ( vds.getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VDSStatus.Down ) ) ) { runVdsCommand ( VDSCommandType.SetVdsStatus , new org.ovirt.engine.core.common.vdscommands.SetVdsStatusVDSCommandParameters ( vds.getId ( ) , org.ovirt.engine.core.common.businessentities.VDSStatus.PreparingForMaintenance ) ) ; } }
Source:
private void prepareCommand ( ) { parameters = new org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase ( ) ; parameters.setVdsId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.storage.connection.RemoveStorageServerConnectionCommand ( parameters , null ) ) ; org.mockito.Mockito.doReturn ( lunDao ) . when ( command ) . getLunDao ( ) ; org.mockito.Mockito.doReturn ( storageServerConnectionDao ) . when ( command ) . getStorageServerConnectionDao ( ) ; }

Target:
private org.ovirt.engine.core.bll.storage.connection.RemoveStorageServerConnectionCommand < org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase > prepareCommand ( ) { return new org.ovirt.engine.core.bll.storage.connection.RemoveStorageServerConnectionCommand ( parameters , null ) ; }
Source:
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.getInstance ( ) . runQuery ( VdcQueryType.GetSoundDevices , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , 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 < ? > ) ( source ) ) . isEmpty ( ) ) ; } return false ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetSoundDevices , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
private java.util.ArrayList < java.lang.String > trimElements ( java.lang.String ... elements ) { java.util.ArrayList < java.lang.String > list = new java.util.ArrayList < > ( elements.length ) ; for ( java.lang.String e : elements ) { e = e.trim ( ) ; if ( ( e.length ( ) ) > 0 ) { list.add ( e ) ; } } return list ; }

Target:
private java.util.List < java.lang.String > trimElements ( java.lang.String ... elements ) { java.util.List < java.lang.String > list = new java.util.ArrayList < > ( elements.length ) ; for ( java.lang.String e : elements ) { e = e.trim ( ) ; if ( ( e.length ( ) ) > 0 ) { list.add ( e ) ; } } return list ; }
Source:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.Network network ) { validateParameters ( network , "name" ) ; if ( ! ( network.isSetId ( ) ) ) { network.setId ( getNetworkId ( network.getName ( ) , clusterId ) ) ; } org.ovirt.engine.core.common.businessentities.network entity = map ( network ) ; return performCreation ( addAction , getActionParameters ( network , entity ) , new org.ovirt.engine.api.restapi.resource.NetworkIdResolver ( network.getName ( ) ) ) ; }

Target:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.Network network ) { validateParameters ( network , "name" ) ; if ( ! ( network.isSetId ( ) ) ) { network.setId ( getNetworkId ( network.getName ( ) , clusterId ) ) ; } org.ovirt.engine.api.model.Network entity = map ( network ) ; return performCreation ( addAction , getActionParameters ( network , entity ) , new org.ovirt.engine.api.restapi.resource.NetworkIdResolver ( network.getName ( ) ) ) ; }
Source:
private void setUpMockUpForRestart ( ) { prepareMocks ( ) ; org.mockito.Mockito.when ( serviceDao.getByServiceType ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.businessentities.gluster.ServiceType.class ) ) ) . thenReturn ( getGlusterServiceListByServiceType ( ServiceType.GLUSTER_SWIFT , GlusterServiceStatus.RUNNING ) ) ; org.mockito.Mockito.doReturn ( getGlusterServerServicesByServerIdAndServiceType ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , ServiceType.GLUSTER_SWIFT , GlusterServiceStatus.RUNNING ) ) . when ( serverServiceDao ) . getByServerIdAndServiceType ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Guid.class ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.businessentities.gluster.ServiceType.class ) ) ; }

Target:
private void setUpMockUpForRestart ( ) { prepareMocks ( ) ; org.mockito.Mockito.when ( serviceDao.getByServiceType ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( getGlusterServiceListByServiceType ( ServiceType.GLUSTER_SWIFT , GlusterServiceStatus.RUNNING ) ) ; org.mockito.Mockito.doReturn ( getGlusterServerServicesByServerIdAndServiceType ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , ServiceType.GLUSTER_SWIFT , GlusterServiceStatus.RUNNING ) ) . when ( serverServiceDao ) . getByServerIdAndServiceType ( org.mockito.ArgumentMatchers.any ( ) , org.mockito.ArgumentMatchers.any ( ) ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.storage_domains initStorageDomain ( org.ovirt.engine.core.compat.Guid storageDomainId ) { org.ovirt.engine.core.common.businessentities.storage_domains storageDomain = new org.ovirt.engine.core.common.businessentities.storage_domains ( ) ; storageDomain.setId ( storageDomainId ) ; storageDomain.setstorage_pool_id ( storagePoolId ) ; org.mockito.Mockito.when ( storageDomainDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( storageDomain ) ; org.mockito.Mockito.when ( storageDomainDao.getForStoragePool ( storageDomainId , storagePoolId ) ) . thenReturn ( storageDomain ) ; return storageDomain ; }

Target:
private org.ovirt.engine.core.common.businessentities.StorageDomain initStorageDomain ( org.ovirt.engine.core.compat.Guid storageDomainId ) { org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; storageDomain.setId ( storageDomainId ) ; storageDomain.setstorage_pool_id ( storagePoolId ) ; org.mockito.Mockito.when ( storageDomainDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( storageDomain ) ; org.mockito.Mockito.when ( storageDomainDao.getForStoragePool ( storageDomainId , storagePoolId ) ) . thenReturn ( storageDomain ) ; return storageDomain ; }
Source:
protected java.util.Map < java.lang.String , java.lang.String > createClusterPolicyParameters ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster ) { java.util.Map < java.lang.String , java.lang.String > parameters = new java.util.HashMap < > ( ) ; if ( ( cluster.getClusterPolicyProperties ( ) ) != null ) { parameters.putAll ( cluster.getClusterPolicyProperties ( ) ) ; } return parameters ; }

Target:
private java.util.Map < java.lang.String , java.lang.String > createClusterPolicyParameters ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster ) { java.util.Map < java.lang.String , java.lang.String > parameters = new java.util.HashMap < > ( ) ; if ( ( cluster.getClusterPolicyProperties ( ) ) != null ) { parameters.putAll ( cluster.getClusterPolicyProperties ( ) ) ; } return parameters ; }
Source:
private void initEditorsWithIcon ( ) { windowsHostnameEditor = new org.ovirt.engine.ui.common.widget.editor.generic.StringEntityModelTextBoxOnlyEditor ( ) ; org.ovirt.engine.ui.common.widget.label.EnableableFormLabel label = new org.ovirt.engine.ui.common.widget.label.EnableableFormLabel ( ) ; label.setText ( org.ovirt.engine.ui.common.widget.uicommon.popup.vm.VmInitWidget.constants.cloudInitHostnameLabel ( ) ) ; windowsHostnameEditorWithInfo = new org.ovirt.engine.ui.common.widget.EntityModelWidgetWithInfo ( label , windowsHostnameEditor ) ; windowsHostnameEditorWithInfo.setExplanation ( org.ovirt.engine.ui.common.widget.uicommon.popup.vm.VmInitWidget.templates.italicText ( org.ovirt.engine.ui.common.widget.uicommon.popup.vm.VmInitWidget.constants.windowsHostNameInfo ( ) ) ) ; }

Target:
private void initEditorsWithIcon ( ) { windowsHostnameEditor = new org.ovirt.engine.ui.common.widget.editor.generic.StringEntityModelTextBoxOnlyEditor ( ) ; org.ovirt.engine.ui.common.widget.label.EnableableFormLabel label = new org.ovirt.engine.ui.common.widget.label.EnableableFormLabel ( ) ; label.setText ( org.ovirt.engine.ui.common.widget.uicommon.popup.vm.VmInitWidget.constants.cloudInitHostnameLabel ( ) ) ; windowsHostnameEditorWithInfo = new org.ovirt.engine.ui.common.widget.EntityModelWidgetWithInfo ( label , windowsHostnameEditor ) ; windowsHostnameEditorWithInfo.setExplanation ( org.ovirt.engine.ui.common.widget.uicommon.popup.vm.VmInitWidget.constants.windowsHostNameInfo ( ) ) ; }
Source:
protected void toggleGhost ( org.ovirt.engine.ui.uicommonweb.models.profiles.VnicProfileModel value , org.ovirt.engine.ui.webadmin.widget.vnicProfile.VnicProfileWidget widget , boolean becomingGhost ) { widget.publicUseEditor.setEnabled ( ( ( ! becomingGhost ) && ( value.getPublicUse ( ) . getIsChangable ( ) ) ) ) ; widget.networkQoSEditor.setEnabled ( ( ( ! becomingGhost ) && ( value.getNetworkQoS ( ) . getIsChangable ( ) ) ) ) ; }

Target:
protected void toggleGhost ( org.ovirt.engine.ui.uicommonweb.models.profiles.VnicProfileModel value , org.ovirt.engine.ui.webadmin.widget.vnicProfile.VnicProfileWidget widget , boolean becomingGhost ) { super . toggleGhost ( value , widget , becomingGhost ) ; widget.publicUseEditor.setEnabled ( ( ( ! becomingGhost ) && ( value.getPublicUse ( ) . getIsChangable ( ) ) ) ) ; widget.networkQoSEditor.setEnabled ( ( ( ! becomingGhost ) && ( value.getNetworkQoS ( ) . getIsChangable ( ) ) ) ) ; }
Source:
public void edit ( final org.ovirt.engine.ui.uicommonweb.models.profiles.NetworkProfilesModel model ) { super . edit ( model ) ; model.getDcId ( ) . 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 ) { dcId = model.getDcId ( ) . getEntity ( ) ; } } ) ; }

Target:
public void edit ( final org.ovirt.engine.ui.uicommonweb.models.profiles.NetworkProfilesModel model ) { super . edit ( model ) ; model.getDcId ( ) . getEntityChangedEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener < org.ovirt.engine.ui.uicompat.EventArgs > ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { dcId = model.getDcId ( ) . getEntity ( ) ; } } ) ; }
Source:
protected boolean hostToRunExist ( ) { java.util.List < org.ovirt.engine.core.compat.Guid > dedicatedHostsList = org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmStaticData ( ) . getDedicatedVmForVdsList ( ) ; if ( dedicatedHostsList.isEmpty ( ) ) { return true ; } for ( org.ovirt.engine.core.compat.Guid candidateHostGuid : dedicatedHostsList ) { if ( ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsDao ( ) . get ( candidateHostGuid ) ) == null ) { addValidationMessage ( EngineMessage.ACTION_TYPE_FAILED_HOST_NOT_EXIST ) ; return false ; } } return true ; }

Target:
protected boolean hostToRunExist ( ) { java.util.List < org.ovirt.engine.core.compat.Guid > dedicatedHostsList = org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmStaticData ( ) . getDedicatedVmForVdsList ( ) ; if ( dedicatedHostsList.isEmpty ( ) ) { return true ; } for ( org.ovirt.engine.core.compat.Guid candidateHostGuid : dedicatedHostsList ) { if ( ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsDao ( ) . get ( candidateHostGuid ) ) == null ) { addCanDoActionMessage ( EngineMessage.ACTION_TYPE_FAILED_HOST_NOT_EXIST ) ; return false ; } } return true ; }
Source:
public void getUsbPolicyUsbTypeNative ( ) { org.ovirt.engine.api.model.Usb usb = new org.ovirt.engine.api.model.Usb ( ) ; usb.setEnabled ( true ) ; usb.setType ( "native" ) ; org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; assertEquals ( org.ovirt.engine.api.restapi.types.VmMapper.getUsbPolicyOnCreate ( usb , vdsGroup.getCompatibilityVersion ( ) ) , UsbPolicy.ENABLED_NATIVE ) ; }

Target:
public void getUsbPolicyUsbTypeNative ( ) { org.ovirt.engine.api.model.Usb usb = new org.ovirt.engine.api.model.Usb ( ) ; usb.setEnabled ( true ) ; usb.setType ( "native" ) ; assertEquals ( org.ovirt.engine.api.restapi.types.VmMapper.getUsbPolicyOnCreate ( usb ) , UsbPolicy.ENABLED_NATIVE ) ; }
Source:
public void isConnWithSameDetailsExist ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newISCSIConnection = createISCSIConnection ( "1.2.3.4" , StorageType.ISCSI , "iqn.2013-04.myhat.com:aaa-target1" , "3650" , "user1" , "mypassword123" ) ; org.ovirt.engine.core.common.businessentities.StorageServerConnections existingConn = createISCSIConnection ( "1.2.3.4" , StorageType.ISCSI , "iqn.2013-04.myhat.com:aaa-target1" , "3650" , "user1" , "mypassword123" ) ; existingConn.setid ( org.ovirt.engine.core.compat.Guid.newGuid ( ) . toString ( ) ) ; org.mockito.Mockito.when ( command.findConnectionWithSameDetails ( newISCSIConnection ) ) . thenReturn ( existingConn ) ; boolean isExists = command.isConnWithSameDetailsExists ( newISCSIConnection , null ) ; org.junit.Assert.assertTrue ( isExists ) ; }

Target:
public void isConnWithSameDetailsExist ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newISCSIConnection = createISCSIConnection ( "1.2.3.4" , StorageType.ISCSI , "iqn.2013-04.myhat.com:aaa-target1" , "3650" , "user1" , "mypassword123" ) ; org.ovirt.engine.core.common.businessentities.StorageServerConnections existingConn = createISCSIConnection ( "1.2.3.4" , StorageType.ISCSI , "iqn.2013-04.myhat.com:aaa-target1" , "3650" , "user1" , "mypassword123" ) ; existingConn.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) . toString ( ) ) ; org.mockito.Mockito.when ( command.findConnectionWithSameDetails ( newISCSIConnection ) ) . thenReturn ( existingConn ) ; boolean isExists = command.isConnWithSameDetailsExists ( newISCSIConnection , null ) ; org.junit.Assert.assertTrue ( isExists ) ; }
Source:
private org.ovirt.engine.core.vdsbroker.vdsbroker.HostNetworkAttachmentsPersister createHostNetworkAttachmentsPersister ( org.ovirt.engine.core.common.businessentities.VDS host , java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > clusterNetworks , org.ovirt.engine.core.common.vdscommands.UserConfiguredNetworkData userConfiguredData ) { if ( userConfiguredData.isLegacyMode ( ) ) { return new org.ovirt.engine.core.vdsbroker.vdsbroker.HostNetworkAttachmentsPersister ( networkAttachmentDao , host.getId ( ) , host.getInterfaces ( ) , userConfiguredData.getCustomPropertiesForVdsNetworkInterface ( ) , userConfiguredData.getNetworkAttachments ( ) , clusterNetworks ) ; } else { return new org.ovirt.engine.core.vdsbroker.vdsbroker.HostNetworkAttachmentsPersister ( networkAttachmentDao , host.getId ( ) , host.getInterfaces ( ) , userConfiguredData.getNetworkAttachments ( ) , clusterNetworks ) ; } }

Target:
private org.ovirt.engine.core.vdsbroker.vdsbroker.HostNetworkAttachmentsPersister createHostNetworkAttachmentsPersister ( org.ovirt.engine.core.common.businessentities.VDS host , java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > clusterNetworks , org.ovirt.engine.core.common.vdscommands.UserConfiguredNetworkData userConfiguredData ) { return new org.ovirt.engine.core.vdsbroker.vdsbroker.HostNetworkAttachmentsPersister ( networkAttachmentDao , host.getId ( ) , host.getInterfaces ( ) , userConfiguredData.getNetworkAttachments ( ) , clusterNetworks ) ; }
Source:
protected void setUpCommand ( ) { command = createCommand ( ) ; org.mockito.Mockito.doNothing ( ) . when ( command ) . initTemplate ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . areTemplateImagesInStorageReady ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . verifyAddVm ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . setAndValidateDiskProfiles ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . setAndValidateCpuProfile ( ) ; }

Target:
protected void setUpCommand ( ) { org.mockito.Mockito.doNothing ( ) . when ( command ) . initTemplate ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . areTemplateImagesInStorageReady ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . verifyAddVm ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . setAndValidateDiskProfiles ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . setAndValidateCpuProfile ( ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.VM createVm ( int diskSize ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; org.ovirt.engine.core.common.businessentities.VmDynamic dynamic = new org.ovirt.engine.core.common.businessentities.VmDynamic ( ) ; org.ovirt.engine.core.common.businessentities.VmStatic stat = new org.ovirt.engine.core.common.businessentities.VmStatic ( ) ; stat.setvmt_guid ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; stat.setvm_name ( "testVm" ) ; stat.setpriority ( 1 ) ; vm.setStaticData ( stat ) ; vm.setDynamicData ( dynamic ) ; return vm ; }

Target:
private static org.ovirt.engine.core.common.businessentities.VM createVm ( ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; org.ovirt.engine.core.common.businessentities.VmDynamic dynamic = new org.ovirt.engine.core.common.businessentities.VmDynamic ( ) ; org.ovirt.engine.core.common.businessentities.VmStatic stat = new org.ovirt.engine.core.common.businessentities.VmStatic ( ) ; stat.setvmt_guid ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; stat.setvm_name ( "testVm" ) ; stat.setpriority ( 1 ) ; vm.setStaticData ( stat ) ; vm.setDynamicData ( dynamic ) ; return vm ; }
Source:
public void dispose ( ) { org.ovirt.engine.core.vdsbroker.VdsManager.log.info ( "vdsManager::disposing" ) ; org.ovirt.engine.core.utils.timer.SchedulerUtilQuartzImpl.getInstance ( ) . deleteJob ( onTimerJobId ) ; org.ovirt.engine.core.utils.timer.SchedulerUtilQuartzImpl.getInstance ( ) . deleteJob ( vmsMonitoringJobId ) ; if ( org.ovirt.engine.core.vdsbroker.vdsbroker.VdsServerWrapper.class . isInstance ( vdsProxy ) ) { org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcUtils.shutDownConnection ( ( ( org.ovirt.engine.core.vdsbroker.vdsbroker.VdsServerWrapper ) ( vdsProxy ) ) . getHttpClient ( ) ) ; } else { ( ( org.ovirt.engine.core.vdsbroker.jsonrpc.JsonRpcVdsServer ) ( vdsProxy ) ) . close ( ) ; } }

Target:
public void dispose ( ) { org.ovirt.engine.core.vdsbroker.VdsManager.log.info ( "vdsManager::disposing" ) ; org.ovirt.engine.core.utils.timer.SchedulerUtilQuartzImpl.getInstance ( ) . deleteJob ( onTimerJobId ) ; org.ovirt.engine.core.utils.timer.SchedulerUtilQuartzImpl.getInstance ( ) . deleteJob ( vmsMonitoringJobId ) ; vdsProxy.close ( ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = prepareDAO ( dbFacade.getNetworkDao ( ) ) ; cluster = new org.ovirt.engine.core.compat.Guid ( "b399944a-81ab-4ec5-8266-e19ba7c3c9d1" ) ; datacenter = new org.ovirt.engine.core.compat.Guid ( "6d849ebf-755f-4552-ad09-9a090cda105d" ) ; new_net = new org.ovirt.engine.core.common.businessentities.network.Network ( ) ; new_net.setName ( "newnet1" ) ; new_net.setDescription ( "New network" ) ; new_net.setDataCenterId ( datacenter ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getNetworkDao ( ) ; cluster = new org.ovirt.engine.core.compat.Guid ( "b399944a-81ab-4ec5-8266-e19ba7c3c9d1" ) ; datacenter = new org.ovirt.engine.core.compat.Guid ( "6d849ebf-755f-4552-ad09-9a090cda105d" ) ; new_net = new org.ovirt.engine.core.common.businessentities.network.Network ( ) ; new_net.setName ( "newnet1" ) ; new_net.setDescription ( "New network" ) ; new_net.setDataCenterId ( datacenter ) ; }
Source:
public void setUp ( ) { parameters = new org.ovirt.engine.core.common.action.StorageDomainParametersBase ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; parameters.setVdsId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.storage.domain.SyncLunsInfoForBlockStorageDomainCommand ( parameters , null ) ) ; lunFromVg = new org.ovirt.engine.core.common.businessentities.storage.LUNs ( ) ; lunFromDb = new org.ovirt.engine.core.common.businessentities.storage.LUNs ( ) ; }

Target:
public void setUp ( ) { lunFromVg = new org.ovirt.engine.core.common.businessentities.storage.LUNs ( ) ; lunFromDb = new org.ovirt.engine.core.common.businessentities.storage.LUNs ( ) ; }
Source:
public void setEntity ( java.lang.Object value ) { org.ovirt.engine.core.common.businessentities.VDS vds = ( ( org.ovirt.engine.core.common.businessentities.VDS ) ( value ) ) ; updateUpgradeAlert = ( ( ( vds == null ) || ( ( getEntity ( ) ) == null ) ) || ( ! ( vds.getId ( ) . equals ( getEntity ( ) . getId ( ) ) ) ) ) || ( ! ( vds.getstatus ( ) . equals ( getEntity ( ) . getstatus ( ) ) ) ) ; super . setEntity ( value ) ; }

Target:
public void setEntity ( java.lang.Object value ) { org.ovirt.engine.core.common.businessentities.VDS vds = ( ( org.ovirt.engine.core.common.businessentities.VDS ) ( value ) ) ; updateUpgradeAlert = ( ( ( vds == null ) || ( ( getEntity ( ) ) == null ) ) || ( ! ( vds.getId ( ) . equals ( getEntity ( ) . getId ( ) ) ) ) ) || ( ! ( vds.getStatus ( ) . equals ( getEntity ( ) . getStatus ( ) ) ) ) ; super . setEntity ( value ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = prepareDAO ( dbFacade.getVmPoolDao ( ) ) ; existingVmPool = dao.get ( org.ovirt.engine.core.dao.VmPoolDAOTest.EXISTING_VM_POOL_ID ) ; deletableVmPool = dao.get ( org.ovirt.engine.core.dao.VmPoolDAOTest.DELETABLE_VM_POOL_ID ) ; newVmPool = new org.ovirt.engine.core.common.businessentities.vm_pools ( ) ; newVmPool.setvm_pool_name ( "New VM Pool" ) ; newVmPool.setvm_pool_description ( "This is a new VM pool." ) ; newVmPool.setvds_group_id ( org.ovirt.engine.core.dao.VmPoolDAOTest.VDS_GROUP_ID ) ; existingVmPoolMap = dao.getVmPoolMapByVmGuid ( new org.ovirt.engine.core.compat.Guid ( "77296e00-0cad-4e5a-9299-008a7b6f4355" ) ) ; newVmPoolMap = new org.ovirt.engine.core.common.businessentities.VmPoolMap ( org.ovirt.engine.core.dao.VmPoolDAOTest.FREE_VM_ID , existingVmPool.getvm_pool_id ( ) ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getVmPoolDao ( ) ; existingVmPool = dao.get ( org.ovirt.engine.core.dao.VmPoolDAOTest.EXISTING_VM_POOL_ID ) ; deletableVmPool = dao.get ( org.ovirt.engine.core.dao.VmPoolDAOTest.DELETABLE_VM_POOL_ID ) ; newVmPool = new org.ovirt.engine.core.common.businessentities.vm_pools ( ) ; newVmPool.setvm_pool_name ( "New VM Pool" ) ; newVmPool.setvm_pool_description ( "This is a new VM pool." ) ; newVmPool.setvds_group_id ( org.ovirt.engine.core.dao.VmPoolDAOTest.VDS_GROUP_ID ) ; existingVmPoolMap = dao.getVmPoolMapByVmGuid ( new org.ovirt.engine.core.compat.Guid ( "77296e00-0cad-4e5a-9299-008a7b6f4355" ) ) ; newVmPoolMap = new org.ovirt.engine.core.common.businessentities.VmPoolMap ( org.ovirt.engine.core.dao.VmPoolDAOTest.FREE_VM_ID , existingVmPool.getvm_pool_id ( ) ) ; }
Source:
public static org.ovirt.engine.api.model.Vm map ( java.lang.String data , org.ovirt.engine.api.model.ConfigurationType type , org.ovirt.engine.api.model.Vm vm ) { org.ovirt.engine.api.model.Initialization initialization = vm.getInitialization ( ) ; if ( initialization == null ) { initialization = new org.ovirt.engine.api.model.Initialization ( ) ; vm.setInitialization ( initialization ) ; } org.ovirt.engine.api.model.Configuration configuration = initialization.getConfiguration ( ) ; if ( configuration == null ) { configuration = new org.ovirt.engine.api.model.Configuration ( ) ; initialization.setConfiguration ( configuration ) ; } configuration.setData ( data ) ; configuration.setType ( type.value ( ) ) ; return vm ; }

Target:
public static org.ovirt.engine.api.model.Vm map ( java.lang.String data , org.ovirt.engine.api.model.ConfigurationType type , org.ovirt.engine.api.model.Vm vm ) { org.ovirt.engine.api.model.Initialization initialization = vm.getInitialization ( ) ; if ( initialization == null ) { initialization = new org.ovirt.engine.api.model.Initialization ( ) ; vm.setInitialization ( initialization ) ; } org.ovirt.engine.api.model.Configuration configuration = initialization.getConfiguration ( ) ; if ( configuration == null ) { configuration = new org.ovirt.engine.api.model.Configuration ( ) ; initialization.setConfiguration ( configuration ) ; } configuration.setData ( data ) ; configuration.setType ( type ) ; return vm ; }
Source:
private static java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > getClusterByServiceList ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > list , boolean supportsVirtService , boolean supportsGlusterService ) { final java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > filteredList = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster : list ) { if ( ( supportsVirtService && ( cluster.supportsVirtService ( ) ) ) || ( supportsGlusterService && ( cluster.supportsGlusterService ( ) ) ) ) { filteredList.add ( cluster ) ; } } java.util.Collections.sort ( filteredList , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return filteredList ; }

Target:
private java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > getClusterByServiceList ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > list , boolean supportsVirtService , boolean supportsGlusterService ) { final java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > filteredList = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster : list ) { if ( ( supportsVirtService && ( cluster.supportsVirtService ( ) ) ) || ( supportsGlusterService && ( cluster.supportsGlusterService ( ) ) ) ) { filteredList.add ( cluster ) ; } } java.util.Collections.sort ( filteredList , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return filteredList ; }
Source:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.Tag tag ) { validateParameters ( tag , "name" ) ; if ( isSetParentName ( tag ) ) { tag.getParent ( ) . getTag ( ) . setId ( getParentId ( tag ) ) ; } return performCreate ( VdcActionType.AddTag , new org.ovirt.engine.core.common.action.TagsOperationParameters ( map ( tag ) ) , new org.ovirt.engine.api.restapi.resource.BackendTagsResource.TagNameResolver ( tag.getName ( ) ) ) ; }

Target:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.Tag tag ) { validateParameters ( tag , "name" ) ; if ( isSetParentName ( tag ) ) { tag.getParent ( ) . setId ( getParentId ( tag ) ) ; } return performCreate ( VdcActionType.AddTag , new org.ovirt.engine.core.common.action.TagsOperationParameters ( map ( tag ) ) , new org.ovirt.engine.api.restapi.resource.BackendTagsResource.TagNameResolver ( tag.getName ( ) ) ) ; }
Source:
public void testStart ( ) throws java.lang.Exception { setUpWindowsGetEntityExpectations ( 2 , false ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RunVmOnce , org.ovirt.engine.core.common.action.RunVmOnceParams.class , new java.lang.String [ ] { "VmId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } ) ) ; javax.ws.rs.core.Response response = resource.start ( new org.ovirt.engine.api.model.Action ( ) ) ; verifyActionResponse ( response ) ; verifyActionModel ( ( ( org.ovirt.engine.api.model.Action ) ( response.getEntity ( ) ) ) . getVm ( ) , 0 ) ; }

Target:
public void testStart ( ) throws java.lang.Exception { setUpWindowsGetEntityExpectations ( 1 , false ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RunVmOnce , org.ovirt.engine.core.common.action.RunVmOnceParams.class , new java.lang.String [ ] { "VmId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } ) ) ; javax.ws.rs.core.Response response = resource.start ( new org.ovirt.engine.api.model.Action ( ) ) ; verifyActionResponse ( response ) ; verifyActionModel ( ( ( org.ovirt.engine.api.model.Action ) ( response.getEntity ( ) ) ) . getVm ( ) , 0 ) ; }
Source:
public java.lang.Object runInTransaction ( ) { getCompensationContext ( ) . snapshotEntityStatus ( getVm ( ) . getDynamicData ( ) ) ; getVm ( ) . setStatus ( VMStatus.PreparingForHibernate ) ; runVdsCommand ( VDSCommandType.UpdateVmDynamicData , new org.ovirt.engine.core.common.vdscommands.UpdateVmDynamicDataVDSCommandParameters ( getVdsId ( ) , getVm ( ) . getDynamicData ( ) ) ) ; getCompensationContext ( ) . stateChanged ( ) ; return null ; }

Target:
public java.lang.Object runInTransaction ( ) { getCompensationContext ( ) . snapshotEntityStatus ( getVm ( ) . getDynamicData ( ) ) ; getVm ( ) . setStatus ( VMStatus.PreparingForHibernate ) ; runVdsCommand ( VDSCommandType.UpdateVmDynamicData , new org.ovirt.engine.core.common.vdscommands.UpdateVmDynamicDataVDSCommandParameters ( getVm ( ) . getDynamicData ( ) ) ) ; getCompensationContext ( ) . stateChanged ( ) ; return null ; }
Source:
private boolean devicePluggable ( org.ovirt.engine.core.common.businessentities.VmDevice device ) { return ( ( VmDeviceType.DISK.getName ( ) . equals ( device.getDevice ( ) ) ) && ( VmDeviceType.DISK.getName ( ) . equals ( device ) ) ) || ( ( VmDeviceType.BRIDGE.getName ( ) . equals ( device.getDevice ( ) ) ) && ( VmDeviceType.INTERFACE.getName ( ) . equals ( device.getType ( ) ) ) ) ; }

Target:
private boolean devicePluggable ( org.ovirt.engine.core.common.businessentities.VmDevice device ) { return ( ( VmDeviceType.DISK.getName ( ) . equals ( device.getDevice ( ) ) ) && ( VmDeviceType.DISK.getName ( ) . equals ( device.getType ( ) ) ) ) || ( ( VmDeviceType.BRIDGE.getName ( ) . equals ( device.getDevice ( ) ) ) && ( VmDeviceType.INTERFACE.getName ( ) . equals ( device.getType ( ) ) ) ) ; }
Source:
public void dataCenterWithClusterSelectedItemChanged ( ) { super . dataCenterWithClusterSelectedItemChanged ( ) ; java.util.ArrayList < org.ovirt.engine.core.common.queries.VdcQueryType > queryTypeList = new java.util.ArrayList < org.ovirt.engine.core.common.queries.VdcQueryType > ( ) ; queryTypeList.add ( VdcQueryType.GetVmTemplatesWithPermittedAction ) ; org.ovirt.engine.core.common.queries.GetEntitiesWithPermittedActionParameters getEntitiesWithPermittedActionParameters = new org.ovirt.engine.core.common.queries.GetEntitiesWithPermittedActionParameters ( ) ; getEntitiesWithPermittedActionParameters.setActionGroup ( actionGroup ) ; java.util.ArrayList < org.ovirt.engine.core.common.queries.VdcQueryParametersBase > parametersList = new java.util.ArrayList < org.ovirt.engine.core.common.queries.VdcQueryParametersBase > ( java.util.Arrays.asList ( new org.ovirt.engine.core.common.queries.VdcQueryParametersBase [ ] { getEntitiesWithPermittedActionParameters } ) ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runMultipleQueries ( queryTypeList , parametersList , this , getModel ( ) ) ; }

Target:
public void dataCenterWithClusterSelectedItemChanged ( ) { super . dataCenterWithClusterSelectedItemChanged ( ) ; java.util.ArrayList < org.ovirt.engine.core.common.queries.VdcQueryType > queryTypeList = new java.util.ArrayList < > ( ) ; queryTypeList.add ( VdcQueryType.GetVmTemplatesWithPermittedAction ) ; org.ovirt.engine.core.common.queries.GetEntitiesWithPermittedActionParameters getEntitiesWithPermittedActionParameters = new org.ovirt.engine.core.common.queries.GetEntitiesWithPermittedActionParameters ( ) ; getEntitiesWithPermittedActionParameters.setActionGroup ( actionGroup ) ; java.util.ArrayList < org.ovirt.engine.core.common.queries.VdcQueryParametersBase > parametersList = new java.util.ArrayList ( java.util.Arrays.asList ( new org.ovirt.engine.core.common.queries.VdcQueryParametersBase [ ] { getEntitiesWithPermittedActionParameters } ) ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runMultipleQueries ( queryTypeList , parametersList , this , getModel ( ) ) ; }
Source:
private void initParentResource ( ) { org.ovirt.engine.api.restapi.resource.AbstractBackendResource parent = collection.getParent ( ) . getParent ( ) ; parent.setBackend ( backend ) ; parent.setMappingLocator ( mapperLocator ) ; parent.setValidatorLocator ( validatorLocator ) ; parent.setMessageBundle ( messageBundle ) ; parent.setHttpHeaders ( httpHeaders ) ; }

Target:
private void initParentResource ( ) { org.ovirt.engine.api.restapi.resource.AbstractBackendResource parent = collection.getParent ( ) . getParent ( ) ; parent.setBackend ( backend ) ; parent.setMappingLocator ( mapperLocator ) ; parent.setMessageBundle ( messageBundle ) ; parent.setHttpHeaders ( httpHeaders ) ; }
Source:
public void init ( java.util.List < org.ovirt.engine.core.common.businessentities.VM > externalVms , final org.ovirt.engine.core.compat.Guid dataCenterId ) { setCloseCommand ( new org.ovirt.engine.ui.uicommonweb.UICommand ( null , this ) . setTitle ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . close ( ) ) . setIsDefault ( true ) . setIsCancel ( true ) ) ; setTargetArchitecture ( externalVms ) ; super . setItems ( new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { doInit ( dataCenterId ) ; } } , externalVms ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { setItems ( new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { doInit ( ) ; } } , externalVms ) ; }
Source:
public static void getExistingStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hostId , org.ovirt.engine.core.common.businessentities.StorageDomainType domainType , org.ovirt.engine.core.common.businessentities.StorageType storageType , java.lang.String path ) { 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.StorageDomain > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetExistingStorageDomainList , new org.ovirt.engine.core.common.queries.GetExistingStorageDomainListParameters ( hostId , storageType , domainType , path ) , aQuery ) ; }

Target:
public static void getExistingStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hostId , org.ovirt.engine.core.common.businessentities.StorageDomainType domainType , org.ovirt.engine.core.common.businessentities.StorageType storageType , java.lang.String path ) { 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.StorageDomain > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetExistingStorageDomainList , new org.ovirt.engine.core.common.queries.GetExistingStorageDomainListParameters ( hostId , storageType , domainType , path ) , aQuery ) ; }
Source:
protected void runAddAndVerify ( org.ovirt.engine.core.common.businessentities.VmNetworkInterface iface , boolean addMacResult , org.mockito.verification.VerificationMode addMacVerification , boolean expectedResult ) { org.mockito.Mockito.when ( macPoolManager.AddMac ( iface.getMacAddress ( ) ) ) . thenReturn ( addMacResult ) ; org.junit.Assert.assertEquals ( expectedResult , vmInterfaceManager.add ( iface , org.ovirt.engine.core.bll.context.NoOpCompensationContext.getInstance ( ) ) ) ; verifyAddDelegatedCorrectly ( iface , addMacVerification ) ; }

Target:
protected void runAddAndVerify ( org.ovirt.engine.core.common.businessentities.VmNetworkInterface iface , boolean addMacResult , org.mockito.verification.VerificationMode addMacVerification , boolean expectedResult ) { org.mockito.Mockito.when ( macPoolManager.AddMac ( iface.getMacAddress ( ) ) ) . thenReturn ( addMacResult ) ; org.junit.Assert.assertEquals ( expectedResult , vmInterfaceManager.add ( iface , org.ovirt.engine.core.bll.context.NoOpCompensationContext.getInstance ( ) , false ) ) ; verifyAddDelegatedCorrectly ( iface , addMacVerification ) ; }
Source:
public void init ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > disksImages ) { setDiskImages ( disksImages ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDiskList ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.templates.CopyDiskModel copyDiskModel = ( ( org.ovirt.engine.ui.uicommonweb.models.templates.CopyDiskModel ) ( target ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > disks = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ) ( returnValue ) ) ; copyDiskModel.onInitAllDisks ( disks ) ; copyDiskModel.onInitDisks ( ) ; } } ) ) ; }

Target:
public void init ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > disksImages ) { setDiskImages ( disksImages ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getDiskList ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.templates.CopyDiskModel copyDiskModel = ( ( org.ovirt.engine.ui.uicommonweb.models.templates.CopyDiskModel ) ( target ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > disks = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ) ( returnValue ) ) ; copyDiskModel.onInitAllDisks ( disks ) ; copyDiskModel.onInitDisks ( ) ; } } ) ) ; }
Source:
private void localize ( org.ovirt.engine.ui.webadmin.ApplicationConstants constants , org.ovirt.engine.ui.webadmin.ApplicationMessages messages ) { bricks.setLabel ( constants.selectBrickToViewFopStats ( ) ) ; nfsServers.setLabel ( constants.selectServerToViewFopStats ( ) ) ; bricksTab.setLabel ( constants.volumeProfileBricksTab ( ) ) ; nfsTab.setLabel ( constants.volumeProfileNfsTab ( ) ) ; bricksErrorLabel.setText ( constants.brickProfileErrorMessage ( ) ) ; nfsErrorLabel.setText ( constants.nfsProfileErrorMessage ( ) ) ; }

Target:
private void localize ( ) { bricks.setLabel ( constants.selectBrickToViewFopStats ( ) ) ; nfsServers.setLabel ( constants.selectServerToViewFopStats ( ) ) ; bricksTab.setLabel ( constants.volumeProfileBricksTab ( ) ) ; nfsTab.setLabel ( constants.volumeProfileNfsTab ( ) ) ; bricksErrorLabel.setText ( constants.brickProfileErrorMessage ( ) ) ; nfsErrorLabel.setText ( constants.nfsProfileErrorMessage ( ) ) ; }
Source:
public void testUpdateCantDo ( ) throws java.lang.Exception { setUpGetEntityWithNoCertificateInfoExpectations ( 1 ) ; resource.setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateVds , org.ovirt.engine.core.common.action.hostdeploy.UpdateVdsActionParameters.class , new java.lang.String [ ] { "RootPassword" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendHostsResourceTest.ROOT_PASSWORD } , false , true , "ACTION_TYPE_FAILED_IMPORT_DISKS_ALREADY_EXIST" ) ) ; try { resource.update ( org.ovirt.engine.api.restapi.resource.BackendHostsResourceTest.getModel ( 0 ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , "ACTION_TYPE_FAILED_IMPORT_DISKS_ALREADY_EXIST" , 409 ) ; } }

Target:
public void testUpdateCantDo ( ) throws java.lang.Exception { setUpGetEntityWithNoCertificateInfoExpectations ( ) ; resource.setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateVds , org.ovirt.engine.core.common.action.hostdeploy.UpdateVdsActionParameters.class , new java.lang.String [ ] { "RootPassword" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendHostsResourceTest.ROOT_PASSWORD } , false , true , "ACTION_TYPE_FAILED_IMPORT_DISKS_ALREADY_EXIST" ) ) ; try { resource.update ( org.ovirt.engine.api.restapi.resource.BackendHostsResourceTest.getModel ( 0 ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , "ACTION_TYPE_FAILED_IMPORT_DISKS_ALREADY_EXIST" , 409 ) ; } }
Source:
private boolean isTunnelMigrationUsed ( ) { if ( ! ( org.ovirt.engine.core.common.FeatureSupported.tunnelMigration ( org.ovirt.engine.core.bll.MigrateVmCommand.getVm ( ) . getCompatibilityVersion ( ) ) ) ) { return false ; } return ( org.ovirt.engine.core.bll.MigrateVmCommand.getVm ( ) . getTunnelMigration ( ) ) != null ? org.ovirt.engine.core.bll.MigrateVmCommand.getVm ( ) . getTunnelMigration ( ) : org.ovirt.engine.core.bll.MigrateVmCommand.getCluster ( ) . isTunnelMigration ( ) ; }

Target:
private boolean isTunnelMigrationUsed ( ) { return ( org.ovirt.engine.core.bll.MigrateVmCommand.getVm ( ) . getTunnelMigration ( ) ) != null ? org.ovirt.engine.core.bll.MigrateVmCommand.getVm ( ) . getTunnelMigration ( ) : org.ovirt.engine.core.bll.MigrateVmCommand.getCluster ( ) . isTunnelMigration ( ) ; }
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 ) ) ; org.ovirt.engine.core.common.businessentities.VmTemplate template = ( ( org.ovirt.engine.core.common.businessentities.VmTemplate ) ( returnValue ) ) ; model.getTemplate ( ) . setItems ( new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmTemplate > ( java.util.Arrays.asList ( new org.ovirt.engine.core.common.businessentities.VmTemplate [ ] { template } ) ) ) ; model.getTemplate ( ) . setSelectedItem ( template ) ; model.getTemplate ( ) . setIsChangable ( false ) ; }

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 ) ) ; org.ovirt.engine.core.common.businessentities.VmTemplate template = ( ( org.ovirt.engine.core.common.businessentities.VmTemplate ) ( returnValue ) ) ; model.getTemplate ( ) . setItems ( new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmTemplate > ( java.util.Arrays.asList ( new org.ovirt.engine.core.common.businessentities.VmTemplate [ ] { template } ) ) ) ; model.getTemplate ( ) . setSelectedItem ( template ) ; model.getTemplate ( ) . setIsChangable ( false ) ; }