auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static java.lang.Object [ ] [ ] data ( ) { return new java.lang.Object [ ] [ ] { new java.lang.Object [ ] { false , java.util.Collections.emptyList ( ) } , new java.lang.Object [ ] { false , java.util.Collections.singletonList ( ActionGroup.CREATE_VM ) } , new java.lang.Object [ ] { true , java.util.Collections.singletonList ( ActionGroup.CONFIGURE_ENGINE ) } , new java.lang.Object [ ] { true , java.util.Arrays.asList ( ActionGroup.CONFIGURE_ENGINE , ActionGroup.CREATE_VM ) } } ; }

Target:
public static java.util.stream.Stream < org.junit.jupiter.params.provider.Arguments > prepareRoleForCommandNoGroups ( ) { return java.util.stream.Stream.of ( org.junit.jupiter.params.provider.Arguments.of ( false , java.util.Collections.emptyList ( ) ) , org.junit.jupiter.params.provider.Arguments.of ( false , java.util.Collections.singletonList ( ActionGroup.CREATE_VM ) ) , org.junit.jupiter.params.provider.Arguments.of ( true , java.util.Collections.singletonList ( ActionGroup.CONFIGURE_ENGINE ) ) , org.junit.jupiter.params.provider.Arguments.of ( true , java.util.Arrays.asList ( ActionGroup.CONFIGURE_ENGINE , ActionGroup.CREATE_VM ) ) ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeGeoRepPause ( java.lang.String masterVolumeName , java.lang.String slaveHost , java.lang.String slaveVolumeName , boolean force ) { try { return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( vdsServer.glusterVolumeGeoRepPause ( masterVolumeName , slaveHost , slaveVolumeName , force ) ) ; } 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 glusterVolumeGeoRepSessionStart ( java.lang.String volumeName , java.lang.String remoteHost , java.lang.String remoteVolumeName , java.lang.Boolean force ) { try { return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( vdsServer.glusterVolumeGeoRepSessionStart ( volumeName , remoteHost , remoteVolumeName , force ) ) ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
public void testRpmRevision ( ) { org.junit.Assert.assertEquals ( new org.ovirt.engine.core.compat.RpmVersion ( "test-javadb-common-10.2.2.2.2-1.1.i386" ) . getRpmRevision ( ) , "1.1.i386" ) ; org.junit.Assert.assertEquals ( new org.ovirt.engine.core.compat.RpmVersion ( "java-1.7.0-openjdk-devel-1.7.0.25-2.3.10.4.fc18.x86_64" ) . getRpmRevision ( ) , "2.3.10.4.fc18.x86_64" ) ; org.junit.Assert.assertEquals ( new org.ovirt.engine.core.compat.RpmVersion ( "rhev-agent-2.3.7.10.3-1.el6" , "RHEV-Agent" , true ) . getRpmRevision ( ) , "1.el6" ) ; org.junit.Assert.assertEquals ( new org.ovirt.engine.core.compat.RpmVersion ( "rhev-agent-2.3.7.10.3-1.el6" , "rhev-agent" , false ) . getRpmRevision ( ) , "1.el6" ) ; }

Target:
public void testRpmRelease ( ) { org.junit.Assert.assertEquals ( new org.ovirt.engine.core.compat.RpmVersion ( "ovirt-node-iso-2.6.0-20130212.fc18.noarch" ) . getRpmRelease ( ) , "20130212.fc18.noarch" ) ; org.junit.Assert.assertEquals ( new org.ovirt.engine.core.compat.RpmVersion ( "test-javadb-common-10.2.2.2.2-1.1.i386" ) . getRpmRelease ( ) , "1.1.i386" ) ; org.junit.Assert.assertEquals ( new org.ovirt.engine.core.compat.RpmVersion ( "java-1.7.0-openjdk-devel-1.7.0.25-2.3.10.4.fc18.x86_64" ) . getRpmRelease ( ) , "2.3.10.4.fc18.x86_64" ) ; org.junit.Assert.assertEquals ( new org.ovirt.engine.core.compat.RpmVersion ( "rhev-agent-2.3.7.10.3-1.el6" , "RHEV-Agent" , true ) . getRpmRelease ( ) , "1.el6" ) ; org.junit.Assert.assertEquals ( new org.ovirt.engine.core.compat.RpmVersion ( "rhev-agent-2.3.7.10.3-1.el6" , "rhev-agent" , false ) . getRpmRelease ( ) , "1.el6" ) ; }
Source:
public void testDeactivate ( ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( VdcActionType.MaintananceNumberOfVdss , org.ovirt.engine.core.common.action.MaintananceNumberOfVdssParameters.class , new java.lang.String [ ] { "VdsIdList" } , new java.lang.Object [ ] { asList ( GUIDS [ 0 ] ) } ) ) ; verifyActionResponse ( resource.deactivate ( new org.ovirt.engine.api.model.Action ( ) ) ) ; }

Target:
public void testDeactivate ( ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( VdcActionType.MaintenanceNumberOfVdss , org.ovirt.engine.core.common.action.MaintenanceNumberOfVdssParameters.class , new java.lang.String [ ] { "VdsIdList" } , new java.lang.Object [ ] { asList ( GUIDS [ 0 ] ) } ) ) ; verifyActionResponse ( resource.deactivate ( new org.ovirt.engine.api.model.Action ( ) ) ) ; }
Source:
public void onSuccess ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue ) { if ( returnValue.getSucceeded ( ) ) { org.ovirt.engine.core.common.businessentities.VM vm = returnValue.getReturnValue ( ) ; updateVms ( java.util.Collections.singletonList ( vm ) ) ; } else { setError ( messages.failedToLoadOva ( getOvaPath ( ) . getEntity ( ) ) ) ; } stopProgress ( ) ; }

Target:
public void onSuccess ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue ) { updateVms ( returnValue.< java.util.List < org.ovirt.engine.core.common.businessentities.VM > > getReturnValue ( ) ) ; }
Source:
public org.ovirt.engine.core.common.action.VdcReturnValueBase endAction ( org.ovirt.engine.core.bll.tasks.interfaces.SPMTask task , org.ovirt.engine.core.bll.job.ExecutionContext context ) { org.ovirt.engine.core.common.businessentities.AsyncTasks dbAsyncTask = task.getParameters ( ) . getDbAsyncTask ( ) ; org.ovirt.engine.core.common.action.VdcActionType actionType = getEndActionType ( dbAsyncTask ) ; org.ovirt.engine.core.common.action.VdcActionParametersBase parameters = dbAsyncTask.getActionParameters ( ) ; org.ovirt.engine.core.bll.CommandBase < ? > command = org.ovirt.engine.core.bll.CommandsFactory.createCommand ( actionType , parameters ) ; command.setContext ( new org.ovirt.engine.core.bll.context.CommandContext ( context ) ) ; return new org.ovirt.engine.core.bll.tasks.DecoratedCommand ( command ) . endAction ( ) ; }

Target:
public org.ovirt.engine.core.common.action.VdcReturnValueBase endAction ( org.ovirt.engine.core.bll.tasks.interfaces.SPMTask task , org.ovirt.engine.core.bll.job.ExecutionContext context ) { return coCoAsyncTaskHelper.endAction ( task , context ) ; }
Source:
public void testGetAvailableValues ( ) { setSomeValue ( "Anakin" ) ; java.util.Map < java.lang.String , java.lang.String > values = new java.util.HashMap < > ( ) ; java.util.Set < java.lang.String > properties = java.util.Collections.singleton ( "somevalue" ) ; org.ovirt.engine.core.compat.backendcompat.TypeCompat.getPropertyValues ( this , properties , values ) ; org.junit.Assert.assertFalse ( properties.isEmpty ( ) ) ; org.junit.Assert.assertEquals ( "Standard" , "Anakin" , values.get ( "somevalue" ) ) ; }

Target:
public void testGetAvailableValues ( ) { setSomeValue ( "Anakin" ) ; java.util.Map < java.lang.String , java.lang.String > values = new java.util.HashMap < > ( ) ; java.util.Set < java.lang.String > properties = java.util.Collections.singleton ( "somevalue" ) ; org.ovirt.engine.core.compat.backendcompat.TypeCompat.getPropertyValues ( this , properties , values ) ; org.junit.jupiter.api.Assertions.assertFalse ( properties.isEmpty ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( "Anakin" , values.get ( "somevalue" ) , "Standard" ) ; }
Source:
public void testGetNotFound ( ) { org.ovirt.engine.api.restapi.resource.BackendVmApplicationResource resource = getNotFoundResource ( ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( ) ; try { resource.get ( ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testGetNotFound ( ) { org.ovirt.engine.api.restapi.resource.BackendVmApplicationResource resource = getNotFoundResource ( ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( ) ; try { resource.get ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
public java.lang.String render ( T storageDomain ) { if ( storageDomain == null ) { return "" ; } if ( ( storageDomain.getAvailableDiskSize ( ) ) == null ) { return storageDomain.getStorageName ( ) ; } return org.ovirt.engine.ui.common.widget.renderer.StorageDomainFreeSpaceRenderer.MESSAGES.storageDomainFreeSpace ( storageDomain.getStorageName ( ) , storageDomain.getAvailableDiskSize ( ) , storageDomain.getTotalDiskSize ( ) ) ; }

Target:
public java.lang.String render ( T storageDomain ) { if ( storageDomain == null ) { return "" ; } if ( ( storageDomain.getAvailableDiskSize ( ) ) == null ) { return storageDomain.getStorageName ( ) ; } return org.ovirt.engine.ui.common.widget.renderer.StorageDomainFreeSpaceRenderer.messages.storageDomainFreeSpace ( storageDomain.getStorageName ( ) , storageDomain.getAvailableDiskSize ( ) , storageDomain.getTotalDiskSize ( ) ) ; }
Source:
public org.ovirt.engine.core.searchbackend.IAutoCompleter getFieldRelationshipAutoCompleter ( java.lang.String fieldName ) { org.ovirt.engine.core.searchbackend.IAutoCompleter retval ; if ( ( ( ( ( org.ovirt.engine.core.compat.StringHelper.EqOp ( fieldName , "CREATIONDATE" ) ) || ( org.ovirt.engine.core.compat.StringHelper.EqOp ( fieldName , "SIZE" ) ) ) || ( org.ovirt.engine.core.compat.StringHelper.EqOp ( fieldName , "NUMBER_OF_VMS" ) ) ) || ( org.ovirt.engine.core.compat.StringHelper.EqOp ( fieldName , "ACTUAL_SIZE" ) ) ) || ( org.ovirt.engine.core.compat.StringHelper.EqOp ( fieldName , "PROVISIONED_SIZE" ) ) ) { retval = BiggerOrSmallerRelationAutoCompleter.INTSANCE ; } else { retval = StringConditionRelationAutoCompleter.INSTANCE ; } return retval ; }

Target:
public org.ovirt.engine.core.searchbackend.IAutoCompleter getFieldRelationshipAutoCompleter ( java.lang.String fieldName ) { org.ovirt.engine.core.searchbackend.IAutoCompleter retval ; if ( ( ( ( org.ovirt.engine.core.compat.StringHelper.EqOp ( fieldName , "CREATIONDATE" ) ) || ( org.ovirt.engine.core.compat.StringHelper.EqOp ( fieldName , "SIZE" ) ) ) || ( org.ovirt.engine.core.compat.StringHelper.EqOp ( fieldName , "ACTUAL_SIZE" ) ) ) || ( org.ovirt.engine.core.compat.StringHelper.EqOp ( fieldName , "PROVISIONED_SIZE" ) ) ) { retval = BiggerOrSmallerRelationAutoCompleter.INTSANCE ; } else if ( org.ovirt.engine.core.compat.StringHelper.EqOp ( fieldName , "NUMBER_OF_VMS" ) ) { retval = NumericConditionRelationAutoCompleter.INSTANCE ; } else { retval = StringConditionRelationAutoCompleter.INSTANCE ; } return retval ; }
Source:
protected void executeCommand ( ) { for ( org.ovirt.engine.core.common.businessentities.permissions permission : org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getPermissionDao ( ) . getAllDirectPermissionsForAdElement ( org.ovirt.engine.core.bll.RemoveUserCommand.getAdUserId ( ) ) ) { org.ovirt.engine.core.common.action.PermissionsOperationsParameters tempVar = new org.ovirt.engine.core.common.action.PermissionsOperationsParameters ( permission ) ; tempVar.setShouldBeLogged ( false ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.RemovePermission , tempVar , org.ovirt.engine.core.bll.job.ExecutionHandler.createDefaultContexForTasks ( org.ovirt.engine.core.bll.RemoveUserCommand.getExecutionContext ( ) ) ) ; } org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDbUserDao ( ) . remove ( org.ovirt.engine.core.bll.RemoveUserCommand.getAdUserId ( ) ) ; org.ovirt.engine.core.bll.RemoveUserCommand.setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { org.ovirt.engine.core.compat.Guid id = org.ovirt.engine.core.bll.RemoveUserCommand.getParameters ( ) . getId ( ) ; for ( org.ovirt.engine.core.common.businessentities.Permissions permission : org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getPermissionDao ( ) . getAllDirectPermissionsForAdElement ( id ) ) { org.ovirt.engine.core.common.action.PermissionsOperationsParameters tempVar = new org.ovirt.engine.core.common.action.PermissionsOperationsParameters ( permission ) ; tempVar.setShouldBeLogged ( false ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.RemovePermission , tempVar , org.ovirt.engine.core.bll.job.ExecutionHandler.createDefaultContexForTasks ( org.ovirt.engine.core.bll.RemoveUserCommand.getExecutionContext ( ) ) ) ; } org.ovirt.engine.core.bll.RemoveUserCommand.getDbUserDAO ( ) . remove ( id ) ; org.ovirt.engine.core.bll.RemoveUserCommand.setSucceeded ( true ) ; }
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 ) ; customProperties.add ( iface , createCustomProperties ( ) ) ; customProperties.add ( iface , createCustomProperties ( ) ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( iface ) ) ; validateAndExpectViolation ( helper , EngineMessage.ACTION_TYPE_FAILED_NETWORK_CUSTOM_PROPERTIES_NOT_SUPPORTED , network.getName ( ) ) ; }

Target:
public void customPropertiesModified ( ) { 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 ) ; customProperties.add ( iface , createCustomProperties ( ) ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( iface ) , Version.v4_0 ) ; validateAndExpectNoViolations ( helper ) ; assertNoBondsModified ( helper ) ; assertNetworkModified ( helper , network ) ; assertNoNetworksRemoved ( helper ) ; assertNoBondsRemoved ( helper ) ; assertNoInterfacesModified ( helper ) ; }
Source:
protected com.google.gwt.resources.client.ImageResource getStatusImage ( ) { org.ovirt.engine.core.common.businessentities.network.NetworkStatus netStatus = ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel ) ( item ) ) . getStatus ( ) ; if ( netStatus == ( org.ovirt.engine.core.common.businessentities.network.NetworkStatus.OPERATIONAL ) ) { return resources.upImage ( ) ; } else if ( netStatus == ( org.ovirt.engine.core.common.businessentities.network.NetworkStatus.NON_OPERATIONAL ) ) { return resources.downImage ( ) ; } else { return resources.questionMarkImage ( ) ; } }

Target:
protected com.google.gwt.resources.client.ImageResource getStatusImage ( ) { org.ovirt.engine.core.common.businessentities.network.NetworkStatus netStatus = ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel ) ( item ) ) . getStatus ( ) ; if ( netStatus == ( org.ovirt.engine.core.common.businessentities.network.NetworkStatus.OPERATIONAL ) ) { return org.ovirt.engine.ui.webadmin.section.main.view.popup.host.panels.InternalNetworkPanel.resources.upImage ( ) ; } else if ( netStatus == ( org.ovirt.engine.core.common.businessentities.network.NetworkStatus.NON_OPERATIONAL ) ) { return org.ovirt.engine.ui.webadmin.section.main.view.popup.host.panels.InternalNetworkPanel.resources.downImage ( ) ; } else { return org.ovirt.engine.ui.webadmin.section.main.view.popup.host.panels.InternalNetworkPanel.resources.questionMarkImage ( ) ; } }
Source:
public static void initLinuxOsTypes ( ) { org.ovirt.engine.ui.frontend.AsyncQuery callback = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; callback.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.linuxOsIds = ( ( java.util.ArrayList < java.lang.Integer > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.OsRepository , new org.ovirt.engine.core.common.queries.OsQueryParameters ( org.ovirt.engine.core.common.queries.OsQueryParameters.OsRepositoryVerb.GetLinuxOss ) , callback ) ; }

Target:
public void initOsArchitecture ( ) { org.ovirt.engine.ui.frontend.AsyncQuery callback = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; callback.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { osArchitectures = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.OsRepository , new org.ovirt.engine.core.common.queries.OsQueryParameters ( org.ovirt.engine.core.common.queries.OsQueryParameters.OsRepositoryVerb.GetOsArchitectures ) , callback ) ; }
Source:
public static org.ovirt.engine.core.compat.Version getMinimalSupportedVersion ( org.ovirt.engine.core.common.businessentities.FencingPolicy fp ) { org.ovirt.engine.core.compat.Version ver = org.ovirt.engine.core.compat.Version.v3_0 ; if ( fp != null ) { if ( fp.isSkipFencingIfSDActive ( ) ) { for ( org.ovirt.engine.core.compat.Version v : org.ovirt.engine.core.compat.Version.ALL ) { if ( ( ( v.compareTo ( Version.v3_0 ) ) >= 0 ) && ( org.ovirt.engine.core.common.FeatureSupported.isSkipFencingIfSDActiveSupported ( v ) ) ) { ver = v ; break ; } } } } return ver ; }

Target:
public static org.ovirt.engine.core.compat.Version getMinimalSupportedVersion ( org.ovirt.engine.core.common.businessentities.FencingPolicy fp ) { if ( fp == null ) { throw new java.lang.IllegalArgumentException ( ) ; } org.ovirt.engine.core.compat.Version ver = org.ovirt.engine.core.compat.Version.v3_0 ; if ( fp.isSkipFencingIfSDActive ( ) ) { for ( org.ovirt.engine.core.compat.Version v : org.ovirt.engine.core.compat.Version.ALL ) { if ( ( ( v.compareTo ( Version.v3_0 ) ) >= 0 ) && ( org.ovirt.engine.core.common.FeatureSupported.isSkipFencingIfSDActiveSupported ( v ) ) ) { ver = v ; break ; } } } return ver ; }
Source:
public void testDetach ( ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveVmFromPool , org.ovirt.engine.core.common.action.RemoveVmFromPoolParameters.class , new java.lang.String [ ] { "VmId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } ) ) ; verifyActionResponse ( resource.detach ( new org.ovirt.engine.api.model.Action ( ) ) ) ; }

Target:
public void testDetach ( ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( ActionType.RemoveVmFromPool , org.ovirt.engine.core.common.action.RemoveVmFromPoolParameters.class , new java.lang.String [ ] { "VmId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } ) ) ; verifyActionResponse ( resource.detach ( new org.ovirt.engine.api.model.Action ( ) ) ) ; }
Source:
public static void getGlusterHookContent ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hookId , org.ovirt.engine.core.compat.Guid serverId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : "" ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterHookContentQueryParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterHookContentQueryParameters ( hookId ) ; parameters.setGlusterServerId ( serverId ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterHookContent , parameters , aQuery ) ; }

Target:
public static void getClusterGlusterServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters ( clusterId , null , null , false ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeAdvancedDetails , parameters , aQuery ) ; }
Source:
public void mockVdsDbFacadeAndDao ( ) { vdsDao = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.VdsDAO.class ) ; org.mockito.Mockito.when ( vdsDao.getAllForVdsGroupWithStatus ( CLUSTER_ID , VDSStatus.Up ) ) . thenReturn ( mockGetAllVdsForwithStatus ( VDSStatus.Up ) ) ; clusterUtils = org.mockito.Mockito.mock ( org.ovirt.engine.core.bll.utils.ClusterUtils.class ) ; org.mockito.Mockito.doReturn ( clusterUtils ) . when ( getQuery ( ) ) . getClusterUtils ( ) ; org.mockito.Mockito.when ( clusterUtils.getUpServer ( CLUSTER_ID ) ) . thenReturn ( getVds ( VDSStatus.Up ) ) ; org.mockito.Mockito.doReturn ( vdsDao ) . when ( clusterUtils ) . getVdsDao ( ) ; }

Target:
public void mockVdsDbFacadeAndDao ( ) { vdsDao = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.VdsDao.class ) ; org.mockito.Mockito.when ( vdsDao.getAllForVdsGroupWithStatus ( CLUSTER_ID , VDSStatus.Up ) ) . thenReturn ( mockGetAllVdsForwithStatus ( VDSStatus.Up ) ) ; clusterUtils = org.mockito.Mockito.mock ( org.ovirt.engine.core.bll.utils.ClusterUtils.class ) ; org.mockito.Mockito.doReturn ( clusterUtils ) . when ( getQuery ( ) ) . getClusterUtils ( ) ; org.mockito.Mockito.when ( clusterUtils.getUpServer ( CLUSTER_ID ) ) . thenReturn ( getVds ( VDSStatus.Up ) ) ; org.mockito.Mockito.doReturn ( vdsDao ) . when ( clusterUtils ) . getVdsDao ( ) ; }
Source:
public void testBootProtocolSetForRoleNetworkWhenBootProtocolIsDhcp ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createNetwork ( ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = createNetworkAttachmentWithIpConfiguration ( NetworkBootProtocol.DHCP , null , null ) ; attachment.setNetworkId ( network.getId ( ) ) ; doTestBootProtocolSetForRoleNetworkWhenNullValuedIpConfiguration ( true , false , false , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) , network , attachment ) ; }

Target:
public void testBootProtocolSetForRoleNetworkWhenBootProtocolIsDhcp ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createNetwork ( ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = createNetworkAttachmentWithIpConfiguration ( Ipv4BootProtocol.DHCP , null , null ) ; attachment.setNetworkId ( network.getId ( ) ) ; doTestBootProtocolSetForRoleNetworkWhenNullValuedIpConfiguration ( true , false , false , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) , network , attachment ) ; }
Source:
public void canDoActionFailedShareableDiskVolumeFormatUnsupported ( ) throws java.lang.Exception { org.ovirt.engine.core.common.action.UpdateVmDiskParameters parameters = createParameters ( ) ; org.ovirt.engine.core.common.businessentities.storage.DiskImage disk = createShareableDisk ( VolumeFormat.COW ) ; org.ovirt.engine.core.common.businessentities.StorageDomain storage = addNewStorageDomainToDisk ( disk , StorageType.NFS ) ; parameters.setDiskInfo ( disk ) ; org.mockito.Mockito.when ( diskDao.get ( diskImageGuid ) ) . thenReturn ( createDiskImage ( ) ) ; org.mockito.Mockito.when ( storageDomainStaticDao.get ( storage.getId ( ) ) ) . thenReturn ( storage.getStorageStaticData ( ) ) ; initializeCommand ( parameters ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , EngineMessage.SHAREABLE_DISK_IS_NOT_SUPPORTED_BY_VOLUME_FORMAT ) ; }

Target:
public void validateFailedShareableDiskVolumeFormatUnsupported ( ) throws java.lang.Exception { org.ovirt.engine.core.common.action.UpdateVmDiskParameters parameters = createParameters ( ) ; org.ovirt.engine.core.common.businessentities.storage.DiskImage disk = createShareableDisk ( VolumeFormat.COW ) ; org.ovirt.engine.core.common.businessentities.StorageDomain storage = addNewStorageDomainToDisk ( disk , StorageType.NFS ) ; parameters.setDiskInfo ( disk ) ; org.mockito.Mockito.when ( diskDao.get ( diskImageGuid ) ) . thenReturn ( createDiskImage ( ) ) ; org.mockito.Mockito.when ( storageDomainStaticDao.get ( storage.getId ( ) ) ) . thenReturn ( storage.getStorageStaticData ( ) ) ; initializeCommand ( parameters ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.SHAREABLE_DISK_IS_NOT_SUPPORTED_BY_VOLUME_FORMAT ) ; }
Source:
private void cancelTasks ( ) { if ( hasTasks ( ) ) { org.ovirt.engine.core.utils.threadpool.ThreadPoolUtil.execute ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { log.infoFormat ( "Rollback for command: {0}." , org.ovirt.engine.core.bll.CommandBase.this . getClass ( ) . getName ( ) ) ; try { getAsyncTaskManager ( ) . cancelTasks ( getReturnValue ( ) . getVdsmTaskIdList ( ) ) ; } catch ( java.lang.Exception e ) { log.errorFormat ( "Failed to cancel tasks for command: {0}." , org.ovirt.engine.core.bll.CommandBase.this . getClass ( ) . getName ( ) ) ; } } } ) ; } }

Target:
public org.ovirt.engine.core.common.asynctasks.AsyncTaskType getAsyncTaskType ( ) { if ( ( getTaskType ( ) ) == ( org.ovirt.engine.core.common.asynctasks.AsyncTaskType.notSupported ) ) { throw new java.lang.UnsupportedOperationException ( ) ; } return getTaskType ( ) ; }
Source:
public void testHotsetNotUpdateableWhenHotsetNotRequested ( ) { org.ovirt.engine.core.utils.ObjectIdentityChecker oic = new org.ovirt.engine.core.utils.ObjectIdentityChecker ( org.ovirt.engine.core.utils.Jedi.class ) ; org.junit.Assert.assertFalse ( "Should be false by default" , oic.isFieldUpdatable ( "name" ) ) ; oic.addHotsetField ( "name" , java.util.EnumSet.of ( VMStatus.Up ) ) ; org.junit.Assert.assertFalse ( "hot set not requested should return false even if field is hot set" , oic.isFieldUpdatable ( null , "name" , null , false ) ) ; }

Target:
public void testHotsetNotUpdateableWhenHotsetNotRequested ( ) { org.ovirt.engine.core.utils.ObjectIdentityChecker oic = new org.ovirt.engine.core.utils.ObjectIdentityChecker ( org.ovirt.engine.core.utils.Jedi.class ) ; org.junit.jupiter.api.Assertions.assertFalse ( oic.isFieldUpdatable ( "name" ) , "Should be false by default" ) ; oic.addHotsetField ( "name" , java.util.EnumSet.of ( VMStatus.Up ) ) ; org.junit.jupiter.api.Assertions.assertFalse ( oic.isFieldUpdatable ( null , "name" , null , false ) , "hot set not requested should return false even if field is hot set" ) ; }
Source:
protected void doTestBadRemove ( boolean canDo , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetEntityExpectations ( 1 ) ; setUpGetGraphicsExpectations ( 1 ) ; setUpGetBallooningExpectations ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveVmTemplate , org.ovirt.engine.core.common.action.VmTemplateParametersBase.class , new java.lang.String [ ] { "VmTemplateId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , canDo , success ) ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
public void testGetWithConsoleSet ( ) throws java.lang.Exception { testGetConsoleAware ( true ) ; }
Source:
private void refresh ( org.ovirt.engine.core.bll.aaa.SessionDataContainer.SessionInfo sessionInfo ) { int softLimitValue = org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.UserSessionTimeOutInterval ) ; if ( softLimitValue > 0 ) { sessionInfo.contentOfSession.put ( org.ovirt.engine.core.bll.aaa.SessionDataContainer.SOFT_LIMIT_PARAMETER_NAME , org.apache.commons.lang.time.DateUtils.addMinutes ( new java.util.Date ( ) , softLimitValue ) ) ; } }

Target:
public final void setData ( java.lang.String sessionId , java.lang.String key , java.lang.Object value ) { org.ovirt.engine.core.bll.aaa.SessionDataContainer.SessionInfo sessionInfo = getSessionInfo ( sessionId ) ; if ( sessionInfo == null ) { sessionInfo = new org.ovirt.engine.core.bll.aaa.SessionDataContainer.SessionInfo ( ) ; sessionInfo.contentOfSession.put ( org.ovirt.engine.core.bll.aaa.SessionDataContainer.ENGINE_SESSION_ID , sessionId ) ; sessionInfo.contentOfSession.put ( org.ovirt.engine.core.bll.aaa.SessionDataContainer.SOFT_LIMIT_INTERVAL_PARAMETER_NAME , org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.UserSessionTimeOutInterval ) ) ; org.ovirt.engine.core.bll.aaa.SessionDataContainer.SessionInfo oldSessionInfo = sessionInfoMap.putIfAbsent ( sessionId , sessionInfo ) ; if ( oldSessionInfo != null ) { sessionInfo = oldSessionInfo ; } } sessionInfo.contentOfSession.put ( key , value ) ; }
Source:
protected boolean isVmNameValidLength ( org.ovirt.engine.core.common.businessentities.VM vm ) { java.lang.String vmName = vm.getName ( ) ; int maxVmNameLengthWindows = org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.MaxVmNameLengthWindows ) ; int maxVmNameLengthNonWindows = org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.MaxVmNameLengthNonWindows ) ; int maxLength = ( osRepository.isWindows ( vm.getVmOsId ( ) ) ) ? maxVmNameLengthWindows : maxVmNameLengthNonWindows ; boolean nameLengthValid = ( vmName.length ( ) ) <= maxLength ; return nameLengthValid ; }

Target:
protected boolean isNicSupportedForPlugUnPlug ( ) { if ( osRepository.hasNicHotplugSupport ( org.ovirt.engine.core.bll.VmCommand.getVm ( ) . getOs ( ) , org.ovirt.engine.core.bll.VmCommand.getVm ( ) . getCompatibilityVersion ( ) ) ) { return true ; } return failValidation ( EngineMessage.ACTION_TYPE_FAILED_GUEST_OS_VERSION_IS_NOT_SUPPORTED ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( ( ( java.lang.Boolean ) ( getResolveMissingConflictRemove ( ) . getEntity ( ) ) ) ) { getResolveMissingConflictCopy ( ) . setEntity ( java.lang.Boolean.FALSE ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( ( ( java.lang.Boolean ) ( getResolveMissingConflictRemove ( ) . getEntity ( ) ) ) ) { getResolveMissingConflictCopy ( ) . setEntity ( java.lang.Boolean.FALSE ) ; } updateConflictActionsAvailability ( ( ( java.lang.Boolean ) ( getResolveMissingConflictRemove ( ) . getEntity ( ) ) ) ) ; }
Source:
private void updateWANDisableEffects ( final org.ovirt.engine.ui.uicommonweb.models.vms.ISpice spice ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetWANDisableEffects ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.SuppressWarnings ( value = "unchecked" ) @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { spice.setWANDisableEffects ( ( ( java.util.List < org.ovirt.engine.ui.uicommonweb.models.vms.WANDisableEffects > ) ( returnValue ) ) ) ; } } ) ) ; }

Target:
private void updateWANDisableEffects ( final org.ovirt.engine.ui.uicommonweb.models.vms.ISpice spice ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getWANDisableEffects ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.SuppressWarnings ( value = "unchecked" ) @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { spice.setWANDisableEffects ( ( ( java.util.List < org.ovirt.engine.ui.uicommonweb.models.vms.WANDisableEffects > ) ( returnValue ) ) ) ; } } ) ) ; }
Source:
public void testRemove ( ) throws java.lang.Exception { initResource ( resource.parent ) ; java.util.List < org.ovirt.engine.core.common.businessentities.ActionGroup > actionGroups = new java.util.ArrayList < > ( ) ; actionGroups.add ( org.ovirt.engine.core.common.businessentities.ActionGroup.forValue ( 1 ) ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.DetachActionGroupsFromRole , org.ovirt.engine.core.common.action.ActionGroupsToRoleParameter.class , new java.lang.String [ ] { "RoleId" , "ActionGroups" } , new java.lang.Object [ ] { GUIDS [ 1 ] , actionGroups } , true , true ) ) ; verifyRemove ( resource.remove ( ) ) ; }

Target:
public void testRemove ( ) throws java.lang.Exception { initResource ( resource.parent ) ; java.util.List < org.ovirt.engine.core.common.businessentities.ActionGroup > actionGroups = new java.util.ArrayList < > ( ) ; actionGroups.add ( org.ovirt.engine.core.common.businessentities.ActionGroup.forValue ( 1 ) ) ; setUriInfo ( setUpActionExpectations ( ActionType.DetachActionGroupsFromRole , org.ovirt.engine.core.common.action.ActionGroupsToRoleParameter.class , new java.lang.String [ ] { "RoleId" , "ActionGroups" } , new java.lang.Object [ ] { GUIDS [ 1 ] , actionGroups } , true , true ) ) ; verifyRemove ( resource.remove ( ) ) ; }
Source:
public void getAllAttachableDisks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.Disk > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.Disk > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllAttachableDisksForVmQueryParameters params = new org.ovirt.engine.core.common.queries.GetAllAttachableDisksForVmQueryParameters ( storagePoolId ) ; params.setVmId ( vmId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllAttachableDisksForVm , params , aQuery ) ; }

Target:
public void getNextAvailableDiskAliasNameByVMId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetNextAvailableDiskAliasNameByVMId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
public void setUsedMemory ( java.lang.Integer value ) { if ( ( ( usedMemory ) == null ) && ( value == null ) ) { return ; } if ( ( ( usedMemory ) == null ) || ( ! ( usedMemory.equals ( value ) ) ) ) { usedMemory = value ; OnPropertyChanged ( new org.ovirt.engine.core.compat.PropertyChangedEventArgs ( "UsedMemory" ) ) ; } }

Target:
public void setThreadsPerCore ( java.lang.String value ) { if ( ( ( threadsPerCore ) == null ) && ( value == null ) ) { return ; } if ( ( ( threadsPerCore ) == null ) || ( ! ( threadsPerCore.equals ( value ) ) ) ) { threadsPerCore = value ; OnPropertyChanged ( new org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ( "ThreadsPerCore" ) ) ; } }
Source:
private boolean isTunnelMigrationUsed ( ) { if ( ! ( org.ovirt.engine.core.common.FeatureSupported.tunnelMigration ( org.ovirt.engine.core.bll.MigrateVmCommand.getVm ( ) . getVdsGroupCompatibilityVersion ( ) ) ) ) { return false ; } return ( org.ovirt.engine.core.bll.MigrateVmCommand.getVm ( ) . getTunnelMigration ( ) ) != null ? org.ovirt.engine.core.bll.MigrateVmCommand.getVm ( ) . getTunnelMigration ( ) : org.ovirt.engine.core.bll.MigrateVmCommand.getVdsGroup ( ) . isTunnelMigration ( ) ; }

Target:
private boolean isTunnelMigrationUsed ( ) { return ( org.ovirt.engine.core.bll.MigrateVmCommand.getVm ( ) . getTunnelMigration ( ) ) != null ? org.ovirt.engine.core.bll.MigrateVmCommand.getVm ( ) . getTunnelMigration ( ) : org.ovirt.engine.core.bll.MigrateVmCommand.getCluster ( ) . isTunnelMigration ( ) ; }
Source:
private void handleVdsLiveSnapshotFailure ( org.ovirt.engine.core.common.errors.VdcBLLException e ) { log.warnFormat ( "Wasn't able to live snapshot due to error: {0}. VM will still be configured to the new created snapshot" , org.apache.commons.lang.exception.ExceptionUtils.getMessage ( e ) ) ; addCustomValue ( "SnapshotName" , org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getSnapshotName ( ) ) ; addCustomValue ( "VmName" , org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVmName ( ) ) ; updateCallStackFromThrowable ( e ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log ( this , AuditLogType.USER_CREATE_LIVE_SNAPSHOT_FINISHED_FAILURE ) ; }

Target:
private void handleVdsLiveSnapshotFailure ( org.ovirt.engine.core.common.errors.VdcBLLException e ) { log.warnFormat ( "Could not perform live snapshot due to error: {0}. VM will still be configured to the new created snapshot" , org.apache.commons.lang.exception.ExceptionUtils.getMessage ( e ) ) ; addCustomValue ( "SnapshotName" , org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getSnapshotName ( ) ) ; addCustomValue ( "VmName" , org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVmName ( ) ) ; updateCallStackFromThrowable ( e ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log ( this , AuditLogType.USER_CREATE_LIVE_SNAPSHOT_FINISHED_FAILURE ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { java.util.ArrayList < java.lang.String > items = ( ( java.util.ArrayList < java.lang.String > ) ( object.getItems ( ) ) ) ; for ( java.lang.String item : items ) { itemsPanel.add ( new com.google.gwt.user.client.ui.Label ( item ) ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { java.util.ArrayList < java.lang.String > items = ( ( java.util.ArrayList < java.lang.String > ) ( object.getItems ( ) ) ) ; for ( java.lang.String item : items ) { itemsPanel.add ( new com.google.gwt.user.client.ui.Label ( getItemTextFormatted ( item ) ) ) ; } }
Source:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.storage.Disk object ) { return object.isBoot ( ) ? getDefaultImage ( ) : null ; }

Target:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.storage.Disk object ) { if ( ( object.getDiskVmElements ( ) . size ( ) ) == 1 ) { if ( object.getDiskVmElements ( ) . iterator ( ) . next ( ) . isBoot ( ) ) { return getDefaultImage ( ) ; } } return null ; }
Source:
public void versionDecreaseLowerVersionThanDC ( ) { createCommandWithOlderVersion ( ) ; org.ovirt.engine.core.dao.StoragePoolDao storagePoolDao2 = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.StoragePoolDao.class ) ; org.mockito.Mockito.when ( storagePoolDao2.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.createStoragePoolLocalFSOldVersion ( ) ) ; org.mockito.Mockito.doReturn ( storagePoolDao2 ) . when ( cmd ) . getStoragePoolDao ( ) ; setupCpu ( ) ; canDoActionFailedWithReason ( VdcBllMessages.ACTION_TYPE_FAILED_CANNOT_DECREASE_COMPATIBILITY_VERSION_UNDER_DC ) ; }

Target:
public void versionDecreaseLowerVersionThanDC ( ) { createCommandWithOlderVersion ( ) ; org.ovirt.engine.core.dao.StoragePoolDao storagePoolDao2 = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.StoragePoolDao.class ) ; org.mockito.Mockito.when ( storagePoolDao2.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.createStoragePoolLocalFSOldVersion ( ) ) ; org.mockito.Mockito.doReturn ( storagePoolDao2 ) . when ( cmd ) . getStoragePoolDao ( ) ; setupCpu ( ) ; canDoActionFailedWithReason ( EngineMessage.ACTION_TYPE_FAILED_CANNOT_DECREASE_COMPATIBILITY_VERSION_UNDER_DC ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult isGlusterDcAndMatchingCompatiblityVersion ( ) { if ( ( ( storagePool.getstorage_pool_type ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageType.GLUSTERFS ) ) && ( ! ( org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > GetValue ( ConfigValues.GlusterFsStorageEnabled , storagePool.getcompatibility_version ( ) . toString ( ) ) ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.DATA_CENTER_GLUSTER_STORAGE_NOT_SUPPORTED_IN_CURRENT_VERSION ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult isGlusterDcAndMatchingCompatiblityVersion ( ) { if ( ( ( storagePool.getStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageType.GLUSTERFS ) ) && ( ! ( org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > GetValue ( ConfigValues.GlusterFsStorageEnabled , storagePool.getcompatibility_version ( ) . toString ( ) ) ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.DATA_CENTER_GLUSTER_STORAGE_NOT_SUPPORTED_IN_CURRENT_VERSION ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
public void writeData ( java.io.ObjectOutputStream dos ) { try { writeString ( this . time , dos ) ; writeString ( this . message , dos ) ; } catch ( java.io.IOException e ) { throw new java.lang.RuntimeException ( e ) ; } }

Target:
public void readData ( java.io.ObjectInputStream dis ) { synchronized ( ovirt_engine_dwh.sampletimekeepingjob_3_2.SampleTimeKeepingJob.row6Struct.commonByteArrayLock_OVIRT_ENGINE_DWH_SampleTimeKeepingJob ) { try { int length = 0 ; this . var_name = readString ( dis ) ; this . var_value = readString ( dis ) ; } catch ( java.io.IOException e ) { throw new java.lang.RuntimeException ( e ) ; } } }
Source:
public static void getClusterListByName ( 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 ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( ( "Cluster: name=" + name ) + " sortby name" ) , org.ovirt.engine.core.common.interfaces.SearchType.Cluster ) , aQuery ) ; }

Target:
public static void getClusterNetworkList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { if ( ( aQuery.converterCallback ) == null ) { 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.network.Network > ( ) ; } return source ; } } ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllNetworksByClusterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , aQuery ) ; }
Source:
public void isTemplateNameUnique ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String templateName , org.ovirt.engine.core.compat.Guid datacenterId ) { 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.core.common.queries.NameQueryParameters params = new org.ovirt.engine.core.common.queries.NameQueryParameters ( templateName ) ; params.setDatacenterId ( datacenterId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.IsVmTemlateWithSameNameExist , params , aQuery ) ; }

Target:
public void isTemplateNameUnique ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String templateName , org.ovirt.engine.core.compat.Guid datacenterId ) { 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 ) ) ) ; } } ; org.ovirt.engine.core.common.queries.NameQueryParameters params = new org.ovirt.engine.core.common.queries.NameQueryParameters ( templateName ) ; params.setDatacenterId ( datacenterId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.IsVmTemlateWithSameNameExist , params , aQuery ) ; }
Source:
public void testUpdate ( ) { org.ovirt.engine.core.common.businessentities.profiles.CpuProfile profile = dao.get ( FixturesTool.CPU_PROFILE_1 ) ; org.junit.Assert.assertNotNull ( profile ) ; org.junit.Assert.assertEquals ( FixturesTool.QOS_ID_4 , profile.getQosId ( ) ) ; profile.setQosId ( FixturesTool.QOS_ID_5 ) ; profile.setDescription ( "desc1" ) ; dao.update ( profile ) ; org.ovirt.engine.core.common.businessentities.profiles.CpuProfile result = dao.get ( profile.getId ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( profile , result ) ; }

Target:
public void testUpdate ( ) { org.ovirt.engine.core.common.businessentities.profiles.CpuProfile profile = dao.get ( FixturesTool.CPU_PROFILE_2 ) ; org.junit.Assert.assertNotNull ( profile ) ; org.junit.Assert.assertEquals ( FixturesTool.QOS_ID_4 , profile.getQosId ( ) ) ; profile.setQosId ( FixturesTool.QOS_ID_5 ) ; profile.setDescription ( "desc1" ) ; dao.update ( profile ) ; org.ovirt.engine.core.common.businessentities.profiles.CpuProfile result = dao.get ( profile.getId ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( profile , result ) ; }
Source:
public java.lang.String toString ( ) { java.lang.StringBuilder builder = new java.lang.StringBuilder ( ) ; builder.append ( "NetworkCluster {id=" ) . append ( getId ( ) ) . append ( ", status=" ) . append ( getstatus ( ) ) . append ( ", isDisplay=" ) . append ( isDisplay ( ) ) . append ( ", required=" ) . append ( isRequired ( ) ) . append ( "}" ) ; return builder.toString ( ) ; }

Target:
public java.lang.String toString ( ) { java.lang.StringBuilder builder = new java.lang.StringBuilder ( ) ; builder.append ( "NetworkCluster {id=" ) . append ( getId ( ) ) . append ( ", status=" ) . append ( getStatus ( ) ) . append ( ", display=" ) . append ( isDisplay ( ) ) . append ( ", required=" ) . append ( isRequired ( ) ) . append ( "}" ) ; return builder.toString ( ) ; }
Source:
private void setUpGetBallooningExpectations ( int times , int index ) throws java.lang.Exception { for ( int i = 0 ; i < times ; i ++ ) { setUpGetEntityExpectations ( VdcQueryType.IsBalloonEnabled , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ index ] } , true ) ; } }

Target:
protected void setUpGetPayloadExpectations ( int times , int index ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.VmPayload payload = new org.ovirt.engine.core.common.businessentities.VmPayload ( ) ; for ( int i = 0 ; i < times ; i ++ ) { setUpGetEntityExpectations ( VdcQueryType.GetVmPayload , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ index ] } , payload ) ; } }