auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void validateFailsWithArbiterWithClusterDoesNotArbiterVolume ( ) { setVolume ( getVolume ( 3 , false , GlusterVolumeType.REPLICATE , 3 , true ) ) ; org.mockito.Mockito.doReturn ( getCluster ( true , Version.v4_0 ) ) . when ( clusterDao ) . get ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_GLUSTER_ARBITER_VOLUME_NOT_SUPPORTED ) ; }

Target:
public void validateFailsWithArbiterWithClusterDoesNotArbiterVolume ( ) { setVolume ( getVolume ( 3 , false , GlusterVolumeType.REPLICATE , 3 , true ) ) ; org.mockito.Mockito.doReturn ( getCluster ( true , Version.v4_0 ) ) . when ( clusterDao ) . get ( org.mockito.ArgumentMatchers.any ( ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_GLUSTER_ARBITER_VOLUME_NOT_SUPPORTED ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { final java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > newItems = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ; java.util.Collections.sort ( newItems , new org.ovirt.engine.ui.uicommonweb.Linq.NetworkInClusterComparator ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.Network network : newItems ) { network.getCluster ( ) . setId ( new org.ovirt.engine.core.common.businessentities.network.NetworkClusterId ( getEntity ( ) . getId ( ) , network.getId ( ) ) ) ; } setItems ( newItems ) ; }

Target:
public void onSuccess ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue ) { final java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > newItems = returnValue.getReturnValue ( ) ; java.util.Collections.sort ( newItems , new org.ovirt.engine.ui.uicommonweb.Linq.NetworkInClusterComparator ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.Network network : newItems ) { network.getCluster ( ) . setId ( new org.ovirt.engine.core.common.businessentities.network.NetworkClusterId ( getEntity ( ) . getId ( ) , network.getId ( ) ) ) ; } setItems ( newItems ) ; }
Source:
protected void expectGetLunsMap ( org.ovirt.engine.core.dao.StorageServerConnectionLunMapDao dao ) { for ( int i = 0 ; i < ( org.ovirt.engine.core.bll.GetLunsByVgIdQueryTest.GUIDS.length ) ; i ++ ) { expectGetLunsMap ( dao , org.ovirt.engine.core.bll.GetLunsByVgIdQueryTest.GUIDS [ i ] . toString ( ) , org.ovirt.engine.core.bll.GetLunsByVgIdQueryTest.GUIDS [ i ] . toString ( ) ) ; } }

Target:
protected void expectGetLunsMap ( ) { for ( int i = 0 ; i < ( org.ovirt.engine.core.bll.GetLunsByVgIdQueryTest.GUIDS.length ) ; i ++ ) { expectGetLunsMap ( org.ovirt.engine.core.bll.GetLunsByVgIdQueryTest.GUIDS [ i ] . toString ( ) , org.ovirt.engine.core.bll.GetLunsByVgIdQueryTest.GUIDS [ i ] . toString ( ) ) ; } }
Source:
public void testGetRootDSENoServers ( ) throws java.lang.Exception { java.util.List < java.net.URI > urls = new java.util.ArrayList < java.net.URI > ( ) ; org.ovirt.engine.core.bll.adbroker.DirectorySearcher dirSearcher = mockDirectorySearcher ( urls ) ; try { org.ovirt.engine.core.bll.adbroker.GetRootDSETask getRootDSETask = new org.ovirt.engine.core.bll.adbroker.GetRootDSETask ( dirSearcher , "mydomain" , urls.get ( 0 ) ) ; org.ovirt.engine.core.bll.adbroker.DirectorySearcherTest.execute ( getRootDSETask ) ; } catch ( java.lang.Exception e ) { return ; } org.junit.Assert.fail ( "Task didn't exited with error" ) ; }

Target:
public void testGetRootDSENoServers ( ) throws java.lang.Exception { java.util.List < java.net.URI > urls = new java.util.ArrayList < java.net.URI > ( ) ; org.ovirt.engine.core.bll.adbroker.DirectorySearcher dirSearcher = mockDirectorySearcher ( urls ) ; try { org.ovirt.engine.core.bll.adbroker.GetRootDSETask getRootDSETask = new org.ovirt.engine.core.bll.adbroker.GetRootDSETask ( dirSearcher , "mydomain" , null ) ; org.ovirt.engine.core.bll.adbroker.DirectorySearcherTest.execute ( getRootDSETask ) ; } catch ( java.lang.Exception e ) { return ; } org.junit.Assert.fail ( "Task didn't exited with error" ) ; }
Source:
private static void logVmStatusTransition ( org.ovirt.engine.core.common.businessentities.VM vmToUpdate , org.ovirt.engine.core.common.businessentities.VmDynamic runningVm ) { if ( ( vmToUpdate.getStatus ( ) ) != ( runningVm.getstatus ( ) ) ) { org.ovirt.engine.core.vdsbroker.VdsUpdateRunTimeInfo.log.infoFormat ( "VM {0} {1} moved from {2} --> {3}" , vmToUpdate.getVmName ( ) , vmToUpdate.getId ( ) , vmToUpdate.getStatus ( ) . name ( ) , runningVm.getstatus ( ) . name ( ) ) ; } }

Target:
private static void logVmStatusTransition ( org.ovirt.engine.core.common.businessentities.VM vmToUpdate , org.ovirt.engine.core.common.businessentities.VmDynamic runningVm ) { if ( ( vmToUpdate.getStatus ( ) ) != ( runningVm.getstatus ( ) ) ) { org.ovirt.engine.core.vdsbroker.VdsUpdateRunTimeInfo.log.infoFormat ( "VM {0} {1} moved from {2} --> {3}" , vmToUpdate.getName ( ) , vmToUpdate.getId ( ) , vmToUpdate.getStatus ( ) . name ( ) , runningVm.getstatus ( ) . name ( ) ) ; } }
Source:
public void testGuidListValues ( ) { java.lang.String listValues = "e61f7070-cd52-46ca-88c2-686e1c70fe44,1eaa381a-fbf9-4ef5-bec2-6e4337f85d66" ; java.util.List < org.ovirt.engine.core.compat.Guid > stringList = org.ovirt.engine.core.utils.GuidUtils.getGuidListFromString ( listValues ) ; java.util.List < org.ovirt.engine.core.compat.Guid > expectedList = new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( ) ; expectedList.add ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( "e61f7070-cd52-46ca-88c2-686e1c70fe44" ) ) ; expectedList.add ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( "1eaa381a-fbf9-4ef5-bec2-6e4337f85d66" ) ) ; org.junit.Assert.assertEquals ( expectedList , stringList ) ; }

Target:
public void testGuidListValues ( ) { java.lang.String listValues = "e61f7070-cd52-46ca-88c2-686e1c70fe44,1eaa381a-fbf9-4ef5-bec2-6e4337f85d66" ; java.util.List < org.ovirt.engine.core.compat.Guid > stringList = org.ovirt.engine.core.utils.GuidUtils.getGuidListFromString ( listValues ) ; java.util.List < org.ovirt.engine.core.compat.Guid > expectedList = new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( ) ; expectedList.add ( new org.ovirt.engine.core.compat.Guid ( "e61f7070-cd52-46ca-88c2-686e1c70fe44" ) ) ; expectedList.add ( new org.ovirt.engine.core.compat.Guid ( "1eaa381a-fbf9-4ef5-bec2-6e4337f85d66" ) ) ; org.junit.Assert.assertEquals ( expectedList , stringList ) ; }
Source:
public void setDefaultNames2 ( ) { org.ovirt.engine.core.common.businessentities.VDS host = context.host ; if ( ( host.getVdsGroupId ( ) ) != null ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getClusterById ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { context.hostCluster = ( ( org.ovirt.engine.core.common.businessentities.VDSGroup ) ( returnValue ) ) ; setDefaultNames3 ( ) ; } } , frontendHash ) , host.getVdsGroupId ( ) ) ; } else { setDefaultNames3 ( ) ; } }

Target:
public void setDefaultNames2 ( ) { org.ovirt.engine.core.common.businessentities.VDS host = context.host ; if ( ( host.getVdsGroupId ( ) ) != null ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getClusterById ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { context.hostCluster = ( ( org.ovirt.engine.core.common.businessentities.VDSGroup ) ( returnValue ) ) ; setDefaultNames3 ( ) ; } } , frontendHash ) , host.getVdsGroupId ( ) ) ; } else { setDefaultNames3 ( ) ; } }
Source:
protected java.util.HashMap < org.ovirt.engine.core.common.businessentities.VmTemplate , org.ovirt.engine.core.common.queries.DiskImageList > setUpExportTemplates ( ) { java.util.HashMap < org.ovirt.engine.core.common.businessentities.VmTemplate , org.ovirt.engine.core.common.queries.DiskImageList > ret = new java.util.LinkedHashMap < org.ovirt.engine.core.common.businessentities.VmTemplate , org.ovirt.engine.core.common.queries.DiskImageList > ( ) ; for ( int i = 0 ; i < ( NAMES.length ) ; i ++ ) { ret.put ( getEntity ( i ) , new org.ovirt.engine.core.common.queries.DiskImageList ( ) ) ; } return ret ; }

Target:
protected java.util.HashMap < org.ovirt.engine.core.common.businessentities.VmTemplate , java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > > setUpExportTemplates ( ) { java.util.HashMap < org.ovirt.engine.core.common.businessentities.VmTemplate , java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > > ret = new java.util.LinkedHashMap < org.ovirt.engine.core.common.businessentities.VmTemplate , java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > > ( ) ; for ( int i = 0 ; i < ( NAMES.length ) ; i ++ ) { ret.put ( getEntity ( i ) , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ) ; } return ret ; }
Source:
public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.VM object ) { if ( ( ( object.getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Down ) ) || ( ( object.getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.ImageLocked ) ) ) return "" ; else return renderer.render ( getRawValue ( object ) ) ; }

Target:
public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.VM object ) { if ( ( ( object.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Down ) ) || ( ( object.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.ImageLocked ) ) ) return "" ; else return renderer.render ( getRawValue ( object ) ) ; }
Source:
private void refreshClusterData ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster ) { log.debugFormat ( "Refreshing Gluster lightweight Data for cluster {0}" , cluster.getname ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDS > existingServers = getVdsDao ( ) . getAllForVdsGroup ( cluster.getId ( ) ) ; org.ovirt.engine.core.common.businessentities.VDS upServer = getClusterUtils ( ) . getUpServer ( cluster.getId ( ) ) ; if ( upServer == null ) { log.debugFormat ( "No server UP in cluster {0}. Can't refresh it's data at this point." , cluster.getname ( ) ) ; return ; } refreshServerData ( cluster , upServer , existingServers ) ; refreshVolumeData ( cluster , upServer , existingServers ) ; }

Target:
private void refreshClusterData ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster ) { log.debugFormat ( "Refreshing Gluster lightweight Data for cluster {0}" , cluster.getName ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDS > existingServers = getVdsDao ( ) . getAllForVdsGroup ( cluster.getId ( ) ) ; org.ovirt.engine.core.common.businessentities.VDS upServer = getClusterUtils ( ) . getUpServer ( cluster.getId ( ) ) ; if ( upServer == null ) { log.debugFormat ( "No server UP in cluster {0}. Can't refresh it's data at this point." , cluster.getName ( ) ) ; return ; } refreshServerData ( cluster , upServer , existingServers ) ; refreshVolumeData ( cluster , upServer , existingServers ) ; }
Source:
public static void initTestCase ( ) throws java.lang.Exception { org.ovirt.engine.core.dao.BaseDAOTestCase.dataSource = org.ovirt.engine.core.dao.BaseDAOTestCase.createDataSource ( ) ; org.ovirt.engine.core.dao.BaseDAOTestCase.dataset = org.ovirt.engine.core.dao.BaseDAOTestCase.initDataSet ( ) ; org.ovirt.engine.core.dao.BaseDAOTestCase.dbFacade = new org.ovirt.engine.core.dal.dbbroker.DbFacade ( ) ; org.ovirt.engine.core.dao.BaseDAOTestCase.dbFacade.setDbEngineDialect ( org.ovirt.engine.core.dal.dbbroker.DbFacadeLocator.loadDbEngineDialect ( ) ) ; org.ovirt.engine.core.dao.BaseDAOTestCase.dbFacade.setTemplate ( org.ovirt.engine.core.dao.BaseDAOTestCase.dbFacade.getDbEngineDialect ( ) . createJdbcTemplate ( org.ovirt.engine.core.dao.BaseDAOTestCase.dataSource ) ) ; DatabaseOperation.CLEAN_INSERT.execute ( org.ovirt.engine.core.dao.BaseDAOTestCase.getConnection ( ) , org.ovirt.engine.core.dao.BaseDAOTestCase.dataset ) ; }

Target:
public static void initTestCase ( ) throws java.lang.Exception { if ( ( org.ovirt.engine.core.dao.BaseDAOTestCase.dataSource ) == null ) { org.ovirt.engine.core.dao.BaseDAOTestCase.dataSource = org.ovirt.engine.core.dao.BaseDAOTestCase.createDataSource ( ) ; org.ovirt.engine.core.dao.BaseDAOTestCase.dataset = org.ovirt.engine.core.dao.BaseDAOTestCase.initDataSet ( ) ; org.ovirt.engine.core.dao.BaseDAOTestCase.dbFacade = new org.ovirt.engine.core.dal.dbbroker.DbFacade ( ) ; org.ovirt.engine.core.dao.BaseDAOTestCase.dbFacade.setDbEngineDialect ( org.ovirt.engine.core.dal.dbbroker.DbFacadeLocator.loadDbEngineDialect ( ) ) ; org.ovirt.engine.core.dao.BaseDAOTestCase.dbFacade.setTemplate ( org.ovirt.engine.core.dao.BaseDAOTestCase.dbFacade.getDbEngineDialect ( ) . createJdbcTemplate ( org.ovirt.engine.core.dao.BaseDAOTestCase.dataSource ) ) ; DatabaseOperation.CLEAN_INSERT.execute ( org.ovirt.engine.core.dao.BaseDAOTestCase.getConnection ( ) , org.ovirt.engine.core.dao.BaseDAOTestCase.dataset ) ; } }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.SearchableListModel searchableListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.SearchableListModel ) ( model ) ) ; searchableListModel.setItems ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { setItems ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ) ; }
Source:
public void testMoveNamedParent ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetTagByTagName , org.ovirt.engine.core.common.queries.NameQueryParameters.class , new java.lang.String [ ] { "Name" } , new java.lang.Object [ ] { NAMES [ org.ovirt.engine.api.restapi.resource.BackendTagsResourceTest.PARENT_IDX ] } , getEntity ( org.ovirt.engine.api.restapi.resource.BackendTagResourceTest.NEW_PARENT_IDX ) ) ; org.ovirt.engine.api.model.Tag model = org.ovirt.engine.api.restapi.resource.BackendTagsResourceTest.getModel ( 0 ) ; model.getParent ( ) . getTag ( ) . setId ( null ) ; model.getParent ( ) . getTag ( ) . setName ( NAMES [ org.ovirt.engine.api.restapi.resource.BackendTagsResourceTest.PARENT_IDX ] ) ; doTestMove ( model , 0 ) ; }

Target:
public void testMoveNamedParent ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetTagByTagName , org.ovirt.engine.core.common.queries.NameQueryParameters.class , new java.lang.String [ ] { "Name" } , new java.lang.Object [ ] { NAMES [ org.ovirt.engine.api.restapi.resource.BackendTagsResourceTest.PARENT_IDX ] } , getEntity ( org.ovirt.engine.api.restapi.resource.BackendTagResourceTest.NEW_PARENT_IDX ) ) ; org.ovirt.engine.api.model.Tag model = org.ovirt.engine.api.restapi.resource.BackendTagsResourceTest.getModel ( 0 ) ; model.getParent ( ) . setId ( null ) ; model.getParent ( ) . setName ( NAMES [ org.ovirt.engine.api.restapi.resource.BackendTagsResourceTest.PARENT_IDX ] ) ; doTestMove ( model , 0 ) ; }
Source:
private void fillDisksToParameters ( ) { for ( org.ovirt.engine.core.common.businessentities.storage.Disk image : getAdjustedDiskImagesFromConfiguration ( ) ) { diskInfoDestinationMap.put ( image.getId ( ) , ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( image ) ) ) ; } org.ovirt.engine.core.bll.CloneVmCommand.getParameters ( ) . setDiskInfoDestinationMap ( diskInfoDestinationMap ) ; }

Target:
private void fillDisksToParameters ( ) { for ( org.ovirt.engine.core.common.businessentities.storage.Disk image : getAdjustedDiskImagesFromConfiguration ( ) ) { diskInfoDestinationMap.put ( image.getId ( ) , ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( image ) ) ) ; } org.ovirt.engine.core.bll.CloneVmCommand.getParameters ( ) . setDiskInfoDestinationMap ( diskInfoDestinationMap ) ; }
Source:
protected boolean canDoAction ( ) { boolean autheticated = org.ovirt.engine.core.bll.aaa.LoginAdminUserCommand.isUserCanBeAuthenticated ( ) ; if ( autheticated ) { autheticated = org.ovirt.engine.core.bll.aaa.LoginAdminUserCommand.getCurrentUser ( ) . isAdmin ( ) ; if ( ! autheticated ) { addCanDoActionMessage ( VdcBllMessages.USER_NOT_AUTHORIZED_TO_PERFORM_ACTION ) ; } } if ( ! autheticated ) { org.ovirt.engine.core.bll.aaa.LoginAdminUserCommand.logAutheticationFailure ( ) ; } return autheticated ; }

Target:
protected boolean canDoAction ( ) { boolean autheticated = super . canDoAction ( ) ; if ( autheticated ) { autheticated = org.ovirt.engine.core.bll.aaa.LoginAdminUserCommand.getCurrentUser ( ) . isAdmin ( ) ; if ( ! autheticated ) { addCanDoActionMessage ( VdcBllMessages.USER_NOT_AUTHORIZED_TO_PERFORM_ACTION ) ; org.ovirt.engine.core.bll.aaa.LoginAdminUserCommand.logAutheticationFailure ( ) ; } } return autheticated ; }
Source:
protected org.ovirt.engine.api.model.DiskSnapshot postPopulate ( org.ovirt.engine.api.model.DiskSnapshot model ) { model.setFormat ( org.ovirt.engine.api.restapi.types.MappingTestHelper.shuffle ( org.ovirt.engine.api.model.DiskFormat.class ) ) ; model.setInterface ( org.ovirt.engine.api.restapi.types.MappingTestHelper.shuffle ( org.ovirt.engine.api.model.DiskInterface.class ) ) ; model.setSgio ( org.ovirt.engine.api.restapi.types.MappingTestHelper.shuffle ( org.ovirt.engine.api.model.ScsiGenericIO.class ) ) ; model.setStatus ( org.ovirt.engine.api.restapi.types.MappingTestHelper.shuffle ( org.ovirt.engine.api.model.DiskStatus.class ) ) ; model.setLunStorage ( null ) ; return model ; }

Target:
protected org.ovirt.engine.api.model.DiskSnapshot postPopulate ( org.ovirt.engine.api.model.DiskSnapshot model ) { model.setFormat ( org.ovirt.engine.api.restapi.types.MappingTestHelper.shuffle ( org.ovirt.engine.api.model.DiskFormat.class ) ) ; model.setSgio ( org.ovirt.engine.api.restapi.types.MappingTestHelper.shuffle ( org.ovirt.engine.api.model.ScsiGenericIO.class ) ) ; model.setStatus ( org.ovirt.engine.api.restapi.types.MappingTestHelper.shuffle ( org.ovirt.engine.api.model.DiskStatus.class ) ) ; model.setLunStorage ( null ) ; return model ; }
Source:
private boolean validateExternalNetwork ( org.ovirt.engine.core.bll.network.cluster.NetworkClusterValidatorBase validator ) { return ( ( validate ( validator.externalNetworkSupported ( ) ) ) && ( validate ( validator.externalNetworkNotDisplay ( getNetworkName ( ) ) ) ) ) && ( validate ( validator.externalNetworkNotRequired ( getNetworkName ( ) ) ) ) ; }

Target:
private boolean validateExternalNetwork ( org.ovirt.engine.core.bll.network.cluster.NetworkClusterValidatorBase validator ) { return ( validate ( validator.externalNetworkNotDisplay ( getNetworkName ( ) ) ) ) && ( validate ( validator.externalNetworkNotRequired ( getNetworkName ( ) ) ) ) ; }
Source:
public void testDedicatedHostNotExistOrNotSameCluster ( ) { prepareVmToPassValidate ( ) ; org.mockito.Mockito.doReturn ( false ) . when ( command ) . isDedicatedVdsExistOnSameCluster ( org.mockito.ArgumentMatchers.any ( ) , org.mockito.ArgumentMatchers.any ( ) ) ; vmStatic.setDedicatedVmForVdsList ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.junit.Assert.assertFalse ( "validate should have failed with invalid dedicated host." , command.validate ( ) ) ; }

Target:
public void testDedicatedHostNotExistOrNotSameCluster ( ) { prepareVmToPassValidate ( ) ; org.mockito.Mockito.doReturn ( false ) . when ( command ) . isDedicatedVdsExistOnSameCluster ( org.mockito.ArgumentMatchers.any ( ) ) ; vmStatic.setDedicatedVmForVdsList ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.junit.Assert.assertFalse ( "validate should have failed with invalid dedicated host." , command.validate ( ) ) ; }
Source:
public void log ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogable auditLogable , org.ovirt.engine.core.common.AuditLogType logType , java.lang.String loggerString ) { if ( ! ( logType.shouldBeLogged ( ) ) ) { return ; } org.ovirt.engine.core.dal.dbbroker.auditloghandling.EventFloodRegulator eventFloodRegulator = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.EventFloodRegulator ( auditLogable , logType ) ; eventFloodRegulator.updateTimeoutLogableObject ( ) ; if ( eventFloodRegulator.isLegal ( ) ) { saveToDb ( auditLogable , logType , loggerString ) ; } }

Target:
public void log ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogable auditLogable , org.ovirt.engine.core.common.AuditLogType logType , java.lang.String loggerString ) { if ( ! ( logType.shouldBeLogged ( ) ) ) { return ; } org.ovirt.engine.core.dal.dbbroker.auditloghandling.EventFloodRegulator eventFloodRegulator = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.EventFloodRegulator ( auditLogable , logType ) ; if ( eventFloodRegulator.isLegal ( ) ) { saveToDb ( auditLogable , logType , loggerString ) ; } }
Source:
public org.ovirt.engine.core.bll.ValidationResult validateImagesForRunVm ( org.ovirt.engine.core.common.businessentities.VM vm , java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > vmDisks ) { return ! ( vm.isAutoStartup ( ) ) ? new org.ovirt.engine.core.bll.validator.DiskImagesValidator ( vmDisks ) . diskImagesNotLocked ( ) : org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult validateImagesForRunVm ( org.ovirt.engine.core.common.businessentities.VM vm , java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > vmDisks ) { if ( vmDisks.isEmpty ( ) ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } return ! ( vm.isAutoStartup ( ) ) ? new org.ovirt.engine.core.bll.validator.DiskImagesValidator ( vmDisks ) . diskImagesNotLocked ( ) : org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
public void testCleanNotExpiredUsersSessionsWithUsers ( ) { org.ovirt.engine.core.dao.DbUserDAO dbUserDAOMcok = initDataForClearTest ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.USER ) ; container.cleanExpiredUsersSessions ( ) ; org.junit.Assert.assertNotNull ( "Get should return the value since the session was not removed" , container.GetData ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_SESSION_ID , org.ovirt.engine.core.bll.session.SessionDataContainerTest.USER , false ) ) ; org.junit.Assert.assertNotNull ( "Get should return the value since the session was not removed" , container.getUser ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_SESSION_ID , false ) ) ; org.mockito.Mockito.verifyZeroInteractions ( dbUserDAOMcok ) ; }

Target:
public void testCleanNotExpiredUsersSessionsWithUsers ( ) { initDataForClearTest ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.USER ) ; container.cleanExpiredUsersSessions ( ) ; org.junit.Assert.assertNotNull ( "Get should return the value since the session was not removed" , container.GetData ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_SESSION_ID , org.ovirt.engine.core.bll.session.SessionDataContainerTest.USER , false ) ) ; org.junit.Assert.assertNotNull ( "Get should return the value since the session was not removed" , container.getUser ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_SESSION_ID , false ) ) ; }
Source:
protected java.util.Map < org.ovirt.engine.core.common.businessentities.storage_domains , java.lang.Integer > getSpaceRequirementsForStorageDomains ( java.util.Collection < org.ovirt.engine.core.common.businessentities.DiskImage > images ) { java.util.Map < org.ovirt.engine.core.common.businessentities.DiskImage , org.ovirt.engine.core.common.businessentities.storage_domains > spaceMap = new java.util.HashMap < org.ovirt.engine.core.common.businessentities.DiskImage , org.ovirt.engine.core.common.businessentities.storage_domains > ( ) ; for ( org.ovirt.engine.core.common.businessentities.DiskImage image : images ) { org.ovirt.engine.core.common.businessentities.storage_domains domain = getStorageDomain ( imageToDestinationDomainMap.get ( image.getId ( ) ) ) ; spaceMap.put ( image , domain ) ; } return org.ovirt.engine.core.bll.validator.StorageDomainValidator.getSpaceRequirementsForStorageDomains ( spaceMap ) ; }

Target:
protected java.util.Map < org.ovirt.engine.core.common.businessentities.StorageDomain , java.lang.Integer > getSpaceRequirementsForStorageDomains ( java.util.Collection < org.ovirt.engine.core.common.businessentities.DiskImage > images ) { java.util.Map < org.ovirt.engine.core.common.businessentities.DiskImage , org.ovirt.engine.core.common.businessentities.StorageDomain > spaceMap = new java.util.HashMap < org.ovirt.engine.core.common.businessentities.DiskImage , org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; for ( org.ovirt.engine.core.common.businessentities.DiskImage image : images ) { org.ovirt.engine.core.common.businessentities.StorageDomain domain = getStorageDomain ( imageToDestinationDomainMap.get ( image.getId ( ) ) ) ; spaceMap.put ( image , domain ) ; } return org.ovirt.engine.core.bll.validator.StorageDomainValidator.getSpaceRequirementsForStorageDomains ( spaceMap ) ; }
Source:
public void testList ( ) throws java.lang.Exception { resource.setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( VdcQueryType.GetVdsHooksById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , getEntity ( 0 ) ) ; control.replay ( ) ; org.ovirt.engine.api.model.Hooks hooks = resource.list ( ) ; assertNotNull ( hooks.getHooks ( ) ) ; assertEquals ( 4 , hooks.getHooks ( ) . size ( ) ) ; }

Target:
public void testList ( ) throws java.lang.Exception { resource.setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( VdcQueryType.GetVdsHooksById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , getEntity ( 0 ) ) ; org.ovirt.engine.api.model.Hooks hooks = resource.list ( ) ; assertNotNull ( hooks.getHooks ( ) ) ; assertEquals ( 4 , hooks.getHooks ( ) . size ( ) ) ; }
Source:
protected void onEntityChanged ( ) { if ( ( getEntity ( ) ) instanceof org.ovirt.engine.core.common.businessentities.VM ) { behavior = new org.ovirt.engine.ui.uicommonweb.models.userportal.VmItemBehavior ( this ) ; } else if ( ( getEntity ( ) ) instanceof org.ovirt.engine.core.common.businessentities.VmPool ) { behavior = new org.ovirt.engine.ui.uicommonweb.models.userportal.PoolItemBehavior ( this ) ; } else { throw new java.lang.UnsupportedOperationException ( ) ; } behavior.OnEntityChanged ( ) ; }

Target:
protected void onEntityChanged ( ) { if ( ( getEntity ( ) ) instanceof org.ovirt.engine.core.common.businessentities.VM ) { behavior = new org.ovirt.engine.ui.uicommonweb.models.userportal.VmItemBehavior ( this ) ; } else if ( ( getEntity ( ) ) instanceof org.ovirt.engine.core.common.businessentities.VmPool ) { behavior = new org.ovirt.engine.ui.uicommonweb.models.userportal.PoolItemBehavior ( this ) ; } else { throw new java.lang.UnsupportedOperationException ( ) ; } behavior.onEntityChanged ( ) ; }
Source:
public void validateFailsForDeviceAlreadyInUse ( ) { org.ovirt.engine.core.common.businessentities.gluster.StorageDevice storageDevice = getStorageDevice ( "sda" , null ) ; storageDevice.setCanCreateBrick ( false ) ; cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.CreateBrickCommand ( new org.ovirt.engine.core.common.action.gluster.CreateBrickParameters ( HOST_ID , "brick1" , "/gluster-bricks/brick1" , org.ovirt.engine.core.common.businessentities.RaidType.RAID0 , null , null , java.util.Collections.singletonList ( storageDevice ) ) , null ) ) ; prepareMocks ( cmd , VDSStatus.Up ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; }

Target:
public void validateFailsForDeviceAlreadyInUse ( ) { org.ovirt.engine.core.common.businessentities.gluster.StorageDevice storageDevice = getStorageDevice ( "sda" , null ) ; storageDevice.setCanCreateBrick ( false ) ; cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.CreateBrickCommand ( new org.ovirt.engine.core.common.action.gluster.CreateBrickParameters ( HOST_ID , "brick1" , "/gluster-bricks/brick1" , org.ovirt.engine.core.common.businessentities.RaidType.RAID0 , null , null , java.util.Collections.singletonList ( storageDevice ) ) , null ) ) ; prepareMocks ( VDSStatus.Up ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; }
Source:
public void runMultipleAction ( final org.ovirt.engine.core.common.action.VdcActionType actionType , final java.util.List < org.ovirt.engine.core.common.action.VdcActionParametersBase > parameters , final org.ovirt.engine.ui.uicompat.IFrontendMultipleActionAsyncCallback callback , final java.lang.Object state , final boolean showErrorDialog , final boolean waitForResult ) { runMultipleAction ( actionType , parameters , false , callback , state , showErrorDialog , waitForResult ) ; }

Target:
public void runMultipleAction ( final org.ovirt.engine.core.common.action.VdcActionType actionType , final java.util.List < org.ovirt.engine.core.common.action.VdcActionParametersBase > parameters , final org.ovirt.engine.ui.uicompat.IFrontendMultipleActionAsyncCallback callback , final java.lang.Object state ) { runMultipleAction ( actionType , parameters , false , callback , state ) ; }
Source:
public java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > getPermissionCheckSubjects ( ) { if ( ( ( permsList ) == null ) && ( ( getDisk ( ) ) != null ) ) { permsList = new java.util.ArrayList < org.ovirt.engine.core.bll.utils.PermissionSubject > ( ) ; permsList.add ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( getDisk ( ) . getId ( ) , org.ovirt.engine.core.common.VdcObjectType.Disk , org.ovirt.engine.core.common.businessentities.ActionGroup.DELETE_DISK ) ) ; } return permsList ; }

Target:
public java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > getPermissionCheckSubjects ( ) { if ( ( ( permsList ) == null ) && ( ( getDisk ( ) ) != null ) ) { permsList = new java.util.ArrayList < > ( ) ; permsList.add ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( getDisk ( ) . getId ( ) , org.ovirt.engine.core.common.VdcObjectType.Disk , org.ovirt.engine.core.common.businessentities.ActionGroup.DELETE_DISK ) ) ; } return permsList ; }
Source:
public static void getCPUList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Version 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.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllServerCpuList , new org.ovirt.engine.core.common.queries.GetAllServerCpuListParameters ( version ) , aQuery ) ; }

Target:
public void getCPUList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Version 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.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllServerCpuList , new org.ovirt.engine.core.common.queries.GetAllServerCpuListParameters ( version ) , aQuery ) ; }
Source:
private static java.util.Map < java.lang.String , java.lang.String > getSecuredMailProperties ( ) { java.util.Map < java.lang.String , java.lang.String > prop = new java.util.HashMap < java.lang.String , java.lang.String > ( ) ; prop.put ( NotificationProperties.MAIL_SERVER , "smtp.gmail.com" ) ; prop.put ( NotificationProperties.MAIL_PORT , "465" ) ; prop.put ( NotificationProperties.MAIL_USER , "mailtest.redhat@gmail.com" ) ; prop.put ( NotificationProperties.MAIL_PASSWORD , "q1!w2@e3#!" ) ; prop.put ( NotificationProperties.MAIL_FROM , "dev-null@redhat.com" ) ; prop.put ( NotificationProperties.MAIL_ENABLE_SSL , "true" ) ; return prop ; }

Target:
private static java.util.Map < java.lang.String , java.lang.String > getSecuredMailProperties ( ) { java.util.Map < java.lang.String , java.lang.String > prop = new java.util.HashMap < java.lang.String , java.lang.String > ( ) ; prop.put ( NotificationProperties.MAIL_SERVER , "smtp.gmail.com" ) ; prop.put ( NotificationProperties.MAIL_PORT , "465" ) ; prop.put ( NotificationProperties.MAIL_USER , "mailtest.redhat@gmail.com" ) ; prop.put ( NotificationProperties.MAIL_PASSWORD , "q1!w2@e3#!" ) ; prop.put ( NotificationProperties.MAIL_FROM , "dev-null@redhat.com" ) ; prop.put ( NotificationProperties.MAIL_SMTP_ENCRYPTION , NotificationProperties.MAIL_SMTP_ENCRYPTION_SSL ) ; return prop ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult networkNotChanged ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment oldAttachment ) { return org.ovirt.engine.core.bll.ValidationResult.failWith ( VdcBllMessages.CANNOT_CHANGE_ATTACHED_NETWORK ) . unless ( ( ( oldAttachment == null ) || ( java.util.Objects.equals ( oldAttachment.getNetworkId ( ) , attachment.getNetworkId ( ) ) ) ) ) ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult networkNotChanged ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment oldAttachment ) { boolean when = ( oldAttachment != null ) && ( ! ( java.util.Objects.equals ( oldAttachment.getNetworkId ( ) , attachment.getNetworkId ( ) ) ) ) ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( VdcBllMessages.CANNOT_CHANGE_ATTACHED_NETWORK ) . when ( when ) ; }
Source:
protected java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > getExistingStorageDomainList ( org.ovirt.engine.core.common.businessentities.StorageServerConnections storageServerConnection ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue = org.ovirt.engine.core.bll.storage.GetFileStorageDomainsWithAttachedStoragePoolGuidQuery.getBackend ( ) . runInternalQuery ( VdcQueryType.GetExistingStorageDomainList , new org.ovirt.engine.core.common.queries.GetExistingStorageDomainListParameters ( org.ovirt.engine.core.bll.storage.GetFileStorageDomainsWithAttachedStoragePoolGuidQuery.getVdsId ( ) , storageServerConnection.getstorage_type ( ) , org.ovirt.engine.core.common.businessentities.StorageDomainType.Data , storageServerConnection.getconnection ( ) ) ) ; return returnValue.getReturnValue ( ) ; }

Target:
protected org.ovirt.engine.core.common.queries.VdcQueryReturnValue getExistingStorageDomainList ( org.ovirt.engine.core.common.businessentities.StorageServerConnections storageServerConnection ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue = org.ovirt.engine.core.bll.storage.GetFileStorageDomainsWithAttachedStoragePoolGuidQuery.getBackend ( ) . runInternalQuery ( VdcQueryType.GetExistingStorageDomainList , new org.ovirt.engine.core.common.queries.GetExistingStorageDomainListParameters ( org.ovirt.engine.core.bll.storage.GetFileStorageDomainsWithAttachedStoragePoolGuidQuery.getVdsId ( ) , storageServerConnection.getstorage_type ( ) , org.ovirt.engine.core.common.businessentities.StorageDomainType.Data , storageServerConnection.getconnection ( ) ) ) ; return returnValue ; }
Source:
private void newEntity ( ) { org.ovirt.engine.core.common.businessentities.VM vm = getEntity ( ) ; if ( ( getWindow ( ) ) != null ) { return ; } org.ovirt.engine.ui.uicommonweb.models.vms.VmInterfaceModel model = org.ovirt.engine.ui.uicommonweb.models.vms.NewVmInterfaceModel.createInstance ( getEntity ( ) . getStaticData ( ) , getEntity ( ) . getVdsGroupCompatibilityVersion ( ) , ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( getItems ( ) ) ) , this ) ; setWindow ( model ) ; }

Target:
private void newEntity ( ) { if ( ( getWindow ( ) ) != null ) { return ; } org.ovirt.engine.ui.uicommonweb.models.vms.VmInterfaceModel model = org.ovirt.engine.ui.uicommonweb.models.vms.NewVmInterfaceModel.createInstance ( getEntity ( ) . getStaticData ( ) , getEntity ( ) . getVdsGroupCompatibilityVersion ( ) , ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( getItems ( ) ) ) , this ) ; setWindow ( model ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.DiskImage createDiskSnapshot ( org.ovirt.engine.core.compat.Guid diskId ) { return new org.ovirt.engine.core.common.businessentities.DiskImage ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextBoolean ( ) , new java.util.Date ( ) , new java.util.Date ( ) , 1L , "1" , org.ovirt.engine.core.compat.Guid.NewGuid ( ) , "2" , org.ovirt.engine.core.compat.Guid.NewGuid ( ) , 1L , vmID , diskId , org.ovirt.engine.core.common.businessentities.ImageStatus.OK , new java.util.Date ( ) , "" , org.ovirt.engine.core.common.businessentities.VmEntityType.VM , null , null , org.ovirt.engine.core.common.businessentities.QuotaEnforcementTypeEnum.DISABLED , false ) ; }

Target:
private org.ovirt.engine.core.common.businessentities.DiskImage createDiskSnapshot ( org.ovirt.engine.core.compat.Guid diskId ) { return new org.ovirt.engine.core.common.businessentities.DiskImage ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextBoolean ( ) , new java.util.Date ( ) , new java.util.Date ( ) , 1L , "1" , org.ovirt.engine.core.compat.Guid.NewGuid ( ) , "2" , org.ovirt.engine.core.compat.Guid.NewGuid ( ) , 1L , diskId , org.ovirt.engine.core.common.businessentities.ImageStatus.OK , new java.util.Date ( ) , "" , org.ovirt.engine.core.common.businessentities.VmEntityType.VM , 1 , null , null , org.ovirt.engine.core.common.businessentities.QuotaEnforcementTypeEnum.DISABLED , false ) ; }
Source:
public void validateFailsWithDuplicateVolumeName ( ) { cmd = org.mockito.Mockito.spy ( createTestCommand ( getVolume ( 2 , false ) ) ) ; prepareMocks ( cmd ) ; org.mockito.Mockito.doReturn ( getVolume ( 2 , false ) ) . when ( volumeDao ) . getByName ( org.ovirt.engine.core.bll.gluster.CreateGlusterVolumeCommandTest.clusterId , "vol1" ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_GLUSTER_VOLUME_NAME_ALREADY_EXISTS ) ; }

Target:
public void validateFailsWithDuplicateVolumeName ( ) { org.mockito.Mockito.doReturn ( getVolume ( 2 , false ) ) . when ( volumeDao ) . getByName ( org.ovirt.engine.core.bll.gluster.CreateGlusterVolumeCommandTest.clusterId , "vol1" ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_GLUSTER_VOLUME_NAME_ALREADY_EXISTS ) ; }
Source:
public void getUserNameFromUser ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; final org.ovirt.engine.core.common.businessentities.aaa.DbUser u = new org.ovirt.engine.core.common.businessentities.aaa.DbUser ( ) ; u.setLoginName ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME ) ; u.setDomain ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.DOMAIN ) ; b.setCurrentUser ( u ) ; final java.lang.String un = b.getUserName ( ) ; org.junit.Assert.assertEquals ( java.lang.String.format ( "%s@%s" , org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME , org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.DOMAIN ) , un ) ; }

Target:
public void getUserNameFromUser ( ) { final org.ovirt.engine.core.common.businessentities.aaa.DbUser u = new org.ovirt.engine.core.common.businessentities.aaa.DbUser ( ) ; u.setLoginName ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME ) ; u.setDomain ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.DOMAIN ) ; b.setCurrentUser ( u ) ; final java.lang.String un = b.getUserName ( ) ; org.junit.Assert.assertEquals ( java.lang.String.format ( "%s@%s" , org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME , org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.DOMAIN ) , un ) ; }
Source:
public void validateFailsForVdsNonUp ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.CreateBrickCommand ( new org.ovirt.engine.core.common.action.gluster.CreateBrickParameters ( ) ) ) ; prepareMocks ( cmd , VDSStatus.Down ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; org.mockito.Mockito.doReturn ( VDSStatus.Error ) . when ( vds ) . getStatus ( ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; org.mockito.Mockito.doReturn ( VDSStatus.Maintenance ) . when ( vds ) . getStatus ( ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; }

Target:
public void validateFailsForVdsNonUp ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.CreateBrickCommand ( new org.ovirt.engine.core.common.action.gluster.CreateBrickParameters ( ) , null ) ) ; prepareMocks ( cmd , VDSStatus.Down ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; org.mockito.Mockito.doReturn ( VDSStatus.Error ) . when ( vds ) . getStatus ( ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; org.mockito.Mockito.doReturn ( VDSStatus.Maintenance ) . when ( vds ) . getStatus ( ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; }
Source:
public boolean getIsDiskHotPlugSupported ( ) { org.ovirt.engine.core.common.businessentities.VM vm = getEntity ( ) ; boolean isVmStatusApplicableForHotPlug = ( vm != null ) && ( ( ( ( vm.getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Up ) ) || ( ( ( vm.getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Down ) ) | ( ( vm.getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Paused ) ) ) ) || ( ( vm.getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Suspended ) ) ) ; return ( privateIsDiskHotPlugSupported ) && isVmStatusApplicableForHotPlug ; }

Target:
public boolean getIsDiskHotPlugSupported ( ) { org.ovirt.engine.core.common.businessentities.VM vm = getEntity ( ) ; boolean isVmStatusApplicableForHotPlug = ( vm != null ) && ( ( ( ( vm.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Up ) ) || ( ( ( vm.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Down ) ) | ( ( vm.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Paused ) ) ) ) || ( ( vm.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Suspended ) ) ) ; return ( privateIsDiskHotPlugSupported ) && isVmStatusApplicableForHotPlug ; }
Source:
public void setUpDefaultEnvironment ( ) { java.lang.System.setProperty ( "ovirt-engine.config.defaults" , "src/test/resources/engine.conf.defaults" ) ; org.ovirt.engine.core.common.config.Config.setConfigUtils ( new org.ovirt.engine.core.dal.dbbroker.generic.DBConfigUtils ( ) ) ; org.ovirt.engine.core.common.config.Config.getConfigUtils ( ) . setStringValue ( ConfigValues.EnableVdsLoadBalancing.name ( ) , "false" ) ; defaultCluster = clusterBuilder.persist ( ) ; defaultHost = vdsBuilder.cluster ( defaultCluster ) . persist ( ) ; defaultVM = vmBuilder.host ( defaultHost ) . up ( ) . persist ( ) ; }

Target:
public void setUpDefaultEnvironment ( ) { java.lang.System.setProperty ( "ovirt-engine.config.defaults" , "src/test/resources/engine.conf.defaults" ) ; defaultCluster = clusterBuilder.persist ( ) ; defaultHost = vdsBuilder.cluster ( defaultCluster ) . persist ( ) ; defaultVM = vmBuilder.host ( defaultHost ) . up ( ) . persist ( ) ; }
Source:
public void testRemoveAll ( ) { org.ovirt.engine.core.common.businessentities.EngineSession result = dao.get ( existingEngineSession.getId ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( dao.removeAll ( ) , 1 ) ; result = dao.get ( existingEngineSession.getId ( ) ) ; org.junit.Assert.assertNull ( result ) ; org.junit.Assert.assertEquals ( dao.removeAll ( ) , 0 ) ; }

Target:
public void testRemoveAll ( ) { org.ovirt.engine.core.common.businessentities.EngineSession result = dao.get ( existingEngineSession.getId ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( dao.removeAll ( ) , 2 ) ; result = dao.get ( existingEngineSession.getId ( ) ) ; org.junit.Assert.assertNull ( result ) ; org.junit.Assert.assertEquals ( dao.removeAll ( ) , 0 ) ; }
Source:
public static void updateCurrentCd ( org.ovirt.engine.core.compat.Guid vdsId , org.ovirt.engine.core.common.businessentities.VM vm , java.lang.String currentCd ) { org.ovirt.engine.core.common.businessentities.VmDynamic vmDynamic = vm.getDynamicData ( ) ; vmDynamic.setCurrentCd ( currentCd ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.UpdateVmDynamicData , new org.ovirt.engine.core.common.vdscommands.UpdateVmDynamicDataVDSCommandParameters ( vdsId , vmDynamic ) ) ; }

Target:
public static void updateCurrentCd ( org.ovirt.engine.core.compat.Guid vdsId , org.ovirt.engine.core.common.businessentities.VM vm , java.lang.String currentCd ) { org.ovirt.engine.core.common.businessentities.VmDynamic vmDynamic = vm.getDynamicData ( ) ; vmDynamic.setCurrentCd ( currentCd ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.UpdateVmDynamicData , new org.ovirt.engine.core.common.vdscommands.UpdateVmDynamicDataVDSCommandParameters ( vmDynamic ) ) ; }
Source:
public void testGetFcp ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 1 , getFcpEntity ( ) ) ; setUpGetEntityExpectations ( VdcQueryType.GetLunsByVgId , org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters.class , new java.lang.String [ ] { "VgId" } , new java.lang.Object [ ] { GUIDS [ 0 ] . toString ( ) } , setUpLuns ( ) ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; control.replay ( ) ; verifyGetFcp ( resource.get ( ) ) ; }

Target:
public void testGetFcp ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 1 , getFcpEntity ( ) ) ; setUpGetEntityExpectations ( VdcQueryType.GetLunsByVgId , org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters.class , new java.lang.String [ ] { "VgId" } , new java.lang.Object [ ] { GUIDS [ 0 ] . toString ( ) } , setUpLuns ( ) ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; verifyGetFcp ( resource.get ( ) ) ; }