auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void bondWithNoSlaves ( ) { org.ovirt.engine.core.common.businessentities.VdsNetworkInterface bond = createBond ( null ) ; mockExistingIfaces ( bond ) ; org.ovirt.engine.core.bll.SetupNetworksHelper helper = createHelper ( createParametersForBond ( bond , java.util.Collections.< org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > emptyList ( ) ) ) ; validateAndExpectViolation ( helper , VdcBllMessages.NETWORK_BOND_PARAMETERS_INVALID ) ; }

Target:
public void onlyOneSlaveForBonding ( ) { org.ovirt.engine.core.common.businessentities.VdsNetworkInterface bond = createBond ( org.ovirt.engine.core.bll.SetupNetworksHelperTest.BOND_NAME , null ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > slaves = java.util.Arrays.asList ( createNic ( "nic0" , null ) ) ; mockExistingIfacesWithBond ( bond , slaves ) ; org.ovirt.engine.core.bll.SetupNetworksHelper helper = createHelper ( createParametersForBond ( bond , slaves ) ) ; validateAndExpectViolation ( helper , VdcBllMessages.NETWORK_BOND_PARAMETERS_INVALID ) ; }
Source:
public org.ovirt.engine.core.bll.tasks.interfaces.CommandCallback getCallback ( ) { return org.ovirt.engine.core.bll.RemoveSnapshotCommand.getVm ( ) . isQualifiedForLiveSnapshotMerge ( ) ? new org.ovirt.engine.core.bll.RemoveSnapshotCommandCallback ( ) : null ; }

Target:
public org.ovirt.engine.core.bll.tasks.interfaces.CommandCallback getCallback ( ) { if ( org.ovirt.engine.core.bll.RemoveSnapshotCommand.getVm ( ) . isQualifiedForLiveSnapshotMerge ( ) ) { return new org.ovirt.engine.core.bll.RemoveSnapshotCommandCallback ( ) ; } else if ( org.ovirt.engine.core.bll.RemoveSnapshotCommand.getParameters ( ) . isUseCinderCommandCallback ( ) ) { return new org.ovirt.engine.core.bll.ConcurrentChildCommandsExecutionCallback ( ) ; } return null ; }
Source:
private void MigrationMode_EntityChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( ( org.ovirt.engine.core.common.businessentities.MigrationSupport.PINNED_TO_HOST ) == ( getMigrationMode ( ) . getSelectedItem ( ) ) ) { getHostCpu ( ) . setIsChangable ( true ) ; } else { getHostCpu ( ) . setEntity ( false ) ; getHostCpu ( ) . setIsChangable ( false ) ; } behavior.updateCpuPinningVisibility ( ) ; }

Target:
private void initVncKeyboardLayout ( ) { final java.util.List < java.lang.String > layouts = ( ( java.util.List < java.lang.String > ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigValuePreConverted ( ConfigurationValues.VncKeyboardLayoutValidValues ) ) ) ; final java.util.ArrayList < java.lang.String > vncKeyboardLayoutItems = new java.util.ArrayList < java.lang.String > ( ) ; vncKeyboardLayoutItems.add ( null ) ; vncKeyboardLayoutItems.addAll ( layouts ) ; getVncKeyboardLayout ( ) . setItems ( vncKeyboardLayoutItems ) ; getVncKeyboardLayout ( ) . setIsAvailable ( isVncSelected ( ) ) ; }
Source:
public void testNoIsoDomain ( ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; org.ovirt.engine.core.bll.validator.RunVmValidatorTest.validateResult ( runVmValidator.validateBootSequence ( vm , BootSequence.CD , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( ) ) , false , VdcBllMessages.VM_CANNOT_RUN_FROM_CD_WITHOUT_ACTIVE_STORAGE_DOMAIN_ISO ) ; }

Target:
public void canRunVmNotResponding ( ) { final org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setStatus ( VMStatus.NotResponding ) ; org.mockito.Mockito.doReturn ( false ) . when ( runVmValidator ) . isVmDuringInitiating ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.VM.class ) ) ; org.ovirt.engine.core.bll.validator.RunVmValidatorTest.validateResult ( runVmValidator.vmDuringInitialization ( vm ) , false , VdcBllMessages.ACTION_TYPE_FAILED_VM_IS_RUNNING ) ; }
Source:
public void getLocalStorageHost ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String dataCenterName ) { 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 ) { for ( org.ovirt.engine.core.common.businessentities.IVdcQueryable item : ( ( java.util.List < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) { return item ; } } return null ; } } ; org.ovirt.engine.core.common.queries.SearchParameters sp = new org.ovirt.engine.core.common.queries.SearchParameters ( ( "hosts: datacenter=" + dataCenterName ) , org.ovirt.engine.core.common.interfaces.SearchType.VDS ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , sp , aQuery ) ; }

Target:
public void getAllProviders ( org.ovirt.engine.ui.frontend.AsyncQuery < java.util.List < org.ovirt.engine.core.common.businessentities.Provider < ? > > > aQuery , boolean doRefresh ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.SortListByNameConverter < > ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllProviders , ( doRefresh ? new org.ovirt.engine.core.common.queries.GetAllProvidersParameters ( ) : new org.ovirt.engine.core.common.queries.GetAllProvidersParameters ( ) . withoutRefresh ( ) ) , aQuery ) ; }
Source:
public void calculateNetworkImplementationDetailsNetworkOutOfSyncWithMtuUnset ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNetworkDevice ( ) ; calculateNetworkImplementationDetailsAndAssertSync ( iface , false , iface.getNetworkName ( ) , ( ! ( iface.isBridged ( ) ) ) , 0 , org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextInt ( ) , null ) ; }

Target:
public void calculateNetworkImplementationDetailsNetworkOutOfSyncWithMtuUnset ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNetworkDevice ( ) ; calculateNetworkImplementationDetailsAndAssertSync ( iface , false , iface.getNetworkName ( ) , ( ! ( iface.isBridged ( ) ) ) , 0 , org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextInt ( ) , createQos ( ) ) ; }
Source:
public void getVdsSwallowsException ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.TestAuditLogableBase ( ) ; final org.ovirt.engine.core.common.businessentities.VDS vds = null ; final org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setrun_on_vds ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID2 ) ; final org.ovirt.engine.core.compat.Guid vdsId = org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID3 ; b.setVds ( vds ) ; b.setVdsId ( vdsId ) ; b.setVm ( vm ) ; final org.ovirt.engine.core.common.businessentities.VDS v = b.getVds ( ) ; org.junit.Assert.assertNull ( v ) ; }

Target:
public void getVdsSwallowsException ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.TestAuditLogableBase ( ) ; final org.ovirt.engine.core.common.businessentities.VDS vds = null ; final org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setRunOnVds ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID2 ) ; final org.ovirt.engine.core.compat.Guid vdsId = org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID3 ; b.setVds ( vds ) ; b.setVdsId ( vdsId ) ; b.setVm ( vm ) ; final org.ovirt.engine.core.common.businessentities.VDS v = b.getVds ( ) ; org.junit.Assert.assertNull ( v ) ; }
Source:
public void invalidQosInconsistentValues ( ) { org.ovirt.engine.core.common.businessentities.network.HostNetworkQos qos = new org.ovirt.engine.core.common.businessentities.network.HostNetworkQos ( ) ; qos.setOutAverageLinkshare ( 10 ) ; qos.setOutAverageUpperlimit ( org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.LOW_BANDWIDTH ) ; qos.setOutAverageRealtime ( org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.HIGH_BANDWIDTH ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = qosValuesTest ( qos ) ; validateAndExpectViolation ( helper , VdcBllMessages.ACTION_TYPE_FAILED_HOST_NETWORK_QOS_SETUP_NETWORKS_INCONSISTENT_VALUES , org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.MANAGEMENT_NETWORK_NAME ) ; }

Target:
public void invalidQosInconsistentValues ( ) { org.ovirt.engine.core.common.businessentities.network.HostNetworkQos qos = new org.ovirt.engine.core.common.businessentities.network.HostNetworkQos ( ) ; qos.setOutAverageLinkshare ( 10 ) ; qos.setOutAverageUpperlimit ( org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.LOW_BANDWIDTH ) ; qos.setOutAverageRealtime ( org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.HIGH_BANDWIDTH ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = qosValuesTest ( qos ) ; validateAndExpectViolation ( helper , EngineMessage.ACTION_TYPE_FAILED_HOST_NETWORK_QOS_SETUP_NETWORKS_INCONSISTENT_VALUES , org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.MANAGEMENT_NETWORK_NAME ) ; }
Source:
public void testAdd ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpVolumeCreationExpectations ( false ) ; collection.setParent ( org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterVolumesResourceTest.parentMock ) ; javax.ws.rs.core.Response response = collection.add ( createModel ( ) ) ; org.junit.Assert.assertEquals ( 201 , response.getStatus ( ) ) ; org.junit.Assert.assertTrue ( ( ( response.getEntity ( ) ) instanceof org.ovirt.engine.api.model.GlusterVolume ) ) ; verifyModel ( ( ( org.ovirt.engine.api.model.GlusterVolume ) ( response.getEntity ( ) ) ) , 1 ) ; }

Target:
public void testAdd ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpVolumeCreationExpectations ( false ) ; collection.setParent ( org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterVolumesResourceTest.parentMock ) ; javax.ws.rs.core.Response response = collection.add ( createModel ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( 201 , response.getStatus ( ) ) ; org.junit.jupiter.api.Assertions.assertTrue ( ( ( response.getEntity ( ) ) instanceof org.ovirt.engine.api.model.GlusterVolume ) ) ; verifyModel ( ( ( org.ovirt.engine.api.model.GlusterVolume ) ( response.getEntity ( ) ) ) , 1 ) ; }
Source:
private void createDefaultFileStats ( java.lang.Object [ ] fileNames ) { for ( int i = 0 ; i < ( fileNames.length ) ; i ++ ) { fileStats.put ( ( ( java.lang.String ) ( fileNames [ i ] ) ) , java.util.Collections.emptyMap ( ) ) ; } }

Target:
private void createDefaultFileStats ( java.lang.Object [ ] fileNames ) { for ( java.lang.Object fileName : fileNames ) { fileStats.put ( ( ( java.lang.String ) ( fileName ) ) , java.util.Collections.emptyMap ( ) ) ; } }
Source:
public void run ( ) { try { java.lang.String encrypted = org.ovirt.engine.core.utils.crypt.EngineEncryptionUtils.encrypt ( plain ) ; java.lang.String actualDecrypted = org.ovirt.engine.core.utils.crypt.EngineEncryptionUtils.decrypt ( encrypted ) ; if ( ! ( plain.equals ( actualDecrypted ) ) ) { java.lang.String failure = java.lang.String.format ( "Failure in test %d, plain is %s%n" , threadCount , actualDecrypted ) ; failures.append ( failure ) ; failed.set ( true ) ; } } catch ( java.lang.Exception e ) { throw new java.lang.RuntimeException ( e ) ; } }

Target:
public void testEncryptThreads ( ) throws java.lang.Exception { java.util.List < java.lang.Thread > l = new java.util.LinkedList < > ( ) ; final java.lang.String plain = "Test123!32@" ; final java.util.concurrent.atomic.AtomicBoolean failed = new java.util.concurrent.atomic.AtomicBoolean ( ) ; final java.lang.StringBuffer failures = new java.lang.StringBuffer ( ) ; for ( int i = 0 ; i < 100 ; i ++ ) { final int threadCount = i ; l.add ( new java.lang.Thread ( ( ) -> { try { java.lang.String encrypted = org.ovirt.engine.core.utils.crypt.EngineEncryptionUtils.encrypt ( plain ) ; java.lang.String actualDecrypted = org.ovirt.engine.core.utils.crypt.EngineEncryptionUtils.decrypt ( encrypted ) ; if ( ! ( plain.equals ( actualDecrypted ) ) ) { java.lang.String failure = java.lang.String.format ( "Failure in test %d, plain is %s%n" , threadCount , actualDecrypted ) ; failures.append ( failure ) ; failed.set ( true ) ; } } catch ( java.lang.Exception e ) { throw new java.lang.RuntimeException ( e ) ; } } ) ) ; } for ( java.lang.Thread t : l ) { t.start ( ) ; } for ( java.lang.Thread t : l ) { t.join ( ) ; } org.junit.Assert.assertFalse ( failures.toString ( ) , failed.get ( ) ) ; }
Source:
public void onBrowserEvent ( org.ovirt.engine.ui.common.widget.table.column.Context context , com.google.gwt.dom.client.Element parent , T value , com.google.gwt.dom.client.NativeEvent event , com.google.gwt.cell.client.ValueUpdater < T > valueUpdater ) { super . onBrowserEvent ( context , parent , value , event , valueUpdater ) ; com.google.gwt.dom.client.EventTarget eventTarget = event.getEventTarget ( ) ; if ( ! ( com.google.gwt.dom.client.Element.is ( eventTarget ) ) ) { return ; } if ( BrowserEvents.CLICK.equals ( event.getType ( ) ) ) { onClick ( value ) ; } }

Target:
public void onBrowserEvent ( org.ovirt.engine.ui.common.widget.table.cell.Context context , com.google.gwt.dom.client.Element parent , T value , com.google.gwt.dom.client.NativeEvent event , com.google.gwt.cell.client.ValueUpdater < T > valueUpdater ) { super . onBrowserEvent ( context , parent , value , event , valueUpdater ) ; com.google.gwt.dom.client.EventTarget eventTarget = event.getEventTarget ( ) ; if ( ! ( com.google.gwt.dom.client.Element.is ( eventTarget ) ) ) { return ; } if ( BrowserEvents.CLICK.equals ( event.getType ( ) ) ) { onClick ( value ) ; } }
Source:
public org.ovirt.engine.core.common.businessentities.action_version_map mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.action_version_map entity = new org.ovirt.engine.core.common.businessentities.action_version_map ( ) ; entity.setaction_type ( org.ovirt.engine.core.common.action.VdcActionType.forValue ( rs.getInt ( "action_type" ) ) ) ; entity.setcluster_minimal_version ( rs.getString ( "cluster_minimal_version" ) ) ; entity.setstorage_pool_minimal_version ( rs.getString ( "storage_pool_minimal_version" ) ) ; return entity ; }

Target:
public org.ovirt.engine.core.common.businessentities.ActionVersionMap mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.ActionVersionMap entity = new org.ovirt.engine.core.common.businessentities.ActionVersionMap ( ) ; entity.setaction_type ( org.ovirt.engine.core.common.action.VdcActionType.forValue ( rs.getInt ( "action_type" ) ) ) ; entity.setcluster_minimal_version ( rs.getString ( "cluster_minimal_version" ) ) ; entity.setstorage_pool_minimal_version ( rs.getString ( "storage_pool_minimal_version" ) ) ; return entity ; }
Source:
public static void GetPermittedStorageDomainsByStoragePoolId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.core.common.businessentities.ActionGroup actionGroup ) { 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.storage_domains > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters params = new org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters ( ) ; params.setStoragePoolId ( dataCenterId ) ; params.setActionGroup ( actionGroup ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetPermittedStorageDomainsByStoragePoolId , params , aQuery ) ; }

Target:
public static void GetVmListByClusterName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String clusterName ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > vms = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VM > Cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return vms ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( "Vms: cluster=" + clusterName ) , org.ovirt.engine.core.common.interfaces.SearchType.VM ) , aQuery ) ; }
Source:
public void testIsBlockDomain ( ) { org.junit.Assert.assertTrue ( StorageType.FCP.isBlockDomain ( ) ) ; org.junit.Assert.assertTrue ( StorageType.ISCSI.isBlockDomain ( ) ) ; org.junit.Assert.assertFalse ( StorageType.NFS.isBlockDomain ( ) ) ; org.junit.Assert.assertFalse ( StorageType.LOCALFS.isBlockDomain ( ) ) ; org.junit.Assert.assertFalse ( StorageType.POSIXFS.isBlockDomain ( ) ) ; org.junit.Assert.assertFalse ( StorageType.GLUSTERFS.isBlockDomain ( ) ) ; org.junit.Assert.assertFalse ( StorageType.GLANCE.isBlockDomain ( ) ) ; org.junit.Assert.assertFalse ( StorageType.CINDER.isBlockDomain ( ) ) ; }

Target:
public void testIsBlockDomain ( ) { org.junit.jupiter.api.Assertions.assertTrue ( StorageType.FCP.isBlockDomain ( ) ) ; org.junit.jupiter.api.Assertions.assertTrue ( StorageType.ISCSI.isBlockDomain ( ) ) ; org.junit.jupiter.api.Assertions.assertFalse ( StorageType.NFS.isBlockDomain ( ) ) ; org.junit.jupiter.api.Assertions.assertFalse ( StorageType.LOCALFS.isBlockDomain ( ) ) ; org.junit.jupiter.api.Assertions.assertFalse ( StorageType.POSIXFS.isBlockDomain ( ) ) ; org.junit.jupiter.api.Assertions.assertFalse ( StorageType.GLUSTERFS.isBlockDomain ( ) ) ; org.junit.jupiter.api.Assertions.assertFalse ( StorageType.GLANCE.isBlockDomain ( ) ) ; org.junit.jupiter.api.Assertions.assertFalse ( StorageType.CINDER.isBlockDomain ( ) ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult labeledValidBond ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > nics ) { if ( ! ( java.lang.Boolean.TRUE.equals ( iface.getBonded ( ) ) ) ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } return org.ovirt.engine.core.bll.ValidationResult.failWith ( VdcBllMessages.IMPROPER_BOND_IS_LABELED ) . when ( ( ( getSlaveCount ( nics , 2 ) ) < 2 ) ) ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult labeledValidBond ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > nics ) { if ( ! ( java.lang.Boolean.TRUE.equals ( iface.getBonded ( ) ) ) ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } return org.ovirt.engine.core.bll.ValidationResult.failWith ( EngineMessage.IMPROPER_BOND_IS_LABELED , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( org.ovirt.engine.core.bll.validator.HostInterfaceValidator.VAR_BOND_NAME , iface.getName ( ) ) ) . when ( ( ( getSlaveCount ( nics , 2 ) ) < 2 ) ) ; }
Source:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.NIC device ) { validateParameters ( device , getRequiredAddFields ( ) ) ; javax.ws.rs.core.Response response = performCreation ( addAction , getAddParameters ( map ( device ) , device ) , getEntityIdResolver ( device.getName ( ) ) ) ; if ( response != null ) { java.lang.Object entity = response.getEntity ( ) ; if ( entity != null ) { org.ovirt.engine.api.model.NIC nic = ( ( org.ovirt.engine.api.model.NIC ) ( entity ) ) ; setNetworkId ( nic ) ; } } return response ; }

Target:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.NIC device ) { validateParameters ( device , getRequiredAddFields ( ) ) ; javax.ws.rs.core.Response response = performCreate ( addAction , getAddParameters ( map ( device ) , device ) , getEntityIdResolver ( device.getName ( ) ) ) ; if ( response != null ) { java.lang.Object entity = response.getEntity ( ) ; if ( entity != null ) { org.ovirt.engine.api.model.NIC nic = ( ( org.ovirt.engine.api.model.NIC ) ( entity ) ) ; setNetworkId ( nic ) ; } } return response ; }
Source:
protected void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetEntityExpectations ( 1 ) ; setUpGetGraphicsExpectations ( 1 ) ; setUpGetBallooningExpectations ( ) ; setUriInfo ( setUpActionExpectations ( ActionType.RemoveVmTemplate , org.ovirt.engine.core.common.action.VmTemplateManagementParameters.class , new java.lang.String [ ] { "VmTemplateId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , valid , success ) ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
protected void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetEntityExpectations ( 1 ) ; setUpGetGraphicsExpectations ( 1 ) ; setUpGetBallooningExpectations ( ) ; setUriInfo ( setUpActionExpectations ( ActionType.RemoveVmTemplate , org.ovirt.engine.core.common.action.VmTemplateManagementParameters.class , new java.lang.String [ ] { "VmTemplateId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , valid , success ) ) ; try { resource.remove ( ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
public void testSave ( ) { dao.save ( new_permissions ) ; org.ovirt.engine.core.common.businessentities.Permission result = dao.getForRoleAndAdElementAndObject ( new_permissions.getRoleId ( ) , new_permissions.getAdElementId ( ) , new_permissions.getObjectId ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( new_permissions , result ) ; }

Target:
public void testSave ( ) { dao.save ( new_permissions ) ; org.ovirt.engine.core.common.businessentities.Permission result = dao.getForRoleAndAdElementAndObject ( new_permissions.getRoleId ( ) , new_permissions.getAdElementId ( ) , new_permissions.getObjectId ( ) ) ; org.junit.jupiter.api.Assertions.assertNotNull ( result ) ; org.junit.jupiter.api.Assertions.assertEquals ( new_permissions , result ) ; }
Source:
public void validateFailsForDeviceAlreadyInUse ( ) { org.ovirt.engine.core.common.businessentities.gluster.StorageDevice storageDevice = getStorageDevice ( "sda" ) ; storageDevice.setCanCreateBrick ( false ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.common.action.gluster.CreateBrickParameters ( HOST_ID , "brick1" , "/gluster-bricks/brick1" , org.ovirt.engine.core.common.businessentities.RaidType.RAID0 , null , null , java.util.Collections.singletonList ( storageDevice ) ) ) . when ( cmd ) . getParameters ( ) ; prepareMocks ( VDSStatus.Up ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; }

Target:
public void validateFailsForDeviceAlreadyInUse ( ) { org.ovirt.engine.core.common.businessentities.gluster.StorageDevice storageDevice = getStorageDevice ( "sda" ) ; storageDevice.setCanCreateBrick ( false ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.common.action.gluster.CreateBrickParameters ( HOST_ID , "brick1" , "/gluster-bricks/brick1" , org.ovirt.engine.core.common.businessentities.RaidType.RAID0 , null , null , java.util.Collections.singletonList ( storageDevice ) , getStorageDevice ( "sda" ) , org.ovirt.engine.core.common.businessentities.CacheModeType.writethrough , 10 ) ) . when ( cmd ) . getParameters ( ) ; prepareMocks ( VDSStatus.Up ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; }
Source:
public void validateFailsWithForceNotSupported ( ) { cmd = org.mockito.Mockito.spy ( createTestCommand ( volumeId1 , getBricks ( volumeId1 , 2 ) , 0 , 4 , true ) ) ; prepareMocks ( cmd ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_GLUSTER_VOLUME_ADD_BRICK_FORCE_NOT_SUPPORTED ) ; }

Target:
public void validateFailsDiffInterface ( ) { cmd = org.mockito.Mockito.spy ( createTestCommand ( volumeId1 , getBricks ( volumeId1 , 2 ) , 0 , 4 , false ) ) ; prepareMocks ( cmd ) ; prepareInterfaceMocks ( ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; }
Source:
private void buildDictionaries ( ) { for ( org.ovirt.engine.core.searchbackend.gluster.GlusterVolumeConditionFieldAutoCompleter.AutoCompletionField field : org.ovirt.engine.core.searchbackend.gluster.GlusterVolumeConditionFieldAutoCompleter.fields ) { mVerbs.add ( field.fieldName ) ; } buildCompletions ( ) ; for ( org.ovirt.engine.core.searchbackend.gluster.GlusterVolumeConditionFieldAutoCompleter.AutoCompletionField field : org.ovirt.engine.core.searchbackend.gluster.GlusterVolumeConditionFieldAutoCompleter.fields ) { getTypeDictionary ( ) . put ( field.fieldName , field.fieldType ) ; } for ( org.ovirt.engine.core.searchbackend.gluster.GlusterVolumeConditionFieldAutoCompleter.AutoCompletionField field : org.ovirt.engine.core.searchbackend.gluster.GlusterVolumeConditionFieldAutoCompleter.fields ) { columnNameDict.put ( field.fieldName , field.columnName ) ; } buildBasicValidationTable ( ) ; }

Target:
private void buildDictionaries ( ) { for ( org.ovirt.engine.core.searchbackend.gluster.GlusterVolumeConditionFieldAutoCompleter.AutoCompletionField field : org.ovirt.engine.core.searchbackend.gluster.GlusterVolumeConditionFieldAutoCompleter.fields ) { verbs.add ( field.fieldName ) ; } buildCompletions ( ) ; for ( org.ovirt.engine.core.searchbackend.gluster.GlusterVolumeConditionFieldAutoCompleter.AutoCompletionField field : org.ovirt.engine.core.searchbackend.gluster.GlusterVolumeConditionFieldAutoCompleter.fields ) { getTypeDictionary ( ) . put ( field.fieldName , field.fieldType ) ; } for ( org.ovirt.engine.core.searchbackend.gluster.GlusterVolumeConditionFieldAutoCompleter.AutoCompletionField field : org.ovirt.engine.core.searchbackend.gluster.GlusterVolumeConditionFieldAutoCompleter.fields ) { columnNameDict.put ( field.fieldName , field.columnName ) ; } buildBasicValidationTable ( ) ; }
Source:
private void addFeaturePosixDevice ( org.ovirt.engine.api.model.Features features ) { org.ovirt.engine.api.model.Feature feature = new org.ovirt.engine.api.model.Feature ( ) ; feature.setName ( "POSIX-FS Stroage Type" ) ; feature.setStorageTypes ( new org.ovirt.engine.api.model.StorageTypes ( ) ) ; feature.getStorageTypes ( ) . getStorageTypes ( ) . add ( StorageType.POSIXFS.value ( ) ) ; features.getFeature ( ) . add ( feature ) ; }

Target:
private void addFeaturePosixDevice ( org.ovirt.engine.api.model.Features features ) { org.ovirt.engine.api.model.Feature feature = new org.ovirt.engine.api.model.Feature ( ) ; feature.setName ( "POSIX-FS Storage Type" ) ; feature.setStorageTypes ( new org.ovirt.engine.api.model.StorageTypes ( ) ) ; feature.getStorageTypes ( ) . getStorageTypes ( ) . add ( StorageType.POSIXFS.value ( ) ) ; features.getFeature ( ) . add ( feature ) ; }
Source:
public void testValidateNoVM ( ) { org.ovirt.engine.core.common.action.WatchdogParameters params = new org.ovirt.engine.core.common.action.WatchdogParameters ( ) ; params.setId ( new org.ovirt.engine.core.compat.Guid ( "a09f57b1-5739-4352-bf88-a6f834ed46db" ) ) ; params.setAction ( VmWatchdogAction.PAUSE ) ; params.setModel ( vmWatchdogType ) ; final org.ovirt.engine.core.dao.VmDao vmDaoMock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.VmDao.class ) ; org.ovirt.engine.core.bll.UpdateWatchdogCommand command = new org.ovirt.engine.core.bll.UpdateWatchdogCommand ( params , null ) { @ java.lang.Override public org.ovirt.engine.core.dao.VmDao getVmDao ( ) { return vmDaoMock ; } } ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; }

Target:
public void testValidateNoVM ( ) { org.ovirt.engine.core.common.action.WatchdogParameters params = new org.ovirt.engine.core.common.action.WatchdogParameters ( ) ; params.setId ( new org.ovirt.engine.core.compat.Guid ( "a09f57b1-5739-4352-bf88-a6f834ed46db" ) ) ; params.setAction ( VmWatchdogAction.PAUSE ) ; params.setModel ( vmWatchdogType ) ; final org.ovirt.engine.core.dao.VmDao vmDaoMock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.VmDao.class ) ; org.ovirt.engine.core.bll.UpdateWatchdogCommand command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.UpdateWatchdogCommand ( params , null ) ) ; org.mockito.Mockito.doReturn ( vmDaoMock ) . when ( command ) . getVmDao ( ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; }
Source:
public javax.ws.rs.core.Response copy ( org.ovirt.engine.api.model.Action action ) { validateParameters ( action , "storageDomain.id|name" ) ; org.ovirt.engine.core.compat.Guid storageDomainId = getStorageDomainId ( action ) ; org.ovirt.engine.core.compat.Guid imageId = asGuid ( getDisk ( ) . getImageId ( ) ) ; org.ovirt.engine.core.common.action.MoveOrCopyImageGroupParameters params = new org.ovirt.engine.core.common.action.MoveOrCopyImageGroupParameters ( imageId , org.ovirt.engine.core.compat.Guid.Empty , storageDomainId , org.ovirt.engine.core.common.businessentities.storage.ImageOperation.Copy ) ; return doAction ( VdcActionType.MoveOrCopyDisk , params , action ) ; }

Target:
public javax.ws.rs.core.Response copy ( org.ovirt.engine.api.model.Action action ) { validateParameters ( action , "storageDomain.id|name" ) ; org.ovirt.engine.core.compat.Guid storageDomainId = getStorageDomainId ( action ) ; org.ovirt.engine.api.model.Disk disk = getDisk ( ) ; org.ovirt.engine.core.compat.Guid imageId = asGuid ( disk.getImageId ( ) ) ; org.ovirt.engine.core.common.action.MoveOrCopyImageGroupParameters params = new org.ovirt.engine.core.common.action.MoveOrCopyImageGroupParameters ( imageId , org.ovirt.engine.core.compat.Guid.Empty , storageDomainId , org.ovirt.engine.core.common.businessentities.storage.ImageOperation.Copy ) ; params.setImageGroupID ( asGuid ( disk.getId ( ) ) ) ; return doAction ( VdcActionType.MoveOrCopyDisk , params , action ) ; }
Source:
private void assertGetAllForClusterCorrectResult ( java.util.List < org.ovirt.engine.core.common.businessentities.VDS > result ) { org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; org.junit.Assert.assertEquals ( result.iterator ( ) . next ( ) , existingVds ) ; for ( org.ovirt.engine.core.common.businessentities.VDS vds : result ) { org.junit.Assert.assertEquals ( vds.getClusterId ( ) , existingVds.getClusterId ( ) ) ; } }

Target:
private void assertGetAllForClusterCorrectResult ( java.util.List < org.ovirt.engine.core.common.businessentities.VDS > result ) { org.junit.jupiter.api.Assertions.assertNotNull ( result ) ; org.junit.jupiter.api.Assertions.assertFalse ( result.isEmpty ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( result.iterator ( ) . next ( ) , existingVds ) ; for ( org.ovirt.engine.core.common.businessentities.VDS vds : result ) { org.junit.jupiter.api.Assertions.assertEquals ( vds.getClusterId ( ) , existingVds.getClusterId ( ) ) ; } }
Source:
private boolean interfaceOrItsVlanDoesNotHaveNetworkOrOneIsAboutToBeRemovedFromIt ( java.util.Map < java.lang.String , org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > removedNetworkAttachmentsByNicName , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface potentialSlave ) { boolean validSlave = interfaceDoesNotHaveNetworkOrOneIsAboutToBeRemovedFromIt ( removedNetworkAttachmentsByNicName , potentialSlave ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > vlanInterfacesForInterface = vlanInterfacesForInterface ( potentialSlave ) ; for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface vdsNetworkInterface : vlanInterfacesForInterface ) { validSlave = validSlave && ( interfaceDoesNotHaveNetworkOrOneIsAboutToBeRemovedFromIt ( removedNetworkAttachmentsByNicName , vdsNetworkInterface ) ) ; } return validSlave ; }

Target:
private boolean interfaceOrItsVlanDoesNotHaveNetworkOrOneIsAboutToBeRemovedFromIt ( java.util.Set < java.lang.String > removedNetworkAttachmentsNicNames , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface potentialSlave ) { boolean validSlave = interfaceDoesNotHaveNetworkOrOneIsAboutToBeRemovedFromIt ( removedNetworkAttachmentsNicNames , potentialSlave ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > vlanInterfacesForInterface = vlanInterfacesForInterface ( potentialSlave ) ; for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface vdsNetworkInterface : vlanInterfacesForInterface ) { validSlave = validSlave && ( interfaceDoesNotHaveNetworkOrOneIsAboutToBeRemovedFromIt ( removedNetworkAttachmentsNicNames , vdsNetworkInterface ) ) ; } return validSlave ; }
Source:
private void logMessage ( org.ovirt.engine.core.compat.Guid clusterId , org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume , final java.lang.String action , final java.lang.String status , org.ovirt.engine.core.common.AuditLogType logType ) { java.util.Map < java.lang.String , java.lang.String > customValues = new java.util.HashMap < > ( ) ; customValues.put ( "action" , action ) ; customValues.put ( "status" , status ) ; logUtil.logAuditMessage ( clusterId , volume , null , logType , customValues ) ; }

Target:
private void logMessage ( org.ovirt.engine.core.compat.Guid clusterId , org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume , final java.lang.String action , final java.lang.String status , org.ovirt.engine.core.common.AuditLogType logType ) { java.util.Map < java.lang.String , java.lang.String > customValues = new java.util.HashMap < > ( ) ; customValues.put ( "action" , action ) ; customValues.put ( "status" , status ) ; logUtil.logAuditMessage ( clusterId , volume.getClusterName ( ) , volume , null , logType , customValues ) ; }
Source:
private void persistTopology ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > reportedNics , java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > dbNics , java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > userConfiguredNics ) { final org.ovirt.engine.core.vdsbroker.vdsbroker.HostNetworkInterfacesPersister networkInterfacesPersister = new org.ovirt.engine.core.vdsbroker.vdsbroker.HostNetworkInterfacesPersisterImpl ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getInterfaceDao ( ) , reportedNics , dbNics , userConfiguredNics ) ; networkInterfacesPersister.persistTopology ( ) ; }

Target:
private void persistTopology ( org.ovirt.engine.core.common.businessentities.VDS host , java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > dbNics , java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > clusterNetworks , org.ovirt.engine.core.common.vdscommands.UserConfiguredNetworkData userConfiguredData ) { final org.ovirt.engine.core.vdsbroker.vdsbroker.HostNetworkInterfacesPersister networkInterfacesPersister = new org.ovirt.engine.core.vdsbroker.vdsbroker.HostNetworkInterfacesPersisterImpl ( interfaceDao , host.getInterfaces ( ) , dbNics , userConfiguredData ) ; networkInterfacesPersister.persistTopology ( ) ; final org.ovirt.engine.core.vdsbroker.vdsbroker.HostNetworkAttachmentsPersister networkAttachmentPersister = new org.ovirt.engine.core.vdsbroker.vdsbroker.HostNetworkAttachmentsPersister ( networkAttachmentDao , host.getId ( ) , host.getInterfaces ( ) , userConfiguredData.getNetworkAttachments ( ) , clusterNetworks ) ; networkAttachmentPersister.persistNetworkAttachments ( ) ; }
Source:
public void testGetAllForEntityFilteredWithPermissions ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.Permissions > result = dao.getAllForEntity ( org.ovirt.engine.core.dao.PermissionDAOTest.VM_ENTITY_ID , org.ovirt.engine.core.dao.PRIVILEGED_USER_SESSION_ID , true ) ; org.ovirt.engine.core.dao.PermissionDAOTest.assertGetAllForEntityResult ( result ) ; }

Target:
public void testGetAllUsersWithPermissionsOnEntity ( ) { org.junit.Assert.assertNotNull ( privilegedUserSession ) ; java.util.List < org.ovirt.engine.core.common.businessentities.Permissions > result = dao.getAllForEntity ( org.ovirt.engine.core.dao.PermissionDAOTest.VM_ENTITY_ID , privilegedUserSession.getId ( ) , true , true ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( 2 , result.size ( ) ) ; org.ovirt.engine.core.dao.PermissionDAOTest.assertGetAllForEntityResult ( result ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( "IsAvailable" . equals ( ( ( org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ( args ) ) . PropertyName ) ) { boolean value = getIsAvailable ( ) ; getPluginType ( ) . setIsAvailable ( value ) ; isPluginConfigurationAvailable ( ) . setEntity ( ( value && ( ! ( org.ovirt.engine.ui.uicommonweb.models.providers.NeutronPluginTranslator.isDisplayStringCustom ( ( ( java.lang.String ) ( getPluginType ( ) . getSelectedItem ( ) ) ) ) ) ) ) ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( "IsAvailable" . equals ( ( ( org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ( args ) ) . propertyName ) ) { boolean value = getIsAvailable ( ) ; getPluginType ( ) . setIsAvailable ( value ) ; isPluginConfigurationAvailable ( ) . setEntity ( ( value && ( ! ( org.ovirt.engine.ui.uicommonweb.models.providers.NeutronPluginTranslator.isDisplayStringCustom ( ( ( java.lang.String ) ( getPluginType ( ) . getSelectedItem ( ) ) ) ) ) ) ) ) ; } }
Source:
protected void updateLoginAllAvailability ( ) { java.util.List < org.ovirt.engine.ui.uicommonweb.models.storage.SanTargetModel > items = ( ( java.util.List < org.ovirt.engine.ui.uicommonweb.models.storage.SanTargetModel > ) ( getItems ( ) ) ) ; boolean allow = false ; for ( org.ovirt.engine.ui.uicommonweb.models.storage.SanTargetModel item : items ) { if ( ! ( item.getIsLoggedIn ( ) ) ) { allow = true ; break ; } } getLoginAllCommand ( ) . setIsExecutionAllowed ( allow ) ; }

Target:
protected void updateLoginAvailability ( ) { java.util.List < org.ovirt.engine.ui.uicommonweb.models.storage.SanTargetModel > items = ( ( java.util.List < org.ovirt.engine.ui.uicommonweb.models.storage.SanTargetModel > ) ( getItems ( ) ) ) ; boolean allow = false ; for ( org.ovirt.engine.ui.uicommonweb.models.storage.SanTargetModel item : items ) { if ( ! ( item.getIsLoggedIn ( ) ) ) { allow = true ; break ; } } getLoginCommand ( ) . setIsExecutionAllowed ( allow ) ; }
Source:
protected void UpdateDetailsAvailability ( ) { super . UpdateDetailsAvailability ( ) ; if ( ( ( getSelectedItem ( ) ) != null ) && ( ( ( ( org.ovirt.engine.core.common.businessentities.storage_pool ) ( getSelectedItem ( ) ) ) . getQuotaEnforcementType ( ) ) != ( org.ovirt.engine.core.common.businessentities.QuotaEnforcementTypeEnum.DISABLED ) ) ) { quotaListModel.setIsAvailable ( true ) ; } else { quotaListModel.setIsAvailable ( false ) ; } }

Target:
protected void updateDetailsAvailability ( ) { super . updateDetailsAvailability ( ) ; if ( ( ( getSelectedItem ( ) ) != null ) && ( ( ( ( org.ovirt.engine.core.common.businessentities.storage_pool ) ( getSelectedItem ( ) ) ) . getQuotaEnforcementType ( ) ) != ( org.ovirt.engine.core.common.businessentities.QuotaEnforcementTypeEnum.DISABLED ) ) ) { quotaListModel.setIsAvailable ( true ) ; } else { quotaListModel.setIsAvailable ( false ) ; } }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc sendHcCmdToDesktop ( java.lang.String vmId , java.lang.String hcCommand ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.sendHcCmdToDesktop ( vmId , hcCommand ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc hotunplugDisk ( java.util.Map info ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.hotunplugDisk ( info ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
public void invokePlugins ( java.lang.String functionName , com.google.gwt.core.client.JsArray < ? > functionArgs ) { if ( canInvokePlugins ) { for ( org.ovirt.engine.ui.webadmin.plugin.Plugin plugin : getPlugins ( ) ) { if ( plugin.isInState ( PluginState.IN_USE ) ) { if ( ! ( invokePlugin ( plugin , functionName , functionArgs ) ) ) { org.ovirt.engine.ui.webadmin.plugin.PluginManager.logger.warning ( ( ( "Failed to invoke plugin [" + ( plugin.getMetaData ( ) . getName ( ) ) ) + "]" ) ) ; pluginFailed ( plugin ) ; } } } } }

Target:
public void invokePluginsNow ( java.lang.String functionName , com.google.gwt.core.client.JsArray < ? > functionArgs ) { if ( canInvokePlugins ) { for ( org.ovirt.engine.ui.webadmin.plugin.Plugin plugin : getPlugins ( ) ) { if ( plugin.isInState ( PluginState.IN_USE ) ) { invokePlugin ( plugin , functionName , functionArgs ) ; } } } }
Source:
protected boolean isImageNotLocked ( ) { org.ovirt.engine.core.common.businessentities.DiskImage diskImage = org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getImage ( ) ; if ( ( diskImage.getimageStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.ImageStatus.LOCKED ) ) { if ( ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getParameters ( ) . getOperation ( ) ) == ( org.ovirt.engine.core.common.businessentities.ImageOperation.Move ) ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_DISKS_LOCKED ) ; addCanDoActionMessage ( java.lang.String.format ( "$%1$s %2$s" , "diskAliases" , diskImage.getDiskAlias ( ) ) ) ; } else { addCanDoActionMessage ( VdcBllMessages.VM_TEMPLATE_IMAGE_IS_LOCKED ) ; } return false ; } return true ; }

Target:
protected boolean isImageNotLocked ( ) { org.ovirt.engine.core.common.businessentities.DiskImage diskImage = org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getImage ( ) ; if ( ( diskImage.getImageStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.ImageStatus.LOCKED ) ) { if ( ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getParameters ( ) . getOperation ( ) ) == ( org.ovirt.engine.core.common.businessentities.ImageOperation.Move ) ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_DISKS_LOCKED ) ; addCanDoActionMessage ( java.lang.String.format ( "$%1$s %2$s" , "diskAliases" , diskImage.getDiskAlias ( ) ) ) ; } else { addCanDoActionMessage ( VdcBllMessages.VM_TEMPLATE_IMAGE_IS_LOCKED ) ; } return false ; } return true ; }
Source:
private void doTestBadUpdate ( boolean canDo , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetEntityExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateStoragePool , org.ovirt.engine.core.common.action.StoragePoolManagementParameter.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , canDo , success ) ) ; try { resource.update ( org.ovirt.engine.api.restapi.resource.BackendDataCentersResourceTest.getModel ( 0 ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
private void doTestBadUpdate ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetEntityExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateStoragePool , org.ovirt.engine.core.common.action.StoragePoolManagementParameter.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , valid , success ) ) ; try { resource.update ( org.ovirt.engine.api.restapi.resource.BackendDataCentersResourceTest.getModel ( 0 ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
protected java.util.Set < org.ovirt.engine.core.utils.MockConfigDescriptor < java.lang.Object > > getExtraConfigDescriptors ( ) { return new java.util.HashSet ( java.util.Arrays.asList ( org.ovirt.engine.core.utils.MockConfigDescriptor.of ( ConfigValues.ConsoleToggleFullScreenKeys , "shift+f11" ) , org.ovirt.engine.core.utils.MockConfigDescriptor.of ( ConfigValues.ConsoleReleaseCursorKeys , "shift+f12" ) , org.ovirt.engine.core.utils.MockConfigDescriptor.of ( ConfigValues.RemapCtrlAltDelDefault , true ) , org.ovirt.engine.core.utils.MockConfigDescriptor.of ( ConfigValues.FullScreenWebadminDefault , false ) , org.ovirt.engine.core.utils.MockConfigDescriptor.of ( ConfigValues.EnableSpiceRootCertificateValidation , true ) ) ) ; }

Target:
public static java.util.stream.Stream < org.ovirt.engine.core.utils.MockConfigDescriptor < ? > > mockConfiguration ( ) { return java.util.stream.Stream.concat ( org.ovirt.engine.core.bll.AbstractQueryTest.mockConfiguration ( ) , java.util.stream.Stream.of ( org.ovirt.engine.core.utils.MockConfigDescriptor.of ( ConfigValues.ConsoleToggleFullScreenKeys , "shift+f11" ) , org.ovirt.engine.core.utils.MockConfigDescriptor.of ( ConfigValues.ConsoleReleaseCursorKeys , "shift+f12" ) , org.ovirt.engine.core.utils.MockConfigDescriptor.of ( ConfigValues.RemapCtrlAltDelDefault , true ) , org.ovirt.engine.core.utils.MockConfigDescriptor.of ( ConfigValues.FullScreenWebadminDefault , false ) , org.ovirt.engine.core.utils.MockConfigDescriptor.of ( ConfigValues.EnableSpiceRootCertificateValidation , true ) ) ) ; }
Source:
public void testCleanExpiredUsersSessionsWithUsers ( ) { org.ovirt.engine.core.dao.DbUserDAO dbUserDAOMcok = initDataForClearTest ( "VdcUser" ) ; container.cleanExpiredUsersSessions ( ) ; container.cleanExpiredUsersSessions ( ) ; org.junit.Assert.assertNull ( "Get should return null since the session was removed" , container.GetData ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_SESSION_ID , "VdcUser" ) ) ; org.junit.Assert.assertNull ( "Get should return null since the session was removed" , container.getUser ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_SESSION_ID ) ) ; org.mockito.Mockito.verify ( dbUserDAOMcok ) . removeUserSessions ( org.mockito.Matchers.anyMap ( ) ) ; }

Target:
public void testCleanNotExpiredUsersSessionsWithUsers ( ) { org.ovirt.engine.core.dao.DbUserDAO dbUserDAOMcok = initDataForClearTest ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.USER ) ; container.cleanExpiredUsersSessions ( ) ; org.junit.Assert.assertNotNull ( "Get should return the value since the session was not removed" , container.GetData ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_SESSION_ID , org.ovirt.engine.core.bll.session.SessionDataContainerTest.USER , false ) ) ; org.junit.Assert.assertNotNull ( "Get should return the value since the session was not removed" , container.getUser ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_SESSION_ID , false ) ) ; org.mockito.Mockito.verifyZeroInteractions ( dbUserDAOMcok ) ; }