auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void setUpGetEntityExpectations ( ) throws java.lang.Exception { setUpGetEntityExpectations ( VdcQueryType.GetNetworkLabelsByNetworkId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendNetworkLabelsResourceTest.networkId } , getEntityList ( ) ) ; }

Target:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { assertEquals ( "" , query ) ; setUpEntityQueryExpectations ( VdcQueryType.GetNetworkLabelsByNetworkId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendNetworkLabelsResourceTest.NETWORK_ID } , getEntityList ( ) , failure ) ; control.replay ( ) ; }
Source:
public static synchronized java.lang.String formatDate ( java.lang.String pattern , java.util.Date date ) { return routines.system.FastDateParser.getInstance ( pattern ) . format ( date ) ; }

Target:
public static synchronized java.lang.String formatDate ( java.lang.String pattern , java.util.Date date ) { java.text.DateFormat format = routines.system.FastDateParser.getInstance ( pattern ) ; if ( date instanceof routines.system.TalendTimestampWithTZ ) { format.setTimeZone ( ( ( routines.system.TalendTimestampWithTZ ) ( date ) ) . getTimeZone ( ) ) ; } else { format.setTimeZone ( java.util.TimeZone.getDefault ( ) ) ; } return format.format ( date ) ; }
Source:
public static java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > FindAllInterfaceVlanIdIsEmpty ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > items ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ret = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface i : items ) { if ( ( i.getVlanId ( ) ) == null ) { ret.add ( i ) ; } } return ret ; }

Target:
public static java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > findAllInterfaceVlanIdIsEmpty ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > items ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ret = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface i : items ) { if ( ( i.getVlanId ( ) ) == null ) { ret.add ( i ) ; } } return ret ; }
Source:
public void testNeedToProcessHardwareCapsTrue ( ) { org.ovirt.engine.core.common.businessentities.VDS oldVds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; oldVds.setvds_group_id ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; oldVds.setId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; oldVds.setcpu_flags ( "flag1" ) ; org.ovirt.engine.core.common.businessentities.VDS newVds = oldVds.clone ( ) ; newVds.setcpu_flags ( "flag2" ) ; org.junit.Assert.assertTrue ( virtStrategy.processHardwareCapabilitiesNeeded ( oldVds , newVds ) ) ; }

Target:
public void testNeedToProcessHardwareCapsTrue ( ) { org.ovirt.engine.core.common.businessentities.VDS oldVds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; oldVds.setVdsGroupId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; oldVds.setId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; oldVds.setCpuFlags ( "flag1" ) ; org.ovirt.engine.core.common.businessentities.VDS newVds = oldVds.clone ( ) ; newVds.setCpuFlags ( "flag2" ) ; org.junit.Assert.assertTrue ( virtStrategy.processHardwareCapabilitiesNeeded ( oldVds , newVds ) ) ; }
Source:
public static org.ovirt.engine.core.compat.Version getCompatibilityVersion ( org.ovirt.engine.core.common.businessentities.VmBase vmBase ) { return ( vmBase.getClusterId ( ) ) != null ? org.ovirt.engine.core.bll.utils.ClusterUtils.getInstance ( ) . getClusterDao ( ) . get ( vmBase.getClusterId ( ) ) . getCompatibilityVersion ( ) : org.ovirt.engine.core.compat.Version.v3_5 ; }

Target:
public static org.ovirt.engine.core.compat.Version getCompatibilityVersion ( org.ovirt.engine.core.common.businessentities.VmBase vmBase ) { return ( vmBase.getClusterId ( ) ) != null ? org.ovirt.engine.core.bll.utils.ClusterUtils.getInstance ( ) . getClusterDao ( ) . get ( vmBase.getClusterId ( ) ) . getCompatibilityVersion ( ) : Version.ALL.get ( 0 ) ; }
Source:
public void testReadLatency ( ) { java.lang.String doubleValue = "2" ; java.util.Map < java.lang.String , java.lang.Object > diskData = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilderTest.setDiskData ( ) ; diskData.put ( VdsProperties.vm_disk_read_latency , doubleValue ) ; java.util.Map < java.lang.String , java.lang.Object > xml = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilderTest.setMockForTesting ( diskData ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImageDynamic > disks = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.buildVmDiskStatistics ( xml ) ; org.junit.Assert.assertEquals ( new java.lang.Double ( "0.000000002" ) , disks.get ( 0 ) . getReadLatency ( ) ) ; }

Target:
public void testReadLatency ( ) { java.lang.String doubleValue = "2" ; java.util.Map < java.lang.String , java.lang.Object > diskData = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilderTest.setDiskData ( ) ; diskData.put ( VdsProperties.vm_disk_read_latency , doubleValue ) ; java.util.Map < java.lang.String , java.lang.Object > xml = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilderTest.setMockForTesting ( diskData ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImageDynamic > disks = vdsBrokerObjectsBuilder.buildVmDiskStatistics ( xml ) ; org.junit.Assert.assertEquals ( new java.lang.Double ( "0.000000002" ) , disks.get ( 0 ) . getReadLatency ( ) ) ; }
Source:
public void OnCollapseSnapshotsChanged ( org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { this . onCollapseSnapshotsChangedFinish = _asyncQuery ; OnCollapseSnapshotsChanged ( ) ; }

Target:
private java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_domains > getStorageDomainsByIds ( java.util.ArrayList < org.ovirt.engine.core.compat.Guid > getstorage_ids ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_domains > domains = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_domains > ( ) ; for ( org.ovirt.engine.core.compat.Guid storageDomainId : getstorage_ids ) { for ( org.ovirt.engine.core.common.businessentities.storage_domains storageDomain : filteredStorageDomains ) { if ( storageDomainId.equals ( storageDomain.getId ( ) ) ) { domains.add ( storageDomain ) ; break ; } } } return domains ; }
Source:
public org.ovirt.engine.sdk.decorators.VM add ( org.ovirt.engine.sdk.decorators.VM vm ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = ( SLASH ) + ( getName ( ) ) ; java.util.List < org.apache.http.Header > headers = new org.ovirt.engine.sdk.utils.HttpHeaderBuilder ( ) . build ( ) ; url = new org.ovirt.engine.sdk.utils.UrlBuilder ( url ) . build ( ) ; return getProxy ( ) . add ( url , vm , org.ovirt.engine.sdk.entities.VM.class , org.ovirt.engine.sdk.decorators.VM.class , headers ) ; }

Target:
public org.ovirt.engine.sdk.decorators.VM add ( org.ovirt.engine.sdk.decorators.VM vm ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = ( SLASH ) + ( getName ( ) ) ; org.ovirt.engine.sdk.utils.HttpHeaderBuilder headersBuilder = new org.ovirt.engine.sdk.utils.HttpHeaderBuilder ( ) ; java.util.List < org.apache.http.Header > headers = headersBuilder.build ( ) ; org.ovirt.engine.sdk.utils.UrlBuilder urlBuilder = new org.ovirt.engine.sdk.utils.UrlBuilder ( url ) ; url = urlBuilder.build ( ) ; return getProxy ( ) . add ( url , vm , org.ovirt.engine.sdk.entities.VM.class , org.ovirt.engine.sdk.decorators.VM.class , headers ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ExternalDiscoveredHost > hosts = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ExternalDiscoveredHost > ) ( result ) ) ; org.ovirt.engine.ui.uicommonweb.models.ListModel externalDiscoveredHostsListModel = getExternalDiscoveredHosts ( ) ; externalDiscoveredHostsListModel.setItems ( hosts ) ; externalDiscoveredHostsListModel.setIsChangable ( true ) ; }

Target:
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 ) { if ( java.lang.Boolean.TRUE.equals ( getIsDiscoveredHosts ( ) . getEntity ( ) ) ) { discoverHostName_SelectedItemChanged ( ) ; } else if ( java.lang.Boolean.FALSE.equals ( getIsDiscoveredHosts ( ) . getEntity ( ) ) ) { hostName_SelectedItemChanged ( ) ; } }
Source:
public void testIsNetworkInSyncWhenStaticBootProtocolAddressDifferent ( ) throws java.lang.Exception { initIpConfigurationBootProtocolAddress ( org.ovirt.engine.core.utils.NetworkInSyncWithVdsNetworkInterfaceTest.BOOT_PROTOCOL , false ) ; iface.setIpv4BootProtocol ( org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol.forValue ( ( ( ( org.ovirt.engine.core.utils.NetworkInSyncWithVdsNetworkInterfaceTest.BOOT_PROTOCOL.getValue ( ) ) + 1 ) % ( org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol.values ( ) . length ) ) ) ) ; org.junit.Assert.assertThat ( createTestedInstance ( ) . isNetworkInSync ( ) , org.hamcrest.CoreMatchers.is ( false ) ) ; }

Target:
public void testIsNetworkInSyncWhenStaticBootProtocolAddressDifferent ( ) throws java.lang.Exception { initIpConfigurationBootProtocolAddress ( org.ovirt.engine.core.utils.NetworkInSyncWithVdsNetworkInterfaceTest.BOOT_PROTOCOL , false ) ; iface.setIpv4BootProtocol ( org.ovirt.engine.core.common.businessentities.network.Ipv4BootProtocol.forValue ( ( ( ( org.ovirt.engine.core.utils.NetworkInSyncWithVdsNetworkInterfaceTest.BOOT_PROTOCOL.getValue ( ) ) + 1 ) % ( org.ovirt.engine.core.common.businessentities.network.Ipv4BootProtocol.values ( ) . length ) ) ) ) ; org.junit.Assert.assertThat ( createTestedInstance ( ) . isNetworkInSync ( ) , org.hamcrest.CoreMatchers.is ( false ) ) ; }
Source:
protected void OnEntityChanged ( ) { super . OnEntityChanged ( ) ; if ( ( getEntity ( ) ) != null ) { org.ovirt.engine.core.common.businessentities.VM vm = ( ( org.ovirt.engine.core.common.businessentities.VM ) ( getEntity ( ) ) ) ; setItems ( vm.getInterfaces ( ) ) ; } else { setItems ( null ) ; } }

Target:
protected void OnEntityChanged ( ) { if ( ( getEntity ( ) ) != null ) { org.ovirt.engine.core.common.businessentities.VM vm = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.ImportVmData ) ( getEntity ( ) ) ) . getVm ( ) ; setItems ( vm.getInterfaces ( ) ) ; } else { setItems ( null ) ; } }
Source:
public static boolean IsUSBEnabledByDefault ( ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue = org.ovirt.engine.ui.uicommonweb.DataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.EnableUSBAsDefault ) ) ; if ( ( ( returnValue != null ) && ( returnValue.getSucceeded ( ) ) ) && ( ( returnValue.getReturnValue ( ) ) != null ) ) { return ( ( java.lang.Boolean ) ( returnValue.getReturnValue ( ) ) ) ; } return false ; }

Target:
public static boolean IsUSBEnabledByDefault ( ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue = org.ovirt.engine.ui.uicommonweb.DataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.EnableUSBAsDefault , org.ovirt.engine.core.common.config.Config.DefaultConfigurationVersion ) ) ; if ( ( ( returnValue != null ) && ( returnValue.getSucceeded ( ) ) ) && ( ( returnValue.getReturnValue ( ) ) != null ) ) { return ( ( java.lang.Boolean ) ( returnValue.getReturnValue ( ) ) ) ; } return false ; }
Source:
private org.ovirt.engine.core.common.businessentities.network.IpConfiguration createIpConfiguration ( ) { org.ovirt.engine.core.common.businessentities.network.IPv4Address address = new org.ovirt.engine.core.common.businessentities.network.IPv4Address ( ) ; address.setAddress ( org.ovirt.engine.core.vdsbroker.vdsbroker.HostNetworkAttachmentsPersisterTest.IP_ADDRESS ) ; address.setNetmask ( org.ovirt.engine.core.vdsbroker.vdsbroker.HostNetworkAttachmentsPersisterTest.NETMASK ) ; address.setGateway ( org.ovirt.engine.core.vdsbroker.vdsbroker.HostNetworkAttachmentsPersisterTest.GATEWAY ) ; address.setBootProtocol ( NetworkBootProtocol.STATIC_IP ) ; org.ovirt.engine.core.common.businessentities.network.IpConfiguration result = new org.ovirt.engine.core.common.businessentities.network.IpConfiguration ( ) ; result.setIPv4Addresses ( java.util.Collections.singletonList ( address ) ) ; return result ; }

Target:
private org.ovirt.engine.core.common.businessentities.network.IpConfiguration createIpConfiguration ( ) { org.ovirt.engine.core.common.businessentities.network.IpConfiguration result = new org.ovirt.engine.core.common.businessentities.network.IpConfiguration ( ) ; org.ovirt.engine.core.common.businessentities.network.IPv4Address ipv4Address = createIpv4Address ( ) ; org.ovirt.engine.core.common.businessentities.network.IpV6Address ipv6Address = createIpv6Address ( ) ; result.setIPv4Addresses ( java.util.Collections.singletonList ( ipv4Address ) ) ; result.setIpV6Addresses ( java.util.Collections.singletonList ( ipv6Address ) ) ; return result ; }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.Role > getAllForUserAndGroups ( org.ovirt.engine.core.compat.Guid id , java.lang.String groupIds ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "user_id" , id ) . addValue ( "group_ids" , groupIds ) ; return getCallsHandler ( ) . executeReadList ( "GetAllRolesByUserIdAndGroupIds" , RolesRowMapper.instance , parameterSource ) ; }

Target:
public org.ovirt.engine.core.common.businessentities.Role get ( org.ovirt.engine.core.compat.Guid id ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "id" , id ) ; return getCallsHandler ( ) . executeRead ( "GetRolsByid" , org.ovirt.engine.core.dao.RoleDAODbFacadeImpl.RolesRowMapper.instance , parameterSource ) ; }
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 IsTemplateNameUnique ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { 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.Boolean ) ( source ) ) . booleanValue ( ) ) : false ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.IsVmTemlateWithSameNameExist , new org.ovirt.engine.core.common.queries.IsVmTemlateWithSameNameExistParameters ( name ) , aQuery ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { getModel ( ) . getIsSoundcardEnabled ( ) . setEntity ( ( ( java.lang.Boolean ) ( returnValue ) ) ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > rngDevices = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; getModel ( ) . getIsRngEnabled ( ) . setEntity ( ( ! ( rngDevices.isEmpty ( ) ) ) ) ; if ( ! ( rngDevices.isEmpty ( ) ) ) { org.ovirt.engine.core.common.businessentities.VmRngDevice rngDevice = new org.ovirt.engine.core.common.businessentities.VmRngDevice ( rngDevices.get ( 0 ) ) ; getModel ( ) . setRngDevice ( rngDevice ) ; } }
Source:
private boolean hostCompliesWithClusterEmulationMode ( org.ovirt.engine.core.common.businessentities.VDS vds , org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup ) { if ( vdsGroup.isDetectEmulatedMachine ( ) ) { return hostEmulationModeMatchesTheConfigValues ( vds ) ; } else { return ( vds.getSupportedEmulatedMachines ( ) ) != null ? java.util.Arrays.asList ( vds.getSupportedEmulatedMachines ( ) . split ( "," ) ) . contains ( vdsGroup.getEmulatedMachine ( ) ) : false ; } }

Target:
private boolean hostCompliesWithClusterEmulationMode ( org.ovirt.engine.core.common.businessentities.VDS vds , org.ovirt.engine.core.common.businessentities.Cluster cluster ) { if ( cluster.isDetectEmulatedMachine ( ) ) { return hostEmulationModeMatchesTheConfigValues ( vds ) ; } else { return ( vds.getSupportedEmulatedMachines ( ) ) != null ? java.util.Arrays.asList ( vds.getSupportedEmulatedMachines ( ) . split ( "," ) ) . contains ( cluster.getEmulatedMachine ( ) ) : false ; } }
Source:
public void getDataCentersByStorageDomain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { 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.StoragePool > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStoragePoolsByStorageDomainId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }

Target:
public void getGlusterHook ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hookId , boolean includeServerHooks ) { 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.GetGlusterHookById , new org.ovirt.engine.core.common.queries.gluster.GlusterHookQueryParameters ( hookId , includeServerHooks ) , aQuery ) ; }
Source:
public void onFailed ( org.ovirt.engine.core.compat.Guid cmdId , java.util.List < org.ovirt.engine.core.compat.Guid > childCmdIds ) { super . onFailed ( cmdId , childCmdIds ) ; log.error ( "Failed adding a Cinder snapshot. snapshot ID: {}" , getDiskId ( ) ) ; getCommand ( ) . getParameters ( ) . setTaskGroupSuccess ( false ) ; onFinish ( cmdId ) ; }

Target:
public void onFailed ( org.ovirt.engine.core.compat.Guid cmdId , java.util.List < org.ovirt.engine.core.compat.Guid > childCmdIds ) { super . onFailed ( cmdId , childCmdIds ) ; log.error ( "Failed adding a Cinder snapshot. snapshot ID: {}" , getDiskId ( ) ) ; getCommand ( ) . getParameters ( ) . setTaskGroupSuccess ( false ) ; getCommand ( ) . endAction ( ) ; }
Source:
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.setVmtGuid ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; stat.setVmName ( "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.setVmtGuid ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; stat.setName ( "testVm" ) ; stat.setPriority ( 1 ) ; vm.setStaticData ( stat ) ; vm.setDynamicData ( dynamic ) ; return vm ; }
Source:
public static void GetVmsRunningOnOrMigratingToVds ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { 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.VM > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmsRunningOnOrMigratingToVds , new org.ovirt.engine.core.common.queries.GetVmsRunningOnOrMigratingToVdsParameters ( id ) , aQuery ) ; }

Target:
public static 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.RunQuery ( VdcQueryType.GetLunsByVgId , params , aQuery ) ; }
Source:
public void testGetAllAfterDate ( ) throws java.lang.Exception { java.util.Date cutoff = org.ovirt.engine.core.dao.AuditLogDAOTest.EXPECTED_DATE_FORMAT.parse ( "2010-12-20 13:00:00" ) ; java.util.List < org.ovirt.engine.core.common.businessentities.AuditLog > result = dao.getAllAfterDate ( cutoff ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.AuditLogDAOTest.EXISTING_COUNT , result.size ( ) ) ; cutoff = org.ovirt.engine.core.dao.AuditLogDAOTest.EXPECTED_DATE_FORMAT.parse ( "2010-12-20 14:00:00" ) ; result = dao.getAllAfterDate ( cutoff ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( 0 , result.size ( ) ) ; }

Target:
public void testGetAll ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.AuditLog > result = dao.getAll ( ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.AuditLogDAOTest.TOTAL_COUNT , result.size ( ) ) ; }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.dao.DbGroupDAO dao = org.ovirt.engine.core.bll.aaa.AddGroupCommand.getAdGroupDAO ( ) ; org.ovirt.engine.core.common.businessentities.aaa.DbGroup groupToAdd = org.ovirt.engine.core.bll.aaa.AddGroupCommand.getParameters ( ) . getGroupToAdd ( ) ; org.ovirt.engine.core.common.businessentities.aaa.DbGroup dbGroup = dao.getByExternalId ( groupToAdd.getDomain ( ) , groupToAdd.getExternalId ( ) ) ; if ( dbGroup == null ) { dao.save ( groupToAdd ) ; } else { dao.update ( dbGroup ) ; groupToAdd = dbGroup ; } setActionReturnValue ( groupToAdd.getId ( ) ) ; org.ovirt.engine.core.bll.aaa.AddGroupCommand.setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { org.ovirt.engine.core.dao.DbGroupDao dao = org.ovirt.engine.core.bll.aaa.AddGroupCommand.getAdGroupDao ( ) ; org.ovirt.engine.core.common.businessentities.aaa.DbGroup groupToAdd = org.ovirt.engine.core.bll.aaa.AddGroupCommand.getParameters ( ) . getGroupToAdd ( ) ; org.ovirt.engine.core.common.businessentities.aaa.DbGroup dbGroup = dao.getByExternalId ( groupToAdd.getDomain ( ) , groupToAdd.getExternalId ( ) ) ; if ( dbGroup == null ) { dao.save ( groupToAdd ) ; } else { dao.update ( dbGroup ) ; groupToAdd = dbGroup ; } setActionReturnValue ( groupToAdd.getId ( ) ) ; org.ovirt.engine.core.bll.aaa.AddGroupCommand.setSucceeded ( true ) ; }
Source:
private void generateWriterSource ( org.ovirt.api.metamodel.concepts.StructType type ) { org.ovirt.api.metamodel.tool.JavaClassName writerName = javaTypes.getJsonWriterName ( type ) ; javaBuffer.addLine ( "public class %1$s {" , writerName.getSimpleName ( ) ) ; javaBuffer.addLine ( ) ; generateWriteOne ( type ) ; generateWriteMany ( type ) ; javaBuffer.addLine ( "}" ) ; javaBuffer.addLine ( ) ; }

Target:
private void generateEnumReaderSource ( org.ovirt.api.metamodel.concepts.EnumType type ) { org.ovirt.api.metamodel.tool.JavaClassName readerName = javaTypes.getJsonReaderName ( type ) ; javaBuffer.addLine ( "public class %1$s {" , readerName.getSimpleName ( ) ) ; javaBuffer.addLine ( ) ; generateEnumReadOne ( type ) ; generateEnumReadMany ( type ) ; javaBuffer.addLine ( "}" ) ; javaBuffer.addLine ( ) ; }
Source:
private void doTestBadUpdate ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetEntityExpectations ( 0 ) ; setUpGetEntityExpectations ( 0 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateTag , org.ovirt.engine.core.common.action.TagsOperationParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , valid , success ) ) ; try { resource.update ( org.ovirt.engine.api.restapi.resource.BackendTagsResourceTest.getModel ( 0 , false ) ) ; 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 { setUpGetEntityExpectations ( 0 ) ; setUpGetEntityExpectations ( 0 ) ; setUriInfo ( setUpActionExpectations ( ActionType.UpdateTag , org.ovirt.engine.core.common.action.TagsOperationParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , valid , success ) ) ; try { resource.update ( org.ovirt.engine.api.restapi.resource.BackendTagsResourceTest.getModel ( 0 , false ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
public void updateExternalStatus ( org.ovirt.engine.core.compat.Guid id , org.ovirt.engine.core.common.businessentities.ExternalStatus status ) { org.ovirt.engine.core.common.businessentities.VdsDynamic entity = get ( id ) ; entity.setExternalStatus ( status ) ; update ( entity ) ; }

Target:
public void updateStatusAndReasons ( org.ovirt.engine.core.common.businessentities.VdsDynamic host ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getStatusSqlParameterSource ( host.getId ( ) , host.getStatus ( ) ) ; parameterSource.addValue ( "non_operational_reason" , host.getNonOperationalReason ( ) ) . addValue ( "maintenance_reason" , host.getMaintenanceReason ( ) ) ; getCallsHandler ( ) . executeModification ( "UpdateVdsDynamicStatusAndReasons" , parameterSource ) ; }
Source:
public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterClusterService > serviceList = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterClusterService > ) ( source ) ) ; if ( ! ( serviceList.isEmpty ( ) ) ) { return serviceList.get ( 0 ) ; } return null ; } else { return source ; } }

Target:
public T convert ( java.lang.Object source ) { java.lang.Iterable < T > iterable = ( ( java.lang.Iterable < T > ) ( source ) ) ; java.util.Iterator < T > iterator = iterable.iterator ( ) ; while ( iterator.hasNext ( ) ) { return iterator.next ( ) ; } return null ; }
Source:
public java.lang.String call ( ) { com.woorea.openstack.cinder.model.VolumeForCreate cinderVolume = new com.woorea.openstack.cinder.model.VolumeForCreate ( ) ; cinderVolume.setName ( cinderDisk.getDiskAlias ( ) ) ; cinderVolume.setDescription ( cinderDisk.getDiskDescription ( ) ) ; cinderVolume.setSize ( ( ( int ) ( cinderDisk.getSizeInGigabytes ( ) ) ) ) ; cinderVolume.setSourceVolid ( cinderDisk.getId ( ) . toString ( ) ) ; cinderVolume.setSnapshotId ( snapshotId.toString ( ) ) ; return proxy.cloneVolumeFromSnapshot ( cinderVolume ) ; }

Target:
public java.lang.String call ( ) { com.woorea.openstack.cinder.model.VolumeForCreate cinderVolume = new com.woorea.openstack.cinder.model.VolumeForCreate ( ) ; cinderVolume.setName ( cinderDisk.getDiskAlias ( ) ) ; cinderVolume.setDescription ( cinderDisk.getDiskDescription ( ) ) ; cinderVolume.setSize ( ( ( int ) ( cinderDisk.getSizeInGigabytes ( ) ) ) ) ; cinderVolume.setVolumeType ( cinderDisk.getCinderVolumeType ( ) ) ; cinderVolume.setSnapshotId ( snapshotId.toString ( ) ) ; return proxy.cloneVolumeFromSnapshot ( cinderVolume ) ; }
Source:
private void setUpGetVirtioScsiExpectations ( int ... idxs ) throws java.lang.Exception { for ( int i = 0 ; i < ( idxs.length ) ; i ++ ) { setUpGetEntityExpectations ( VdcQueryType.GetVirtioScsiControllers , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ idxs [ i ] ] } , new java.util.ArrayList < > ( ) ) ; } }

Target:
protected void verifyModelOnNewCluster ( org.ovirt.engine.api.model.Vm model , int index ) { assertNotNull ( model.getCluster ( ) . getId ( ) ) ; assertEquals ( GUIDS [ 1 ] . toString ( ) , model.getCluster ( ) . getId ( ) ) ; verifyModel ( model , index ) ; }
Source:
public void canDoActionSucceedsWithForceOption ( ) throws java.lang.Exception { command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.RemoveVdsCommand < org.ovirt.engine.core.common.action.RemoveVdsParameters > ( new org.ovirt.engine.core.common.action.RemoveVdsParameters ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) , true ) ) ) ; prepareMocks ( ) ; mockVdsWithStatus ( VDSStatus.Maintenance ) ; mockVdsDynamic ( ) ; mockVmsPinnedToHost ( java.util.Collections.< java.lang.String > emptyList ( ) ) ; mockIsGlusterEnabled ( true ) ; mockHasVolumeOnServer ( true ) ; runAndAssertCanDoActionSuccess ( ) ; }

Target:
public void canDoActionSucceedsWithForceOption ( ) throws java.lang.Exception { command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.RemoveVdsCommand < org.ovirt.engine.core.common.action.RemoveVdsParameters > ( new org.ovirt.engine.core.common.action.RemoveVdsParameters ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) , true ) ) ) ; prepareMocks ( ) ; mockVdsWithStatus ( VDSStatus.Maintenance ) ; mockVdsDynamic ( ) ; mockVmsPinnedToHost ( java.util.Collections.< java.lang.String > emptyList ( ) ) ; mockIsGlusterEnabled ( true ) ; mockHasVolumeOnServer ( true ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionSuccess ( command ) ; }
Source:
protected void ExecuteVdsBrokerCommand ( ) { _result = org.ovirt.engine.core.vdsbroker.vdsbroker.GetStorageDomainStatsVDSCommand.getBroker ( ) . getStorageDomainStats ( org.ovirt.engine.core.vdsbroker.vdsbroker.GetStorageDomainStatsVDSCommand.getParameters ( ) . getStorageDomainId ( ) . toString ( ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.GetStorageDomainStatsVDSCommand.ProceedProxyReturnValue ( ) ; org.ovirt.engine.core.common.businessentities.StorageDomain domain = org.ovirt.engine.core.vdsbroker.vdsbroker.GetStorageDomainStatsVDSCommand.BuildStorageDynamicFromXmlRpcStruct ( _result.mStorageStats ) ; domain.setId ( org.ovirt.engine.core.vdsbroker.vdsbroker.GetStorageDomainStatsVDSCommand.getParameters ( ) . getStorageDomainId ( ) ) ; setReturnValue ( domain ) ; }

Target:
protected void ExecuteVdsBrokerCommand ( ) { _result = org.ovirt.engine.core.vdsbroker.vdsbroker.GetStorageDomainStatsVDSCommand.getBroker ( ) . getStorageDomainStats ( org.ovirt.engine.core.vdsbroker.vdsbroker.GetStorageDomainStatsVDSCommand.getParameters ( ) . getStorageDomainId ( ) . toString ( ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.GetStorageDomainStatsVDSCommand.proceedProxyReturnValue ( ) ; org.ovirt.engine.core.common.businessentities.StorageDomain domain = org.ovirt.engine.core.vdsbroker.vdsbroker.GetStorageDomainStatsVDSCommand.BuildStorageDynamicFromXmlRpcStruct ( _result.mStorageStats ) ; domain.setId ( org.ovirt.engine.core.vdsbroker.vdsbroker.GetStorageDomainStatsVDSCommand.getParameters ( ) . getStorageDomainId ( ) ) ; setReturnValue ( domain ) ; }
Source:
protected void executeVdsBrokerCommand ( ) { org.ovirt.engine.core.vdsbroker.storage.StorageDomainHelper.checkNumberOfLVsForBlockDomain ( org.ovirt.engine.core.vdsbroker.vdsbroker.CreateVolumeContainerVDSCommand.getParameters ( ) . getStorageDomainId ( ) ) ; setReturnValue ( Guid.Empty ) ; log.info ( "-- executeJobCommand: calling 'createVolumeContainer'" ) ; status = org.ovirt.engine.core.vdsbroker.vdsbroker.CreateVolumeContainerVDSCommand.getBroker ( ) . createVolumeContainer ( org.ovirt.engine.core.vdsbroker.vdsbroker.CreateVolumeContainerVDSCommand.getParameters ( ) . getJobId ( ) . toString ( ) , prepareVolumeInfo ( ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.CreateVolumeContainerVDSCommand.proceedProxyReturnValue ( ) ; setReturnValue ( org.ovirt.engine.core.vdsbroker.vdsbroker.CreateVolumeContainerVDSCommand.getParameters ( ) . getNewImageID ( ) . toString ( ) ) ; }

Target:
protected void executeVdsBrokerCommand ( ) { storageDomainHelper.checkNumberOfLVsForBlockDomain ( org.ovirt.engine.core.vdsbroker.vdsbroker.CreateVolumeContainerVDSCommand.getParameters ( ) . getStorageDomainId ( ) ) ; setReturnValue ( Guid.Empty ) ; log.info ( "-- executeJobCommand: calling 'createVolumeContainer'" ) ; status = org.ovirt.engine.core.vdsbroker.vdsbroker.CreateVolumeContainerVDSCommand.getBroker ( ) . createVolumeContainer ( org.ovirt.engine.core.vdsbroker.vdsbroker.CreateVolumeContainerVDSCommand.getParameters ( ) . getJobId ( ) . toString ( ) , prepareVolumeInfo ( ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.CreateVolumeContainerVDSCommand.proceedProxyReturnValue ( ) ; setReturnValue ( org.ovirt.engine.core.vdsbroker.vdsbroker.CreateVolumeContainerVDSCommand.getParameters ( ) . getNewImageID ( ) . toString ( ) ) ; }
Source:
public void testVmOvfCreation ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.utils.ovf.OvfVmWriterTest.createVM ( ) ; java.lang.String xml = manager.ExportVm ( vm , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ) ; org.junit.Assert.assertNotNull ( xml ) ; final org.ovirt.engine.core.common.businessentities.VM newVm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; manager.ImportVm ( xml , newVm , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ) ; org.ovirt.engine.core.utils.ovf.OvfVmWriterTest.assertVm ( vm , newVm , vm.getDbGeneration ( ) ) ; }

Target:
public void testVmOvfCreation ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.utils.ovf.OvfManagerTest.createVM ( ) ; java.lang.String xml = manager.ExportVm ( vm , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ) ; org.junit.Assert.assertNotNull ( xml ) ; final org.ovirt.engine.core.common.businessentities.VM newVm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; manager.ImportVm ( xml , newVm , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ) ; org.ovirt.engine.core.utils.ovf.OvfManagerTest.assertVm ( vm , newVm , vm.getDbGeneration ( ) ) ; }
Source:
protected void loadPayload ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > disks = vmDeviceDao.getVmDeviceByVmIdAndType ( org.ovirt.engine.core.bll.RunVmOnceCommand.getParameters ( ) . getVmId ( ) , VmDeviceGeneralType.DISK ) ; for ( org.ovirt.engine.core.common.businessentities.VmDevice disk : disks ) { if ( org.ovirt.engine.core.common.businessentities.VmPayload.isPayload ( disk.getSpecParams ( ) ) ) { org.ovirt.engine.core.bll.RunVmOnceCommand.getVm ( ) . setVmPayload ( new org.ovirt.engine.core.common.businessentities.VmPayload ( disk ) ) ; break ; } } }

Target:
protected void loadPayload ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > disks = vmDeviceDao.getVmDeviceByVmIdAndType ( org.ovirt.engine.core.bll.RunVmOnceCommand.getParameters ( ) . getVmId ( ) , VmDeviceGeneralType.DISK ) ; for ( org.ovirt.engine.core.common.businessentities.VmDevice disk : disks ) { if ( org.ovirt.engine.core.common.businessentities.VmPayload.isPayload ( disk.getSpecParams ( ) ) ) { vmPayload = new org.ovirt.engine.core.common.businessentities.VmPayload ( disk ) ; break ; } } }
Source:
private org.ovirt.engine.core.common.action.VdcReturnValueBase addVm ( org.ovirt.engine.core.common.businessentities.VmStatic vmStatic ) { org.ovirt.engine.core.common.action.VmManagementParametersBase parameters = new org.ovirt.engine.core.common.action.VmManagementParametersBase ( vmStatic ) ; parameters.setSessionId ( org.ovirt.engine.core.bll.AddVmAndAttachToPoolCommand.getParameters ( ) . getSessionId ( ) ) ; parameters.setDontCheckTemplateImages ( true ) ; parameters.setDontAttachToDefaultTag ( true ) ; parameters.setDiskInfoDestinationMap ( diskInfoDestinationMap ) ; return org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.AddVm , parameters , org.ovirt.engine.core.bll.job.ExecutionHandler.createDefaultContexForTasks ( org.ovirt.engine.core.bll.AddVmAndAttachToPoolCommand.getExecutionContext ( ) ) ) ; }

Target:
private org.ovirt.engine.core.common.action.VdcReturnValueBase addVm ( org.ovirt.engine.core.common.businessentities.VmStatic vmStatic ) { org.ovirt.engine.core.common.action.VmManagementParametersBase parameters = new org.ovirt.engine.core.common.action.VmManagementParametersBase ( vmStatic ) ; parameters.setSessionId ( org.ovirt.engine.core.bll.AddVmAndAttachToPoolCommand.getParameters ( ) . getSessionId ( ) ) ; parameters.setDontCheckTemplateImages ( true ) ; parameters.setDontAttachToDefaultTag ( true ) ; parameters.setDiskInfoDestinationMap ( diskInfoDestinationMap ) ; parameters.setSoundDeviceEnabled ( org.ovirt.engine.core.bll.AddVmAndAttachToPoolCommand.getParameters ( ) . isSoundDeviceEnabled ( ) ) ; return org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.AddVm , parameters , org.ovirt.engine.core.bll.job.ExecutionHandler.createDefaultContexForTasks ( org.ovirt.engine.core.bll.AddVmAndAttachToPoolCommand.getExecutionContext ( ) ) ) ; }
Source:
public static void getTemplateListByDataCenter ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.TemplateConverter ( ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmTemplatesByStoragePoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }

Target:
public static void getClusterList ( 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.GetAllVdsGroups , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
public void customPropertiesNotSupported ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createManagementNetwork ( ) ; mockExistingNetworks ( network ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNicSyncedWithNetwork ( "eth0" , network ) ; mockExistingIfaces ( iface ) ; iface.setCustomProperties ( createCustomProperties ( ) ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( iface ) ) ; validateAndExpectViolation ( helper , VdcBllMessages.ACTION_TYPE_FAILED_NETWORK_CUSTOM_PROPERTIES_NOT_SUPPORTED , network.getName ( ) ) ; }

Target:
public void customPropertiesBadInput ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createManagementNetwork ( ) ; mockExistingNetworks ( network ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNicSyncedWithNetwork ( "eth0" , network ) ; mockExistingIfaces ( iface ) ; java.util.Map < java.lang.String , java.lang.String > customProperties = new java.util.HashMap < > ( ) ; customProperties.put ( "foo" , "b@r" ) ; iface.setCustomProperties ( customProperties ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( iface ) , Version.v3_5 ) ; validateAndExpectViolation ( helper , EngineMessage.ACTION_TYPE_FAILED_NETWORK_CUSTOM_PROPERTIES_BAD_INPUT , network.getName ( ) ) ; }
Source:
public void labelAppearsOnlyOnceInParamsTwiceInLabels ( ) { org.ovirt.engine.core.common.action.HostSetupNetworksParameters params = setLabelsOnParams ( createSet ( createNicLabel ( "lbl1" ) , createNicLabel ( "lbl1" ) ) , createSet ( "lbl2" ) ) ; asserThatLabelAppearsOnlyOnceInParamsFailed ( createNicLabelValidator ( params ) , new java.util.HashSet < java.lang.String > ( java.util.Arrays.asList ( "lbl1" ) ) ) ; }

Target:
public void labelAppearsOnlyOnceInParamsTwiceInLabels ( ) { org.ovirt.engine.core.common.action.HostSetupNetworksParameters params = setLabelsOnParams ( createSet ( createNicLabel ( "lbl1" ) , createNicLabel ( "lbl1" ) ) , createSet ( "lbl2" ) ) ; asserThatLabelAppearsOnlyOnceInParamsFailed ( createNicLabelValidator ( params ) , new java.util.HashSet < > ( java.util.Collections.singletonList ( "lbl1" ) ) ) ; }
Source:
private void allocateImage ( ) { org.ovirt.engine.core.common.action.AllocateImageGroupVolumeCommandParameters parameters = new org.ovirt.engine.core.common.action.AllocateImageGroupVolumeCommandParameters ( org.ovirt.engine.core.bll.storage.disk.image.CreateVolumeCommand.getParameters ( ) . getStoragePoolId ( ) , org.ovirt.engine.core.bll.storage.disk.image.CreateVolumeCommand.getParameters ( ) . getStorageDomainId ( ) , org.ovirt.engine.core.bll.storage.disk.image.CreateVolumeCommand.getParameters ( ) . getNewImageGroupId ( ) , org.ovirt.engine.core.bll.storage.disk.image.CreateVolumeCommand.getParameters ( ) . getNewImageId ( ) , org.ovirt.engine.core.bll.storage.disk.image.CreateVolumeCommand.getParameters ( ) . getImageSizeInBytes ( ) ) ; parameters.setEndProcedure ( EndProcedure.COMMAND_MANAGED ) ; parameters.setParentCommand ( org.ovirt.engine.core.bll.storage.disk.image.CreateVolumeCommand.getActionType ( ) ) ; parameters.setParentParameters ( org.ovirt.engine.core.bll.storage.disk.image.CreateVolumeCommand.getParameters ( ) ) ; runInternalAction ( VdcActionType.AllocateImageGroupVolume , parameters ) ; }

Target:
private void allocateImage ( ) { org.ovirt.engine.core.common.action.AllocateImageGroupVolumeCommandParameters parameters = new org.ovirt.engine.core.common.action.AllocateImageGroupVolumeCommandParameters ( org.ovirt.engine.core.bll.storage.disk.image.CreateVolumeCommand.getParameters ( ) . getStoragePoolId ( ) , org.ovirt.engine.core.bll.storage.disk.image.CreateVolumeCommand.getParameters ( ) . getStorageDomainId ( ) , org.ovirt.engine.core.bll.storage.disk.image.CreateVolumeCommand.getParameters ( ) . getNewImageGroupId ( ) , org.ovirt.engine.core.bll.storage.disk.image.CreateVolumeCommand.getParameters ( ) . getNewImageId ( ) , org.ovirt.engine.core.bll.storage.disk.image.CreateVolumeCommand.getParameters ( ) . getImageSizeInBytes ( ) ) ; parameters.setEndProcedure ( EndProcedure.COMMAND_MANAGED ) ; parameters.setParentCommand ( org.ovirt.engine.core.bll.storage.disk.image.CreateVolumeCommand.getActionType ( ) ) ; parameters.setParentParameters ( org.ovirt.engine.core.bll.storage.disk.image.CreateVolumeCommand.getParameters ( ) ) ; runInternalAction ( ActionType.AllocateImageGroupVolume , parameters ) ; }
Source:
private void doTestBadAddTag ( boolean valid , boolean success , java.lang.String detail ) { setUriInfo ( setUpActionExpectations ( ActionType.AddTag , org.ovirt.engine.core.common.action.TagsOperationParameters.class , new java.lang.String [ ] { "Tag.TagName" , "Tag.ParentId" } , new java.lang.Object [ ] { NAMES [ 0 ] , org.ovirt.engine.api.restapi.resource.BackendTagsResourceTest.PARENT_GUID } , valid , success ) ) ; try { collection.add ( org.ovirt.engine.api.restapi.resource.BackendTagsResourceTest.getModel ( 0 ) ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
private void doTestBadAddTag ( boolean valid , boolean success , java.lang.String detail ) { setUriInfo ( setUpActionExpectations ( ActionType.AddTag , org.ovirt.engine.core.common.action.TagsOperationParameters.class , new java.lang.String [ ] { "Tag.TagName" , "Tag.ParentId" } , new java.lang.Object [ ] { NAMES [ 0 ] , org.ovirt.engine.api.restapi.resource.BackendTagsResourceTest.PARENT_GUID } , valid , success ) ) ; try { collection.add ( org.ovirt.engine.api.restapi.resource.BackendTagsResourceTest.getModel ( 0 ) ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }