auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > mockAllImages ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > images = mockImages ( ) ; org.ovirt.engine.core.common.businessentities.DiskImage image3 = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; image3.setImageId ( org.ovirt.engine.core.bll.RemoveDiskSnapshotsCommandTest.IMAGE_ID_3 ) ; image3.setStorageIds ( new java.util.ArrayList ( java.util.Arrays.asList ( org.ovirt.engine.core.bll.RemoveDiskSnapshotsCommandTest.STORAGE_DOMAIN_ID ) ) ) ; images.add ( image3 ) ; return images ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > mockAllImages ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > images = mockImages ( ) ; org.ovirt.engine.core.common.businessentities.storage.DiskImage image3 = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; image3.setImageId ( org.ovirt.engine.core.bll.RemoveDiskSnapshotsCommandTest.IMAGE_ID_3 ) ; image3.setStorageIds ( new java.util.ArrayList ( java.util.Arrays.asList ( org.ovirt.engine.core.bll.RemoveDiskSnapshotsCommandTest.STORAGE_DOMAIN_ID ) ) ) ; images.add ( image3 ) ; return images ; }
Source:
public void nameIsAlreadyUsed ( ) { org.mockito.Mockito.when ( clusterDao.getByName ( org.mockito.ArgumentMatchers.any ( ) , org.mockito.ArgumentMatchers.anyBoolean ( ) ) ) . thenReturn ( java.util.Collections.singletonList ( org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.Cluster.class ) ) ) ; org.junit.Assert.assertThat ( validator.nameNotUsed ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.CLUSTER_CANNOT_DO_ACTION_NAME_IN_USE ) ) ; }

Target:
public void nameIsAlreadyUsed ( ) { org.mockito.Mockito.when ( clusterDao.getByName ( org.mockito.ArgumentMatchers.any ( ) , org.mockito.ArgumentMatchers.anyBoolean ( ) ) ) . thenReturn ( java.util.Collections.singletonList ( org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.Cluster.class ) ) ) ; org.hamcrest.MatcherAssert.assertThat ( validator.nameNotUsed ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.CLUSTER_CANNOT_DO_ACTION_NAME_IN_USE ) ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { testServlet = new org.ovirt.engine.core.WelcomeServlet ( ) ; testServlet.setBackend ( mockBackend ) ; testServlet.init ( mockBrandingManager ) ; mockBackendQuery ( VdcQueryType.GetConfigurationValue , "oVirtVersion" ) ; org.mockito.Mockito.when ( mockBrandingManager.getBrandingThemes ( ) ) . thenReturn ( new java.util.ArrayList < org.ovirt.engine.core.branding.BrandingTheme > ( ) ) ; org.mockito.Mockito.when ( mockBrandingManager.getWelcomeSections ( org.mockito.Matchers.any ( java.util.Locale.class ) ) ) . thenReturn ( "Welcome Section HTML" ) ; }

Target:
public java.lang.String getCurrentSsoSessionUser ( javax.servlet.http.HttpServletRequest request , javax.servlet.http.HttpServletResponse response , java.lang.String token ) { return "admin@internal" ; }
Source:
public static void getTemplateById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmTemplate , new org.ovirt.engine.core.common.queries.GetVmTemplateParameters ( templateId ) , aQuery ) ; }

Target:
public static void getGlusterHostsNewlyAdded ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId , boolean isFingerprintRequired ) { 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.GetAddedGlusterServers , new org.ovirt.engine.core.common.queries.gluster.AddedGlusterServersParameters ( clusterId , isFingerprintRequired ) , aQuery ) ; }
Source:
public org.ovirt.engine.api.model.SerialNumber adapt ( org.ovirt.engine.api.v3.types.V3SerialNumber from ) { org.ovirt.engine.api.model.SerialNumber to = new org.ovirt.engine.api.model.SerialNumber ( ) ; if ( from.isSetPolicy ( ) ) { to.setPolicy ( from.getPolicy ( ) ) ; } if ( from.isSetValue ( ) ) { to.setValue ( from.getValue ( ) ) ; } return to ; }

Target:
public org.ovirt.engine.api.model.SerialNumber adapt ( org.ovirt.engine.api.v3.types.V3SerialNumber from ) { org.ovirt.engine.api.model.SerialNumber to = new org.ovirt.engine.api.model.SerialNumber ( ) ; if ( from.isSetPolicy ( ) ) { to.setPolicy ( org.ovirt.engine.api.model.SerialNumberPolicy.fromValue ( from.getPolicy ( ) ) ) ; } if ( from.isSetValue ( ) ) { to.setValue ( from.getValue ( ) ) ; } return to ; }
Source:
public void thpDefaultFalseTest ( ) { org.ovirt.engine.core.common.businessentities.Cluster cluster = new org.ovirt.engine.core.common.businessentities.Cluster ( ) ; cluster.setVersion ( new org.ovirt.engine.api.restapi.types.Version ( ) { { setMajor ( 2 ) ; setMinor ( 0 ) ; } } ) ; org.ovirt.engine.core.common.businessentities.Cluster transform = getMapper ( ) . map ( cluster , null ) ; assertEquals ( transform.getTransparentHugepages ( ) , false ) ; }

Target:
public void thpDefaultFalseTest ( ) { org.ovirt.engine.core.common.businessentities.Cluster cluster = new org.ovirt.engine.core.common.businessentities.Cluster ( ) ; cluster.setVersion ( new org.ovirt.engine.api.restapi.types.Version ( ) { { setMajor ( 2 ) ; setMinor ( 0 ) ; } } ) ; org.ovirt.engine.core.common.businessentities.Cluster transform = getMapper ( ) . map ( cluster , null ) ; assertFalse ( transform.getTransparentHugepages ( ) ) ; }
Source:
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.Provider > ( ) ; } java.util.Collections.sort ( ( ( java.util.List < org.ovirt.engine.core.common.businessentities.Provider > ) ( source ) ) , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return source ; }

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 testGetByClusterId ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity > volumes = dao.getByClusterId ( org.ovirt.engine.core.dao.gluster.GlusterVolumeDaoTest.CLUSTER_ID ) ; org.junit.Assert.assertNotNull ( volumes ) ; org.junit.Assert.assertEquals ( 2 , volumes.size ( ) ) ; org.junit.Assert.assertTrue ( volumes.contains ( existingDistVol ) ) ; org.junit.Assert.assertTrue ( volumes.contains ( existingReplVol ) ) ; }

Target:
public void testGetByClusterId ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity > volumes = dao.getByClusterId ( org.ovirt.engine.core.dao.gluster.GlusterVolumeDaoTest.CLUSTER_ID ) ; org.junit.jupiter.api.Assertions.assertNotNull ( volumes ) ; org.junit.jupiter.api.Assertions.assertEquals ( 2 , volumes.size ( ) ) ; org.junit.jupiter.api.Assertions.assertTrue ( volumes.contains ( existingDistVol ) ) ; org.junit.jupiter.api.Assertions.assertTrue ( volumes.contains ( existingReplVol ) ) ; }
Source:
public void testGetYesterdayHttpDate ( ) { java.util.Calendar calendar = org.mockito.Mockito.spy ( java.util.Calendar.getInstance ( java.util.TimeZone.getTimeZone ( org.ovirt.engine.ui.frontend.server.gwt.GwtCachingFilterTest.GMT ) , java.util.Locale.US ) ) ; calendar.clear ( ) ; calendar.set ( 2000 , 0 , 5 , 15 , 0 ) ; java.lang.String result = testFilter.getYesterdayHttpDate ( calendar ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertTrue ( result.contains ( "04 Jan 2000 15:00:00" ) ) ; org.mockito.Mockito.verify ( calendar ) . add ( java.util.Calendar.DAY_OF_MONTH , ( - 1 ) ) ; }

Target:
public void testGetYesterdayHttpDate ( ) { java.util.Calendar calendar = org.mockito.Mockito.spy ( java.util.Calendar.getInstance ( java.util.TimeZone.getTimeZone ( org.ovirt.engine.ui.frontend.server.caching.CachingFilterTest.GMT ) , java.util.Locale.US ) ) ; calendar.clear ( ) ; calendar.set ( 2000 , 0 , 5 , 15 , 0 ) ; java.lang.String result = testFilter.getYesterdayHttpDate ( calendar ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertTrue ( result.contains ( "04 Jan 2000 15:00:00" ) ) ; org.mockito.Mockito.verify ( calendar ) . add ( java.util.Calendar.DAY_OF_MONTH , ( - 1 ) ) ; }
Source:
protected R performUpdate ( R incoming , org.ovirt.engine.api.restapi.resource.EntityIdResolver entityResolver , org.ovirt.engine.core.common.action.VdcActionType update , org.ovirt.engine.api.restapi.resource.AbstractBackendSubResource.ParametersProvider < R , Q > updateProvider ) { Q entity = getEntity ( entityResolver , true ) ; validateUpdate ( incoming , org.ovirt.engine.api.restapi.resource.AbstractBackendSubResource.map ( entity ) ) ; performAction ( update , updateProvider.getParameters ( incoming , entity ) ) ; return addLinks ( populate ( map ( getEntity ( entityResolver , false ) ) , entity ) ) ; }

Target:
protected R performUpdate ( R incoming , org.ovirt.engine.api.restapi.resource.EntityIdResolver < org.ovirt.engine.core.compat.Guid > entityResolver , org.ovirt.engine.core.common.action.VdcActionType update , org.ovirt.engine.api.restapi.resource.AbstractBackendSubResource.ParametersProvider < R , Q > updateProvider ) { Q entity = getEntity ( entityResolver , true ) ; validateUpdate ( incoming , org.ovirt.engine.api.restapi.resource.AbstractBackendSubResource.map ( entity ) ) ; entity = doUpdate ( incoming , entity , entityResolver , update , updateProvider ) ; R model = org.ovirt.engine.api.restapi.resource.AbstractBackendSubResource.map ( entity ) ; org.ovirt.engine.api.restapi.resource.AbstractBackendSubResource.deprecatedPopulate ( model , entity ) ; return addLinks ( org.ovirt.engine.api.restapi.resource.AbstractBackendSubResource.doPopulate ( model , entity ) ) ; }
Source:
private org.ovirt.engine.core.dao.ClusterDao mockCluster ( ) { org.ovirt.engine.core.dao.ClusterDao mock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.ClusterDao.class ) ; cluster = new org.ovirt.engine.core.common.businessentities.Cluster ( ) ; cluster.setEmulatedMachine ( "pc-1.0" ) ; org.mockito.Mockito.when ( mock.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( cluster ) ; return mock ; }

Target:
private org.ovirt.engine.core.dao.ClusterDao mockCluster ( ) { org.ovirt.engine.core.dao.ClusterDao mock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.ClusterDao.class ) ; cluster = new org.ovirt.engine.core.common.businessentities.Cluster ( ) ; cluster.setEmulatedMachine ( "pc-1.0" ) ; cluster.setCompatibilityVersion ( org.ovirt.engine.core.compat.Version.getLast ( ) ) ; org.mockito.Mockito.when ( mock.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( cluster ) ; return mock ; }
Source:
private void fillMacAddressIfMissing ( org.ovirt.engine.core.common.businessentities.network.VmNic iface ) { if ( ( org.apache.commons.lang.StringUtils.isEmpty ( iface.getMacAddress ( ) ) ) && ( ( org.ovirt.engine.core.bll.ImportVmCommandBase.getMacPool ( ) . getAvailableMacsCount ( ) ) > 0 ) ) { iface.setMacAddress ( org.ovirt.engine.core.bll.ImportVmCommandBase.getMacPool ( ) . allocateNewMac ( ) ) ; } }

Target:
private void fillMacAddressIfMissing ( org.ovirt.engine.core.common.businessentities.network.VmNic iface ) { if ( ( org.apache.commons.lang.StringUtils.isEmpty ( iface.getMacAddress ( ) ) ) && ( ( macPool.getAvailableMacsCount ( ) ) > 0 ) ) { iface.setMacAddress ( macPool.allocateNewMac ( ) ) ; } }
Source:
protected void afterUpdate ( ) { boolean newSizeUnderCurrentConsumption = org.ovirt.engine.core.bll.quota.QuotaManager.getInstance ( ) . isStorageQuotaExceeded ( getQuota ( ) . getId ( ) ) ; if ( newSizeUnderCurrentConsumption ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; logable.addCustomValue ( "QuotaName" , getQuotaName ( ) ) ; auditLogDirector.log ( logable , AuditLogType.QUOTA_STORAGE_RESIZE_LOWER_THEN_CONSUMPTION ) ; } }

Target:
protected void afterUpdate ( ) { boolean newSizeUnderCurrentConsumption = getQuotaManager ( ) . isStorageQuotaExceeded ( getQuota ( ) . getId ( ) ) ; if ( newSizeUnderCurrentConsumption ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; logable.addCustomValue ( "QuotaName" , getQuotaName ( ) ) ; auditLogDirector.log ( logable , AuditLogType.QUOTA_STORAGE_RESIZE_LOWER_THEN_CONSUMPTION ) ; } }
Source:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { assertEquals ( "" , query ) ; setUpEntityQueryExpectations ( QueryType.GetVdsInterfacesByVdsId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.PARENT_GUID } , org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.setUpInterfaces ( ) , failure ) ; }

Target:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { org.junit.Assert.assertEquals ( "" , query ) ; setUpEntityQueryExpectations ( QueryType.GetVdsInterfacesByVdsId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.PARENT_GUID } , org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.setUpInterfaces ( ) , failure ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.event_subscriber mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.event_subscriber entity = new org.ovirt.engine.core.common.businessentities.event_subscriber ( ) ; entity.setevent_up_name ( rs.getString ( "event_up_name" ) ) ; entity.setmethod_id ( rs.getInt ( "method_id" ) ) ; entity.setmethod_address ( rs.getString ( "method_address" ) ) ; entity.setsubscriber_id ( org.ovirt.engine.core.compat.Guid.createGuidFromStringDefaultEmpty ( rs.getString ( "subscriber_id" ) ) ) ; entity.settag_name ( rs.getString ( "tag_name" ) ) ; return entity ; }

Target:
public org.ovirt.engine.core.common.businessentities.event_subscriber mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.event_subscriber entity = new org.ovirt.engine.core.common.businessentities.event_subscriber ( ) ; entity.setevent_up_name ( rs.getString ( "event_up_name" ) ) ; entity.setmethod_id ( rs.getInt ( "method_id" ) ) ; entity.setmethod_address ( rs.getString ( "method_address" ) ) ; entity.setsubscriber_id ( getGuidDefaultEmpty ( rs , "subscriber_id" ) ) ; entity.settag_name ( rs.getString ( "tag_name" ) ) ; return entity ; }
Source:
public void testStringSubstitutionWithList ( ) { org.ovirt.engine.core.common.interfaces.ErrorTranslator et = new org.ovirt.engine.core.utils.ErrorTranslatorImpl ( org.ovirt.engine.core.utils.ErrorTranslatorTest.FILENAME ) ; java.util.List < java.lang.String > error = et.TranslateErrorText ( java.util.Arrays.asList ( org.ovirt.engine.core.utils.ErrorTranslatorTest.TEST_KEY_WITH_REPLACEMENT , "$action SOMEACTION" , "$type SOME Type" ) ) ; java.lang.String result = "Cannot SOMEACTION SOME Type. VM's Image doesn't exist." ; assertTrue ( "Size" , ( ( error.size ( ) ) == 1 ) ) ; assertEquals ( "String should equal" , result , error.get ( 0 ) ) ; }

Target:
public void testStringSubstitutionWithList ( ) { org.ovirt.engine.core.common.interfaces.ErrorTranslator et = new org.ovirt.engine.core.utils.ErrorTranslatorImpl ( org.ovirt.engine.core.utils.ErrorTranslatorTest.FILENAME ) ; java.util.List < java.lang.String > error = et.TranslateErrorText ( java.util.Arrays.asList ( org.ovirt.engine.core.utils.ErrorTranslatorTest.TEST_KEY_WITH_REPLACEMENT , "$action SOMEACTION" , "$type SOME Type" ) ) ; java.lang.String result = "Cannot SOMEACTION SOME Type. VM's Image doesn't exist." ; org.junit.Assert.assertTrue ( "Size" , ( ( error.size ( ) ) == 1 ) ) ; org.junit.Assert.assertEquals ( "String should equal" , result , error.get ( 0 ) ) ; }
Source:
private org.ovirt.engine.ui.frontend.server.dashboard.Dashboard populateUtilizationCache ( ) throws org.ovirt.engine.ui.frontend.server.dashboard.DashboardDataException { long startTime = java.lang.System.currentTimeMillis ( ) ; org.ovirt.engine.ui.frontend.server.dashboard.Dashboard dashboard = getDashboard ( ) ; long endTime = java.lang.System.currentTimeMillis ( ) ; org.ovirt.engine.ui.frontend.server.dashboard.DashboardDataServlet.dashboardCache.put ( org.ovirt.engine.ui.frontend.server.dashboard.DashboardDataServlet.UTILIZATION_KEY , dashboard , org.ovirt.engine.ui.frontend.server.dashboard.DashboardDataServlet.UTILIZATION_CACHE_UPDATE_INTERVAL , java.util.concurrent.TimeUnit.SECONDS ) ; org.ovirt.engine.ui.frontend.server.dashboard.DashboardDataServlet.log.debug ( "Dashboard utilization cache updated in {}ms" , ( endTime - startTime ) ) ; return dashboard ; }

Target:
private org.ovirt.engine.ui.frontend.server.dashboard.Dashboard getDashboardFromCache ( ) throws org.ovirt.engine.ui.frontend.server.dashboard.DashboardDataException { org.ovirt.engine.ui.frontend.server.dashboard.Dashboard dashboard ; org.ovirt.engine.ui.frontend.server.dashboard.Inventory inventory ; synchronized ( org.ovirt.engine.ui.frontend.server.dashboard.DashboardDataServlet.UTILIZATION_LOCK ) { dashboard = dashboardCache.get ( org.ovirt.engine.ui.frontend.server.dashboard.DashboardDataServlet.UTILIZATION_KEY ) ; if ( dashboard == null ) { dashboard = populateUtilizationCache ( ) ; } inventory = inventoryCache.get ( org.ovirt.engine.ui.frontend.server.dashboard.DashboardDataServlet.INVENTORY_KEY ) ; if ( inventory == null ) { inventory = populateInventoryCache ( ) ; } } dashboard.setInventory ( inventory ) ; return dashboard ; }
Source:
private static int compDigitSequence ( java.lang.String seq1 , java.lang.String seq2 , boolean caseSensitive ) { int compRes = ( ( java.lang.Integer ) ( java.lang.Integer.parseInt ( seq1 ) ) ) . compareTo ( java.lang.Integer.parseInt ( seq2 ) ) ; return compRes == 0 ? org.ovirt.engine.core.common.businessentities.comparators.LexoNumericComparator.compNonDigitSequence ( seq1 , seq2 , caseSensitive ) : compRes ; }

Target:
private static int compDigitSequence ( java.lang.String seq1 , java.lang.String seq2 , boolean caseSensitive ) { int compRes = new java.math.BigInteger ( seq1 ) . compareTo ( new java.math.BigInteger ( seq2 ) ) ; return compRes == 0 ? org.ovirt.engine.core.common.businessentities.comparators.LexoNumericComparator.compNonDigitSequence ( seq1 , seq2 , caseSensitive ) : compRes ; }
Source:
public static void getMaxNumOfVmSockets ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String version ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 1 ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxNumOfVmSockets ) ; tempVar.setVersion ( version ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( tempVar , aQuery ) ; }

Target:
public void getClusterList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , 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 ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( source ) ) ; java.util.Collections.sort ( list , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVdsGroupsByStoragePoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }
Source:
public org.ovirt.engine.sdk.decorators.Cluster add ( org.ovirt.engine.sdk.decorators.Cluster cluster ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = ( SLASH ) + ( getName ( ) ) ; java.util.List < org.apache.http.Header > headers = new org.ovirt.engine.sdk.utils.HttpHeaderBuilder ( ) . build ( ) ; url = new org.ovirt.engine.sdk.utils.UrlBuilder ( url ) . build ( ) ; return getProxy ( ) . add ( url , cluster , org.ovirt.engine.sdk.entities.Cluster.class , org.ovirt.engine.sdk.decorators.Cluster.class , headers ) ; }

Target:
public org.ovirt.engine.sdk.decorators.Cluster add ( org.ovirt.engine.sdk.decorators.Cluster cluster ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = ( SLASH ) + ( getName ( ) ) ; org.ovirt.engine.sdk.utils.HttpHeaderBuilder headersBuilder = new org.ovirt.engine.sdk.utils.HttpHeaderBuilder ( ) ; java.util.List < org.apache.http.Header > headers = headersBuilder.build ( ) ; org.ovirt.engine.sdk.utils.UrlBuilder urlBuilder = new org.ovirt.engine.sdk.utils.UrlBuilder ( url ) ; url = urlBuilder.build ( ) ; return getProxy ( ) . add ( url , cluster , org.ovirt.engine.sdk.entities.Cluster.class , org.ovirt.engine.sdk.decorators.Cluster.class , headers ) ; }
Source:
public void Executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result1 ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel vmListModel1 = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel ) ( result1.getState ( ) ) ) ; vmListModel1.getWindow ( ) . StopProgress ( ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase retVal = result1.getReturnValue ( ) ; if ( ( retVal != null ) && ( retVal.getSucceeded ( ) ) ) { vmListModel1.cancel ( ) ; } }

Target:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result1 ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel vmListModel1 = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel ) ( result1.getState ( ) ) ) ; vmListModel1.getWindow ( ) . StopProgress ( ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase retVal = result1.getReturnValue ( ) ; if ( ( retVal != null ) && ( retVal.getSucceeded ( ) ) ) { vmListModel1.cancel ( ) ; } }
Source:
protected boolean canDoAction ( ) { org.ovirt.engine.core.bll.VdsValidator vdsValidator = new org.ovirt.engine.core.bll.VdsValidator ( getVds ( ) ) ; return ( ( validate ( vdsValidator.exists ( ) ) ) && ( validate ( vdsValidator.isUp ( ) ) ) ) && ( validate ( validateMinimumVersionSupport ( ) ) ) ; }

Target:
protected boolean canDoAction ( ) { org.ovirt.engine.core.bll.validator.HostValidator hostValidator = new org.ovirt.engine.core.bll.validator.HostValidator ( getVds ( ) ) ; return ( ( validate ( hostValidator.hostExists ( ) ) ) && ( validate ( hostValidator.isUp ( ) ) ) ) && ( validate ( validateMinimumVersionSupport ( ) ) ) ; }
Source:
private void restartVdsVms ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > vms = org.ovirt.engine.core.bll.pm.VdsKdumpDetectionCommand.getVmDAO ( ) . getAllRunningForVds ( org.ovirt.engine.core.bll.pm.VdsKdumpDetectionCommand.getVdsId ( ) ) ; if ( ! ( vms.isEmpty ( ) ) ) { org.ovirt.engine.core.bll.RestartVdsVmsOperation restartVmsOper = new org.ovirt.engine.core.bll.RestartVdsVmsOperation ( org.ovirt.engine.core.bll.pm.VdsKdumpDetectionCommand.getContext ( ) , org.ovirt.engine.core.bll.pm.VdsKdumpDetectionCommand.getVds ( ) ) ; restartVmsOper.restartVms ( vms ) ; runVdsCommand ( VDSCommandType.UpdateVdsVMsCleared , new org.ovirt.engine.core.common.vdscommands.UpdateVdsVMsClearedVDSCommandParameters ( org.ovirt.engine.core.bll.pm.VdsKdumpDetectionCommand.getVds ( ) . getId ( ) ) ) ; } }

Target:
private void restartVdsVms ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > vms = org.ovirt.engine.core.bll.pm.VdsKdumpDetectionCommand.getVmDao ( ) . getAllRunningForVds ( org.ovirt.engine.core.bll.pm.VdsKdumpDetectionCommand.getVdsId ( ) ) ; if ( ! ( vms.isEmpty ( ) ) ) { org.ovirt.engine.core.bll.RestartVdsVmsOperation restartVmsOper = new org.ovirt.engine.core.bll.RestartVdsVmsOperation ( org.ovirt.engine.core.bll.pm.VdsKdumpDetectionCommand.getContext ( ) , org.ovirt.engine.core.bll.pm.VdsKdumpDetectionCommand.getVds ( ) ) ; restartVmsOper.restartVms ( vms ) ; runVdsCommand ( VDSCommandType.UpdateVdsVMsCleared , new org.ovirt.engine.core.common.vdscommands.UpdateVdsVMsClearedVDSCommandParameters ( org.ovirt.engine.core.bll.pm.VdsKdumpDetectionCommand.getVds ( ) . getId ( ) ) ) ; } }
Source:
public void hostNNotUsed ( ) { org.mockito.Mockito.when ( oldHost.getHostName ( ) ) . thenReturn ( generateRandomName ( ) ) ; org.mockito.Mockito.when ( host.getHostName ( ) ) . thenReturn ( generateRandomName ( ) ) ; org.mockito.Mockito.when ( hostDao.getAllForHostname ( org.mockito.Matchers.any ( java.lang.String.class ) ) ) . thenReturn ( java.util.Collections.emptyList ( ) ) ; org.junit.Assert.assertThat ( validator.hostNameNotUsed ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void hostNNotUsed ( ) { org.mockito.Mockito.when ( oldHost.getHostName ( ) ) . thenReturn ( generateRandomName ( ) ) ; org.mockito.Mockito.when ( host.getHostName ( ) ) . thenReturn ( generateRandomName ( ) ) ; org.mockito.Mockito.when ( hostDao.getAllForHostname ( org.mockito.ArgumentMatchers.any ( java.lang.String.class ) ) ) . thenReturn ( java.util.Collections.emptyList ( ) ) ; org.junit.Assert.assertThat ( validator.hostNameNotUsed ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
public org.ovirt.engine.core.common.AuditLogType getAuditLogTypeValue ( ) { switch ( org.ovirt.engine.core.bll.AddDiskCommand.getActionState ( ) ) { case EXECUTE : if ( ( org.ovirt.engine.core.bll.AddDiskCommand.getParameters ( ) . getDiskInfo ( ) . getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.Disk.DiskStorageType.IMAGE ) ) { return getExecuteAuditLogTypeValue ( org.ovirt.engine.core.bll.AddDiskCommand.getSucceeded ( ) ) ; } else { return getEndSuccessAuditLogTypeValue ( org.ovirt.engine.core.bll.AddDiskCommand.getSucceeded ( ) ) ; } case END_SUCCESS : return getEndSuccessAuditLogTypeValue ( org.ovirt.engine.core.bll.AddDiskCommand.getSucceeded ( ) ) ; default : return org.ovirt.engine.core.common.AuditLogType.USER_ADD_DISK_FINISHED_FAILURE ; } }

Target:
public org.ovirt.engine.core.common.AuditLogType getAuditLogTypeValue ( ) { switch ( org.ovirt.engine.core.bll.AddDiskCommand.getActionState ( ) ) { case EXECUTE : if ( ( org.ovirt.engine.core.bll.AddDiskCommand.getParameters ( ) . getDiskInfo ( ) . getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.DiskStorageType.IMAGE ) ) { return getExecuteAuditLogTypeValue ( org.ovirt.engine.core.bll.AddDiskCommand.getSucceeded ( ) ) ; } else { return getEndSuccessAuditLogTypeValue ( org.ovirt.engine.core.bll.AddDiskCommand.getSucceeded ( ) ) ; } case END_SUCCESS : return getEndSuccessAuditLogTypeValue ( org.ovirt.engine.core.bll.AddDiskCommand.getSucceeded ( ) ) ; default : return org.ovirt.engine.core.common.AuditLogType.USER_ADD_DISK_FINISHED_FAILURE ; } }
Source:
public void testConflictedUpdate ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 ) ; org.ovirt.engine.api.model.Network model = org.ovirt.engine.api.restapi.resource.AbstractBackendNetworksResourceTest.getModel ( 1 ) ; model.setId ( GUIDS [ 1 ] . toString ( ) ) ; try { resource.update ( model ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyImmutabilityConstraint ( wae ) ; } }

Target:
public void testConflictedUpdate ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 ) ; org.ovirt.engine.api.model.Network model = org.ovirt.engine.api.restapi.resource.AbstractBackendNetworksResourceTest.getModel ( 1 ) ; model.setId ( GUIDS [ 1 ] . toString ( ) ) ; try { resource.update ( model ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyImmutabilityConstraint ( wae ) ; } }
Source:
private void updateDiskProfile ( org.ovirt.engine.core.compat.Guid storageDomainId , final org.ovirt.engine.ui.uicommonweb.models.ListModel < org.ovirt.engine.core.common.businessentities.profiles.DiskProfile > diskProfiles ) { org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetDiskProfilesByStorageDomainId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , new org.ovirt.engine.ui.frontend.AsyncQuery ( new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.profiles.DiskProfile > fetchedDiskProfiles = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; org.ovirt.engine.ui.uicommonweb.models.storage.DisksAllocationModel.this . setDiskProfilesList ( diskProfiles , fetchedDiskProfiles ) ; } } ) ) ; }

Target:
private void updateDiskProfile ( org.ovirt.engine.core.compat.Guid storageDomainId , final org.ovirt.engine.ui.uicommonweb.models.ListModel < org.ovirt.engine.core.common.businessentities.profiles.DiskProfile > diskProfiles ) { org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetDiskProfilesByStorageDomainId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , new org.ovirt.engine.ui.uicommonweb.models.storage.AsyncQuery ( new org.ovirt.engine.ui.frontend.AsyncCallback < org.ovirt.engine.core.common.queries.VdcQueryReturnValue > ( ) { @ java.lang.Override public void onSuccess ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.profiles.DiskProfile > fetchedDiskProfiles = returnValue.getReturnValue ( ) ; org.ovirt.engine.ui.uicommonweb.models.storage.DisksAllocationModel.this . setDiskProfilesList ( diskProfiles , fetchedDiskProfiles ) ; } } ) ) ; }
Source:
public java.lang.Void runInTransaction ( ) { for ( org.ovirt.engine.core.common.businessentities.DiskImage disk : disks ) { org.ovirt.engine.core.common.action.VdcReturnValueBase vdcRetValue = runInternalActionWithTasksContext ( getImagesActionType ( ) , buildModeOrCopyImageGroupParameters ( containerID , disk ) ) ; getReturnValue ( ) . getVdsmTaskIdList ( ) . addAll ( vdcRetValue.getInternalVdsmTaskIdList ( ) ) ; } return null ; }

Target:
public java.lang.Void runInTransaction ( ) { for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage disk : disks ) { org.ovirt.engine.core.common.action.VdcReturnValueBase vdcRetValue = runInternalActionWithTasksContext ( getImagesActionType ( ) , buildModeOrCopyImageGroupParameters ( containerID , disk ) ) ; getReturnValue ( ) . getVdsmTaskIdList ( ) . addAll ( vdcRetValue.getInternalVdsmTaskIdList ( ) ) ; } return null ; }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.bll.provider.AddProviderCommand.getParameters ( ) . getProvider ( ) . setId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; org.ovirt.engine.core.bll.provider.AddProviderCommand.getDbFacade ( ) . getNetworkProviderDao ( ) . save ( org.ovirt.engine.core.bll.provider.AddProviderCommand.getParameters ( ) . getProvider ( ) ) ; org.ovirt.engine.core.bll.provider.AddProviderCommand.getReturnValue ( ) . setActionReturnValue ( org.ovirt.engine.core.bll.provider.AddProviderCommand.getParameters ( ) . getProvider ( ) . getId ( ) ) ; org.ovirt.engine.core.bll.provider.AddProviderCommand.setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { getProvider ( ) . setId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; org.ovirt.engine.core.bll.provider.AddProviderCommand.getDbFacade ( ) . getProviderDao ( ) . save ( getProvider ( ) ) ; org.ovirt.engine.core.bll.provider.AddProviderCommand.getReturnValue ( ) . setActionReturnValue ( getProvider ( ) . getId ( ) ) ; org.ovirt.engine.core.bll.provider.AddProviderCommand.setSucceeded ( true ) ; }
Source:
public void updateNonExistingConnection ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newNFSConnection = createNFSConnection ( "multipass.my.domain.tlv.company.com:/export/allstorage/data2" , StorageType.NFS , NfsVersion.V4 , 300 , 0 ) ; org.mockito.Mockito.when ( storageConnDao.get ( newNFSConnection.getid ( ) ) ) . thenReturn ( null ) ; parameters.setStorageServerConnection ( newNFSConnection ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_CONNECTION_NOT_EXIST ) ; }

Target:
public void updateNonExistingConnection ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newNFSConnection = createNFSConnection ( "multipass.my.domain.tlv.company.com:/export/allstorage/data2" , StorageType.NFS , NfsVersion.V4 , 300 , 0 ) ; org.mockito.Mockito.when ( storageConnDao.get ( newNFSConnection.getid ( ) ) ) . thenReturn ( null ) ; parameters.setStorageServerConnection ( newNFSConnection ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , EngineMessage.ACTION_TYPE_FAILED_STORAGE_CONNECTION_NOT_EXIST ) ; }
Source:
public void serializeParametersMap ( ) { java.util.Map < java.lang.String , java.io.Serializable > data = new java.util.HashMap < > ( ) ; data.put ( "NEXT_COMMAND_TYPE" , VdcActionType.DestroyImage ) ; org.ovirt.engine.core.utils.serialization.json.JsonObjectSerializer serializer = new org.ovirt.engine.core.utils.serialization.json.JsonObjectSerializer ( ) ; org.junit.Assert.assertTrue ( ( ( serializer.serialize ( data ) . length ( ) ) > 0 ) ) ; }

Target:
public void serializeParametersMap ( ) { java.util.Map < java.lang.String , java.io.Serializable > data = new java.util.HashMap < > ( ) ; data.put ( "NEXT_COMMAND_TYPE" , ActionType.DestroyImage ) ; org.ovirt.engine.core.utils.serialization.json.JsonObjectSerializer serializer = new org.ovirt.engine.core.utils.serialization.json.JsonObjectSerializer ( ) ; org.junit.Assert.assertTrue ( ( ( serializer.serialize ( data ) . length ( ) ) > 0 ) ) ; }
Source:
public void setSubTabPanelVisible ( boolean subTabPanelVisible ) { if ( ( this . subTabPanelVisible ) != subTabPanelVisible ) { splitPanel.clear ( ) ; if ( subTabPanelVisible ) { splitPanel.addSouth ( subTabPanelContainer , org.ovirt.engine.ui.userportal.section.main.view.AbstractSideTabWithDetailsView.subTabPanelHeight ) ; splitPanel.add ( table ) ; splitPanel.init ( ) ; } else { splitPanel.add ( table ) ; } this . subTabPanelVisible = subTabPanelVisible ; } }

Target:
public void setSubTabPanelVisible ( boolean subTabPanelVisible ) { if ( ( this . subTabPanelVisible ) != subTabPanelVisible ) { splitPanel.clear ( ) ; if ( subTabPanelVisible ) { splitPanel.addSouth ( subTabPanelContainer , org.ovirt.engine.ui.common.view.SubTabHelper.getSubTabHeight ( clientStorage , splitPanel ) ) ; splitPanel.add ( table ) ; splitPanel.init ( ) ; } else { splitPanel.add ( table ) ; } this . subTabPanelVisible = subTabPanelVisible ; } }
Source:
public static int parseIntegerToInt ( java.lang.String value ) { java.math.BigInteger result = javax.xml.bind.DatatypeConverter.parseInteger ( value ) ; if ( ( result.longValue ( ) ) > ( java.lang.Integer.MAX_VALUE ) ) { throw new org.ovirt.engine.api.utils.InvalidValueException ( ( ( ( "Value " + value ) + " greater than maximum " ) + ( java.lang.Integer.MAX_VALUE ) ) ) ; } return result.intValue ( ) ; }

Target:
public static short parseShort ( java.lang.String value ) { java.math.BigInteger result = javax.xml.bind.DatatypeConverter.parseInteger ( value ) ; if ( ( result.compareTo ( org.ovirt.engine.api.utils.IntegerParser.MAX_SHORT ) ) > 0 ) { throw new org.ovirt.engine.api.utils.InvalidValueException ( ( ( ( "Value " + value ) + " is greater than the maximum short " ) + ( org.ovirt.engine.api.utils.IntegerParser.MAX_SHORT ) ) ) ; } return result.shortValue ( ) ; }
Source:
private static void logField ( org.ovirt.engine.core.common.businessentities.VmStatic vmStaticFromOvf , java.lang.String fieldName , java.lang.String fieldValue ) { java.lang.String vmName = vmStaticFromOvf.getName ( ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; logable.addCustomValue ( "FieldName" , fieldName ) ; logable.addCustomValue ( "VmName" , vmName ) ; logable.addCustomValue ( "FieldValue" , fieldValue ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log ( logable , AuditLogType.VM_IMPORT_INFO ) ; }

Target:
private org.ovirt.engine.core.common.businessentities.StorageDomain updateStorageDomainInMemoryVolumes ( java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > disksList ) { java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > memoryDisksList = org.ovirt.engine.core.bll.memory.MemoryUtils.createDiskDummies ( getVm ( ) . getTotalMemorySizeInBytes ( ) , MemoryUtils.META_DATA_SIZE_IN_BYTES ) ; org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain = org.ovirt.engine.core.bll.VmHandler.findStorageDomainForMemory ( getParameters ( ) . getStoragePoolId ( ) , memoryDisksList ) ; disksList.addAll ( memoryDisksList ) ; return storageDomain ; }
Source:
public void testTypedNested ( ) throws java.lang.Exception { java.io.File file = writeConf ( "a.b=c" ) ; org.ovirt.engine.core.extensions.mgr.Configuration config = org.ovirt.engine.core.extensions.mgr.Configuration.loadFile ( file ) ; junit.framework.Assert.assertNotNull ( config ) ; org.ovirt.engine.core.extensions.mgr.ConfigurationTest.TypedNested view = config.getView ( org.ovirt.engine.core.extensions.mgr.ConfigurationTest.TypedNested.class ) ; junit.framework.Assert.assertNotNull ( view ) ; junit.framework.Assert.assertEquals ( "c" , view.getA ( ) . getB ( ) ) ; }

Target:
public void testTypedNested ( ) throws java.lang.Exception { java.io.File file = writeConf ( "a.b=c" ) ; org.ovirt.engine.core.extensions.mgr.Configuration config = org.ovirt.engine.core.extensions.mgr.Configuration.loadFile ( file ) ; org.junit.Assert.assertNotNull ( config ) ; org.ovirt.engine.core.extensions.mgr.ConfigurationTest.TypedNested view = config.getView ( org.ovirt.engine.core.extensions.mgr.ConfigurationTest.TypedNested.class ) ; org.junit.Assert.assertNotNull ( view ) ; org.junit.Assert.assertEquals ( "c" , view.getA ( ) . getB ( ) ) ; }
Source:
public void validateVmHavingDeviceSnapshotsPluggedToOtherVmsThatAreNotDown ( ) { createParameters ( ) ; initDiskImage ( diskImageGroupId , diskImageId ) ; initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageGroupId ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN ) ) . when ( diskValidator ) . isDiskPluggedToVmsThatAreNotDown ( org.mockito.ArgumentMatchers.anyBoolean ( ) , org.mockito.ArgumentMatchers.any ( ) ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN.name ( ) ) ) ; }

Target:
public void validateVmHavingDeviceSnapshotsPluggedToOtherVmsThatAreNotDown ( ) { createParameters ( ) ; initDiskImage ( diskImageGroupId , diskImageId ) ; initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageGroupId ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN ) ) . when ( diskValidator ) . isDiskPluggedToAnyNonDownVm ( org.mockito.ArgumentMatchers.anyBoolean ( ) ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN.name ( ) ) ) ; }
Source:
public void testGetEntityNameByIdAndTypeForCluster ( ) { org.ovirt.engine.core.common.businessentities.Cluster cluster = dbFacade.getClusterDao ( ) . get ( org.ovirt.engine.core.dao.DbFacadeDaoTest.CLUSTER_ID ) ; org.junit.Assert.assertNotNull ( cluster ) ; java.lang.String name = cluster.getName ( ) ; org.junit.Assert.assertTrue ( name.equals ( dbFacade.getEntityNameByIdAndType ( org.ovirt.engine.core.dao.DbFacadeDaoTest.CLUSTER_ID , VdcObjectType.Cluster ) ) ) ; }

Target:
public void testGetEntityNameByIdAndTypeForCluster ( ) { org.ovirt.engine.core.common.businessentities.Cluster cluster = dbFacade.getClusterDao ( ) . get ( org.ovirt.engine.core.dal.dbbroker.DbFacadeDaoTest.CLUSTER_ID ) ; org.junit.Assert.assertNotNull ( cluster ) ; java.lang.String name = cluster.getName ( ) ; org.junit.Assert.assertTrue ( name.equals ( dbFacade.getEntityNameByIdAndType ( org.ovirt.engine.core.dal.dbbroker.DbFacadeDaoTest.CLUSTER_ID , VdcObjectType.Cluster ) ) ) ; }
Source:
public void getDataCentersByStorageDomain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStoragePoolsByStorageDomainId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }

Target:
public void isVmNameUnique ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ! ( ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) ) : false ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.IsVmWithSameNameExist , new org.ovirt.engine.core.common.queries.NameQueryParameters ( name ) , aQuery ) ; }
Source:
public void unmanagedVlanAddedToNic ( ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic = createNic ( "nic0" , null ) ; mockExistingIfaces ( nic ) ; java.lang.String networkName = "net" ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( nic , createVlan ( nic.getName ( ) , 100 , networkName ) ) ) ; validateAndExpectViolation ( helper , VdcBllMessages.NETWORKS_DONT_EXIST_IN_CLUSTER , networkName ) ; }

Target:
public void unmanagedVlanAddedToNic ( ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic = createNic ( "nic0" , null ) ; mockExistingIfaces ( nic ) ; java.lang.String networkName = "net" ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( nic , createVlan ( nic.getName ( ) , 100 , networkName ) ) ) ; validateAndExpectViolation ( helper , EngineMessage.NETWORKS_DONT_EXIST_IN_CLUSTER , networkName ) ; }
Source:
public void testGet ( ) { org.ovirt.engine.core.common.businessentities.storage.Disk result = dao.get ( getExistingEntityId ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( getExistingEntityId ( ) . toString ( ) , result.getId ( ) . toString ( ) ) ; }

Target:
public void testGet ( ) { org.ovirt.engine.core.common.businessentities.storage.Disk result = dao.get ( getExistingEntityId ( ) ) ; org.junit.jupiter.api.Assertions.assertNotNull ( result ) ; org.junit.jupiter.api.Assertions.assertEquals ( getExistingEntityId ( ) . toString ( ) , result.getId ( ) . toString ( ) ) ; }
Source:
private static int getNextImage ( java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > images , org.ovirt.engine.core.common.businessentities.DiskImage curr ) { for ( int i = 0 ; i < ( images.size ( ) ) ; i ++ ) { if ( images.get ( i ) . getParentId ( ) . equals ( curr.getImageId ( ) ) ) { return i ; } } return - 1 ; }

Target:
public org.ovirt.engine.core.compat.Guid createTask ( org.ovirt.engine.core.compat.Guid taskId , org.ovirt.engine.core.common.asynctasks.AsyncTaskCreationInfo asyncTaskCreationInfo , org.ovirt.engine.core.common.action.VdcActionType parentCommand ) { return super . createTask ( taskId , asyncTaskCreationInfo , parentCommand ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.AsyncTaskStatus CheckTaskExist ( org.ovirt.engine.core.common.businessentities.AsyncTaskStatus cachedStatusTask ) { org.ovirt.engine.core.common.businessentities.AsyncTaskStatus returnedStatusTask = null ; if ( cachedStatusTask == null ) { returnedStatusTask = new org.ovirt.engine.core.common.businessentities.AsyncTaskStatus ( org.ovirt.engine.core.common.businessentities.AsyncTaskStatusEnum.unknown ) ; org.ovirt.engine.core.bll.SPMAsyncTask.log.errorFormat ( ( "SPMAsyncTask::PollTask: Task '{0}' (Parent Command {1}, Parameters Type {2}) " + "was not found in VDSM, will change its status to unknown." ) , getTaskID ( ) , getParameters ( ) . getDbAsyncTask ( ) . getaction_type ( ) , getParameters ( ) . getClass ( ) . getName ( ) ) ; } else { returnedStatusTask = cachedStatusTask ; } return returnedStatusTask ; }

Target:
protected org.ovirt.engine.core.common.businessentities.AsyncTaskStatus CheckTaskExist ( org.ovirt.engine.core.common.businessentities.AsyncTaskStatus cachedStatusTask ) { org.ovirt.engine.core.common.businessentities.AsyncTaskStatus returnedStatusTask = null ; if ( cachedStatusTask == null ) { returnedStatusTask = new org.ovirt.engine.core.common.businessentities.AsyncTaskStatus ( org.ovirt.engine.core.common.businessentities.AsyncTaskStatusEnum.unknown ) ; org.ovirt.engine.core.bll.SPMAsyncTask.log.errorFormat ( ( "SPMAsyncTask::PollTask: Task '{0}' (Parent Command {1}, Parameters Type {2}) " + "was not found in VDSM, will change its status to unknown." ) , getVdsmTaskId ( ) , getParameters ( ) . getDbAsyncTask ( ) . getaction_type ( ) , getParameters ( ) . getClass ( ) . getName ( ) ) ; } else { returnedStatusTask = cachedStatusTask ; } return returnedStatusTask ; }