auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testSave ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkCluster > clustersFromDB = dbFacade.getNetworkClusterDao ( ) . getAllForCluster ( cluster ) ; org.ovirt.engine.core.common.businessentities.network.NetworkCluster clusterFromDB = clustersFromDB.get ( 0 ) ; org.junit.Assert.assertNotNull ( clusterFromDB ) ; new_net.setCluster ( clusterFromDB ) ; new_net.setId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; dao.save ( new_net ) ; org.ovirt.engine.core.common.businessentities.network.Network result = dao.getByName ( new_net.getname ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( new_net , result ) ; }

Target:
public void testSave ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkCluster > clustersFromDB = dbFacade.getNetworkClusterDao ( ) . getAllForCluster ( cluster ) ; org.ovirt.engine.core.common.businessentities.network.NetworkCluster clusterFromDB = clustersFromDB.get ( 0 ) ; org.junit.Assert.assertNotNull ( clusterFromDB ) ; new_net.setCluster ( clusterFromDB ) ; new_net.setId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; dao.save ( new_net ) ; org.ovirt.engine.core.common.businessentities.network.Network result = dao.getByName ( new_net.getName ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( new_net , result ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; importDiskId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; existingDiskId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; storageDomainId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; storagePoolId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; importDiskIds = new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( java.util.Arrays.asList ( importDiskId , existingDiskId ) ) ; prepareMocks ( ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; importDiskId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; existingDiskId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; storageDomainId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; storagePoolId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; importDiskIds = new java.util.ArrayList ( java.util.Arrays.asList ( importDiskId , existingDiskId ) ) ; prepareMocks ( ) ; }
Source:
public void checkRemoveNFSConnectionNoDomain ( ) { parameters.setStorageServerConnection ( NFSConnection ) ; org.mockito.Mockito.when ( storageServerConnectionDao.get ( NFSConnection.getid ( ) ) ) . thenReturn ( NFSConnection ) ; java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > domains = new java.util.ArrayList < > ( ) ; org.mockito.Mockito.doReturn ( domains ) . when ( command ) . getStorageDomainsByConnId ( NFSConnection.getid ( ) ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionSuccess ( command ) ; }

Target:
public void checkRemoveNFSConnectionNoDomain ( ) { parameters.setStorageServerConnection ( NFSConnection ) ; org.mockito.Mockito.when ( storageServerConnectionDao.get ( NFSConnection.getId ( ) ) ) . thenReturn ( NFSConnection ) ; java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > domains = new java.util.ArrayList < > ( ) ; org.mockito.Mockito.doReturn ( domains ) . when ( command ) . getStorageDomainsByConnId ( NFSConnection.getId ( ) ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionSuccess ( command ) ; }
Source:
protected void executeQueryCommand ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage_domains > result = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageDomainDao ( ) . getAllForStorageDomain ( org.ovirt.engine.core.bll.storage.GetStorageDomainListByIdQuery.getParameters ( ) . getStorageDomainId ( ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_domains > temp = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_domains > ( result ) ; for ( org.ovirt.engine.core.common.businessentities.storage_domains domain : temp ) { if ( ( domain.getstorage_domain_shared_status ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainSharedStatus.Unattached ) ) { result.remove ( domain ) ; } } org.ovirt.engine.core.bll.storage.GetStorageDomainListByIdQuery.getQueryReturnValue ( ) . setReturnValue ( result ) ; }

Target:
protected void executeQueryCommand ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > result = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageDomainDao ( ) . getAllForStorageDomain ( org.ovirt.engine.core.bll.storage.GetStorageDomainListByIdQuery.getParameters ( ) . getStorageDomainId ( ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > temp = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( result ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain domain : temp ) { if ( ( domain.getstorage_domain_shared_status ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainSharedStatus.Unattached ) ) { result.remove ( domain ) ; } } org.ovirt.engine.core.bll.storage.GetStorageDomainListByIdQuery.getQueryReturnValue ( ) . setReturnValue ( result ) ; }
Source:
public void testCleanExpiredUsersSessionsNoUsers ( ) { org.ovirt.engine.core.dao.DbUserDAO dbUserDAOMcok = initDataForClearTest ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_KEY ) ; container.cleanExpiredUsersSessions ( ) ; container.cleanExpiredUsersSessions ( ) ; org.junit.Assert.assertNull ( "Get should return null since the session was removed" , container.GetData ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_SESSION_ID , org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_KEY , false ) ) ; org.mockito.Mockito.verifyZeroInteractions ( dbUserDAOMcok ) ; }

Target:
public void testCleanExpiredUsersSessionsNoUsers ( ) { initDataForClearTest ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_KEY ) ; container.cleanExpiredUsersSessions ( ) ; container.cleanExpiredUsersSessions ( ) ; org.junit.Assert.assertNull ( "Get should return null since the session was removed" , container.GetData ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_SESSION_ID , org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_KEY , false ) ) ; }
Source:
public void CreateADSyntaxChecker ( ) { org.ovirt.engine.core.searchbackend.ISyntaxChecker checker = org.ovirt.engine.core.searchbackend.SyntaxCheckerFactory.createADSyntaxChecker ( "foo" ) ; org.junit.Assert.assertNotNull ( checker ) ; org.junit.Assert.assertEquals ( checker , org.ovirt.engine.core.searchbackend.SyntaxCheckerFactory.createADSyntaxChecker ( "foo" ) ) ; org.junit.Assert.assertEquals ( "foo" , org.ovirt.engine.core.searchbackend.SyntaxCheckerFactory.getConfigAuthenticationMethod ( ) ) ; }

Target:
public void createADSyntaxChecker ( ) { org.ovirt.engine.core.searchbackend.ISyntaxChecker checker = org.ovirt.engine.core.searchbackend.SyntaxCheckerFactory.createADSyntaxChecker ( "foo" ) ; org.junit.Assert.assertNotNull ( checker ) ; org.junit.Assert.assertEquals ( checker , org.ovirt.engine.core.searchbackend.SyntaxCheckerFactory.createADSyntaxChecker ( "foo" ) ) ; org.junit.Assert.assertEquals ( "foo" , org.ovirt.engine.core.searchbackend.SyntaxCheckerFactory.getConfigAuthenticationMethod ( ) ) ; }
Source:
public void provisioningValidated ( ) throws java.lang.Exception { setupVirtMock ( ) ; org.junit.Assert.assertTrue ( commandMock.canDoAction ( ) ) ; org.mockito.Mockito.verify ( validator , org.mockito.Mockito.times ( 1 ) ) . provisioningComputeResourceValid ( org.mockito.Matchers.any ( java.lang.Boolean.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.ExternalComputeResource.class ) ) ; org.mockito.Mockito.verify ( validator , org.mockito.Mockito.times ( 1 ) ) . provisioningHostGroupValid ( org.mockito.Matchers.any ( java.lang.Boolean.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.ExternalHostGroup.class ) ) ; }

Target:
public void provisioningValidated ( ) throws java.lang.Exception { setupVirtMock ( ) ; org.junit.Assert.assertTrue ( commandMock.validate ( ) ) ; org.mockito.Mockito.verify ( validator , org.mockito.Mockito.times ( 1 ) ) . provisioningComputeResourceValid ( org.mockito.Matchers.any ( java.lang.Boolean.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.ExternalComputeResource.class ) ) ; org.mockito.Mockito.verify ( validator , org.mockito.Mockito.times ( 1 ) ) . provisioningHostGroupValid ( org.mockito.Matchers.any ( java.lang.Boolean.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.ExternalHostGroup.class ) ) ; }
Source:
public void testGetIncludeStatistics ( ) throws java.lang.Exception { try { accepts.add ( "application/xml; detail=statistics" ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; setAllContentHeaderExpectation ( ) ; setUpEntityQueryExpectations ( 1 ) ; setGetGuestAgentQueryExpectations ( 1 ) ; control.replay ( ) ; org.ovirt.engine.api.model.Nic nic = resource.get ( ) ; assertTrue ( nic.isSetStatistics ( ) ) ; verifyModelSpecific ( nic , 1 ) ; verifyLinks ( nic ) ; } finally { accepts.clear ( ) ; } }

Target:
public void testGetIncludeStatistics ( ) throws java.lang.Exception { try { accepts.add ( "application/xml; detail=statistics" ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; setAllContentHeaderExpectation ( ) ; setUpEntityQueryExpectations ( 1 ) ; setGetGuestAgentQueryExpectations ( 1 ) ; org.ovirt.engine.api.model.Nic nic = resource.get ( ) ; assertTrue ( nic.isSetStatistics ( ) ) ; verifyModelSpecific ( nic , 1 ) ; verifyLinks ( nic ) ; } finally { accepts.clear ( ) ; } }
Source:
public void testAddIncompleteParameters ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Disk model = new org.ovirt.engine.api.model.Disk ( ) ; model.setName ( NAMES [ 0 ] ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; control.replay ( ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Disk" , "add" , "provisionedSize|size" , "format" , "interface" ) ; } }

Target:
public void testAddIncompleteParameters ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Disk model = new org.ovirt.engine.api.model.Disk ( ) ; model.setName ( NAMES [ 0 ] ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; control.replay ( ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Disk" , "add" , "format" , "interface" ) ; } }
Source:
private org.ovirt.engine.core.common.businessentities.Snapshot getActiveSnapshot ( ) { for ( org.ovirt.engine.core.common.businessentities.Snapshot snapshot : getVm ( ) . getSnapshots ( ) ) { if ( ( snapshot.getType ( ) ) == ( org.ovirt.engine.core.common.businessentities.Snapshot.SnapshotType.ACTIVE ) ) return snapshot ; } org.ovirt.engine.core.bll.ImportVmCommand.log.warn ( "VM '{}' doesn't have active snapshot in export domain" , getVmId ( ) ) ; return null ; }

Target:
protected org.ovirt.engine.core.common.businessentities.Snapshot getActiveSnapshot ( ) { for ( org.ovirt.engine.core.common.businessentities.Snapshot snapshot : getVm ( ) . getSnapshots ( ) ) { if ( ( snapshot.getType ( ) ) == ( org.ovirt.engine.core.common.businessentities.Snapshot.SnapshotType.ACTIVE ) ) return snapshot ; } org.ovirt.engine.core.bll.ImportVmCommand.log.warn ( "VM '{}' doesn't have active snapshot in export domain" , getVmId ( ) ) ; return null ; }
Source:
public static < P extends org.ovirt.engine.core.common.action.VdcActionParametersBase > boolean hasConstructor ( org.ovirt.engine.core.common.action.VdcActionType action , P parameters ) { return ( org.ovirt.engine.core.utils.ReflectionUtils.findConstructor ( org.ovirt.engine.core.bll.CommandsFactory.getCommandClass ( action.name ( ) , org.ovirt.engine.core.bll.CommandsFactory.CommandSuffix ) , parameters.getClass ( ) ) ) != null ; }

Target:
public static < P extends org.ovirt.engine.core.common.action.VdcActionParametersBase > boolean hasConstructor ( org.ovirt.engine.core.common.action.VdcActionType action , P parameters ) { return ( org.ovirt.engine.core.utils.ReflectionUtils.findConstructor ( org.ovirt.engine.core.bll.CommandsFactory.getCommandClass ( action.name ( ) ) , parameters.getClass ( ) ) ) != null ; }
Source:
public org.ovirt.engine.api.resource.StatisticsResource getStatisticsResource ( ) { org.ovirt.engine.api.restapi.resource.EntityIdResolver < org.ovirt.engine.core.compat.Guid > resolver = new org.ovirt.engine.api.restapi.resource.EntityIdResolver < org.ovirt.engine.core.compat.Guid > ( ) { @ java.lang.Override public org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface lookupEntity ( org.ovirt.engine.core.compat.Guid guid ) throws org.ovirt.engine.api.restapi.resource.BackendFailureException { return parent.lookupInterface ( id ) ; } } ; org.ovirt.engine.api.restapi.resource.HostNicStatisticalQuery query = new org.ovirt.engine.api.restapi.resource.HostNicStatisticalQuery ( resolver , newModel ( id ) ) ; return inject ( new org.ovirt.engine.api.restapi.resource.BackendStatisticsResource < org.ovirt.engine.api.model.HostNIC , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ( entityType , guid , query ) ) ; }

Target:
public org.ovirt.engine.api.resource.StatisticsResource getStatisticsResource ( ) { org.ovirt.engine.api.restapi.resource.EntityIdResolver < org.ovirt.engine.core.compat.Guid > resolver = new org.ovirt.engine.api.restapi.resource.EntityIdResolver < org.ovirt.engine.core.compat.Guid > ( ) { @ java.lang.Override public org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface lookupEntity ( org.ovirt.engine.core.compat.Guid guid ) throws org.ovirt.engine.api.restapi.resource.BackendFailureException { return parent.lookupInterface ( id ) ; } } ; org.ovirt.engine.api.restapi.resource.HostNicStatisticalQuery query = new org.ovirt.engine.api.restapi.resource.HostNicStatisticalQuery ( resolver , newModel ( id ) ) ; return inject ( new org.ovirt.engine.api.restapi.resource.BackendStatisticsResource ( entityType , guid , query ) ) ; }
Source:
public void checkShowLocks ( ) { org.junit.Assert.assertTrue ( org.ovirt.engine.core.utils.lock.LockManagerFactory.getLockManager ( ) . acquireLock ( lockLock1 ) . getFirst ( ) ) ; org.junit.Assert.assertTrue ( org.ovirt.engine.core.utils.lock.LockManagerFactory.getLockManager ( ) . acquireLock ( lockLock2 ) . getFirst ( ) ) ; org.junit.Assert.assertTrue ( ( ( lockMager.showAllLocks ( ) . size ( ) ) == 2 ) ) ; org.ovirt.engine.core.utils.lock.LockManagerFactory.getLockManager ( ) . clear ( ) ; org.junit.Assert.assertTrue ( lockMager.showAllLocks ( ) . isEmpty ( ) ) ; }

Target:
public void checkShowLocks ( ) { org.junit.Assert.assertTrue ( org.ovirt.engine.core.utils.lock.LockManagerFactory.getLockManager ( ) . acquireLock ( lockLock1 ) . getFirst ( ) ) ; org.junit.Assert.assertTrue ( org.ovirt.engine.core.utils.lock.LockManagerFactory.getLockManager ( ) . acquireLock ( lockLock2 ) . getFirst ( ) ) ; org.junit.Assert.assertEquals ( 2 , lockMager.showAllLocks ( ) . size ( ) ) ; org.ovirt.engine.core.utils.lock.LockManagerFactory.getLockManager ( ) . clear ( ) ; org.junit.Assert.assertTrue ( lockMager.showAllLocks ( ) . isEmpty ( ) ) ; }
Source:
public void testAddIncompleteParameters ( ) throws java.lang.Exception { org.ovirt.engine.api.model.MacPool model = createIncompleteMacPool ( ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; control.replay ( ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "MacPool" , "add" , getIncompleteFields ( ) ) ; } }

Target:
public void testAddIncompleteParameters ( ) throws java.lang.Exception { org.ovirt.engine.api.model.MacPool model = createIncompleteMacPool ( ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "MacPool" , "add" , getIncompleteFields ( ) ) ; } }
Source:
public void testGetStorageDomainIdWithPermissions ( ) { mockStoragePoolDao ( new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ) ; org.ovirt.engine.core.dao.StorageDomainDao storageDomainDaoMock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.StorageDomainDao.class ) ; org.mockito.Mockito.when ( storageDomainDaoMock.getIsoStorageDomainIdForPool ( getQueryParameters ( ) . getStoragePoolId ( ) , StorageDomainStatus.Active ) ) . thenReturn ( storageDomainId ) ; org.mockito.Mockito.when ( getDbFacadeMockInstance ( ) . getStorageDomainDao ( ) ) . thenReturn ( storageDomainDaoMock ) ; org.junit.Assert.assertEquals ( "wrong storage domain id" , storageDomainId , getQuery ( ) . getStorageDomainIdForQuery ( ) ) ; }

Target:
public void testGetStorageDomainIdWithPermissions ( ) { mockStoragePoolDao ( new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ) ; org.mockito.Mockito.when ( storageDomainDaoMock.getIsoStorageDomainIdForPool ( getQueryParameters ( ) . getStoragePoolId ( ) , StorageDomainStatus.Active ) ) . thenReturn ( storageDomainId ) ; org.junit.Assert.assertEquals ( "wrong storage domain id" , storageDomainId , getQuery ( ) . getStorageDomainIdForQuery ( ) ) ; }
Source:
public static void getExternalNetworkMap ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid providerId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.HashMap < org.ovirt.engine.core.common.businessentities.network.Network , java.util.Set < org.ovirt.engine.core.compat.Guid > > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllExternalNetworksOnProvider , new org.ovirt.engine.core.common.queries.IdQueryParameters ( providerId ) , aQuery ) ; }

Target:
public static void getExternalNetworkMap ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid providerId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.HashMap < org.ovirt.engine.core.common.businessentities.network.Network , java.util.Set < org.ovirt.engine.core.compat.Guid > > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllExternalNetworksOnProvider , new org.ovirt.engine.core.common.queries.IdQueryParameters ( providerId ) , aQuery ) ; }
Source:
protected void onActionSucceeded ( org.ovirt.engine.core.compat.Guid macPoolId ) { org.ovirt.engine.core.common.businessentities.MacPool macPool = getEntity ( ) ; macPool.setId ( macPoolId ) ; java.util.Collection < org.ovirt.engine.core.common.businessentities.MacPool > macPools = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.MacPool > ( dcModel.getMacPoolListModel ( ) . getItems ( ) ) ; macPools.add ( macPool ) ; dcModel.getMacPoolListModel ( ) . setItems ( macPools ) ; dcModel.getMacPoolListModel ( ) . setSelectedItem ( macPool ) ; this . setConfirmWindow ( null ) ; }

Target:
protected void onActionSucceeded ( org.ovirt.engine.core.compat.Guid macPoolId ) { org.ovirt.engine.core.common.businessentities.MacPool macPool = getEntity ( ) ; macPool.setId ( macPoolId ) ; java.util.Collection < org.ovirt.engine.core.common.businessentities.MacPool > macPools = new java.util.ArrayList ( dcModel.getMacPoolListModel ( ) . getItems ( ) ) ; macPools.add ( macPool ) ; dcModel.getMacPoolListModel ( ) . setItems ( macPools ) ; dcModel.getMacPoolListModel ( ) . setSelectedItem ( macPool ) ; this . setConfirmWindow ( null ) ; }
Source:
public void executeCommand ( ) { cmd = org.mockito.Mockito.spy ( createTestCommand ( volumeId1 ) ) ; prepareMocks ( cmd ) ; cmd.executeCommand ( ) ; org.junit.Assert.assertEquals ( cmd.getAuditLogTypeValue ( ) , AuditLogType.GLUSTER_VOLUME_DETAILS_REFRESH ) ; org.mockito.Mockito.verify ( syncJob , org.mockito.Mockito.times ( 1 ) ) . refreshVolumeDetails ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.VDS.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity.class ) ) ; }

Target:
public void executeCommand ( ) { cmd = org.mockito.Mockito.spy ( createTestCommand ( volumeId1 ) ) ; prepareMocks ( cmd ) ; cmd.executeCommand ( ) ; org.junit.Assert.assertEquals ( AuditLogType.GLUSTER_VOLUME_DETAILS_REFRESH , cmd.getAuditLogTypeValue ( ) ) ; org.mockito.Mockito.verify ( syncJob , org.mockito.Mockito.times ( 1 ) ) . refreshVolumeDetails ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.VDS.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity.class ) ) ; }
Source:
public void setUp ( ) throws java.io.IOException { org.ovirt.engine.core.common.utils.SimpleDependencyInjector.getInstance ( ) . bind ( org.ovirt.engine.core.common.osinfo.OsRepository.class , osRepository ) ; org.mockito.Mockito.doReturn ( cluster ) . when ( cmd ) . getCluster ( ) ; org.mockito.Mockito.doReturn ( java.util.Collections.emptyList ( ) ) . when ( cmd ) . getImages ( ) ; mockCluster ( ) ; setXmlOvfData ( ) ; }

Target:
public void setUp ( ) throws java.io.IOException { org.mockito.Mockito.doReturn ( cluster ) . when ( cmd ) . getCluster ( ) ; org.mockito.Mockito.doReturn ( java.util.Collections.emptyList ( ) ) . when ( cmd ) . getImages ( ) ; mockCluster ( ) ; setXmlOvfData ( ) ; }
Source:
public void testUpdateConsoleUserWithOptimisticLockingFailure ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.VmDynamic vmWithoutConsoleUser = dao.get ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( "77296e00-0cad-4e5a-9299-008a7b6f4355" ) ) ; vmWithoutConsoleUser.setConsoleUserId ( org.ovirt.engine.core.compat.NGuid.createGuidFromString ( "9bf7c640-b620-456f-a550-0348f366544b" ) ) ; boolean result = dao.updateConsoleUserWithOptimisticLocking ( vmWithoutConsoleUser ) ; org.junit.Assert.assertFalse ( result ) ; }

Target:
public void testUpdateConsoleUserWithOptimisticLockingFailure ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.VmDynamic vmWithoutConsoleUser = dao.get ( new org.ovirt.engine.core.compat.Guid ( "77296e00-0cad-4e5a-9299-008a7b6f4355" ) ) ; vmWithoutConsoleUser.setConsoleUserId ( new org.ovirt.engine.core.compat.Guid ( "9bf7c640-b620-456f-a550-0348f366544b" ) ) ; boolean result = dao.updateConsoleUserWithOptimisticLocking ( vmWithoutConsoleUser ) ; org.junit.Assert.assertFalse ( result ) ; }
Source:
public void canDoActionFailedShareableDiskVolumeFormatUnsupported ( ) throws java.lang.Exception { org.ovirt.engine.core.common.action.UpdateVmDiskParameters parameters = createParameters ( ) ; parameters.setDiskInfo ( createShareableDisk ( VolumeFormat.COW ) ) ; org.mockito.Mockito.when ( diskDao.get ( diskImageGuid ) ) . thenReturn ( createDiskImage ( ) ) ; initializeCommand ( parameters ) ; mockVmStatusDown ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.SHAREABLE_DISK_IS_NOT_SUPPORTED_BY_VOLUME_FORMAT.toString ( ) ) ) ; }

Target:
public void canDoActionFailedShareableDiskVolumeFormatUnsupported ( ) throws java.lang.Exception { org.ovirt.engine.core.common.action.UpdateVmDiskParameters parameters = createParameters ( ) ; parameters.setDiskInfo ( createShareableDisk ( VolumeFormat.COW ) ) ; org.mockito.Mockito.when ( diskDao.get ( diskImageGuid ) ) . thenReturn ( createDiskImage ( ) ) ; initializeCommand ( parameters ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.SHAREABLE_DISK_IS_NOT_SUPPORTED_BY_VOLUME_FORMAT.toString ( ) ) ) ; }
Source:
public void canAddCloneVmFromSnapshotSnapshotDoesNotExist ( ) { final int domainSizeGB = 15 ; final int sizeRequired = 4 ; final org.ovirt.engine.core.compat.Guid sourceSnapshotId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.ovirt.engine.core.bll.AddVmFromSnapshotCommand < org.ovirt.engine.core.common.action.AddVmFromSnapshotParameters > cmd = setupCanAddVmFromSnapshotTests ( domainSizeGB , sizeRequired , sourceSnapshotId ) ; cmd.getVm ( ) . setName ( "vm1" ) ; mockNonInterestingMethodsForCloneVmFromSnapshot ( cmd ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_VM_SNAPSHOT_DOES_NOT_EXIST ) ; }

Target:
public void canAddCloneVmFromSnapshotSnapshotDoesNotExist ( ) { final int domainSizeGB = 15 ; final org.ovirt.engine.core.compat.Guid sourceSnapshotId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.ovirt.engine.core.bll.AddVmFromSnapshotCommand < org.ovirt.engine.core.common.action.AddVmFromSnapshotParameters > cmd = setupCanAddVmFromSnapshotTests ( domainSizeGB , sourceSnapshotId ) ; cmd.getVm ( ) . setName ( "vm1" ) ; mockNonInterestingMethodsForCloneVmFromSnapshot ( cmd ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_VM_SNAPSHOT_DOES_NOT_EXIST ) ; }
Source:
private void saveSetInitializedToDb ( final org.ovirt.engine.core.compat.Guid vmId ) { org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInScope ( TransactionScopeOption.RequiresNew , new org.ovirt.engine.core.utils.transaction.TransactionMethod < java.lang.Void > ( ) { @ java.lang.Override public java.lang.Void runInTransaction ( ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDao ( ) . saveIsInitialized ( vmId , true ) ; return null ; } } ) ; }

Target:
private void saveSetInitializedToDb ( final org.ovirt.engine.core.compat.Guid vmId ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDao ( ) . saveIsInitialized ( vmId , true ) ; }
Source:
private void assertNetworkAttachment ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment , org.ovirt.engine.core.compat.Guid attachmentId , org.ovirt.engine.core.compat.Guid networkId , org.ovirt.engine.core.compat.Guid nicId ) { org.hamcrest.Matcher attachmentIdMatcher = ( attachmentId == null ) ? org.hamcrest.CoreMatchers.nullValue ( ) : org.hamcrest.CoreMatchers.is ( attachmentId ) ; org.junit.Assert.assertThat ( "id mismatch" , networkAttachment.getId ( ) , attachmentIdMatcher ) ; org.junit.Assert.assertThat ( "network id mismatch" , networkAttachment.getNetworkId ( ) , org.hamcrest.CoreMatchers.equalTo ( networkId ) ) ; org.junit.Assert.assertThat ( "nicId mismatch" , networkAttachment.getNicId ( ) , org.hamcrest.CoreMatchers.equalTo ( nicId ) ) ; }

Target:
private void assertNetworkAttachment ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment , org.ovirt.engine.core.compat.Guid attachmentId , org.ovirt.engine.core.compat.Guid networkId , org.ovirt.engine.core.compat.Guid nicId ) { org.junit.Assert.assertThat ( "id mismatch" , networkAttachment.getId ( ) , org.hamcrest.CoreMatchers.is ( attachmentId ) ) ; org.junit.Assert.assertThat ( "network id mismatch" , networkAttachment.getNetworkId ( ) , org.hamcrest.CoreMatchers.equalTo ( networkId ) ) ; org.junit.Assert.assertThat ( "nicId mismatch" , networkAttachment.getNicId ( ) , org.hamcrest.CoreMatchers.equalTo ( nicId ) ) ; }
Source:
public void testConnection ( ) { try { getClient ( ) . execute ( new com.woorea.openstack.base.client.OpenStackRequest ( getClient ( ) , com.woorea.openstack.base.client.HttpMethod.GET , "" , null , org.ovirt.engine.core.bll.provider.network.openstack.BaseNetworkProviderProxy.ApiRootResponse.class ) ) ; } catch ( com.woorea.openstack.base.client.OpenStackResponseException e ) { org.ovirt.engine.core.bll.provider.network.openstack.BaseNetworkProviderProxy.log.error ( "{} (OpenStack response error code: {})" , e.getMessage ( ) , e.getStatus ( ) ) ; org.ovirt.engine.core.bll.provider.network.openstack.BaseNetworkProviderProxy.log.debug ( "Exception" , e ) ; throw new org.ovirt.engine.core.common.errors.EngineException ( org.ovirt.engine.core.common.errors.EngineError.PROVIDER_FAILURE , e ) ; } catch ( java.lang.RuntimeException e ) { throw new org.ovirt.engine.core.common.errors.EngineException ( org.ovirt.engine.core.common.errors.EngineError.PROVIDER_FAILURE , e ) ; } }

Target:
public void testConnection ( ) { execute ( new com.woorea.openstack.base.client.OpenStackRequest ( getClient ( ) , com.woorea.openstack.base.client.HttpMethod.GET , "" , null , org.ovirt.engine.core.bll.provider.network.openstack.BaseNetworkProviderProxy.ApiRootResponse.class ) ) ; }
Source:
public static < TSource > java.util.List < TSource > where ( java.util.Collection < ? extends TSource > source , org.ovirt.engine.ui.uicommonweb.Linq.IPredicate < ? super TSource > predicate ) { java.util.List < TSource > list = new java.util.ArrayList < TSource > ( ) ; for ( TSource item : source ) { if ( predicate.match ( item ) ) { list.add ( item ) ; } } return list ; }

Target:
public static < TSource > java.util.Collection < TSource > where ( java.util.Collection < TSource > source , org.ovirt.engine.ui.uicommonweb.Linq.IPredicate < TSource > predicate ) { java.util.ArrayList < TSource > list = new java.util.ArrayList < TSource > ( ) ; for ( TSource item : source ) { if ( predicate.match ( item ) ) { list.add ( item ) ; } } return list ; }
Source:
public void setEntity ( java.lang.Object value ) { org.ovirt.engine.core.common.businessentities.VDS vds = ( ( org.ovirt.engine.core.common.businessentities.VDS ) ( value ) ) ; updateUpgradeAlert = ( ( ( vds == null ) || ( ( getEntity ( ) ) == null ) ) || ( ! ( vds.getId ( ) . equals ( getEntity ( ) . getId ( ) ) ) ) ) || ( ! ( vds.getStatus ( ) . equals ( getEntity ( ) . getStatus ( ) ) ) ) ; super . setEntity ( value ) ; }

Target:
public void setEntity ( org.ovirt.engine.core.common.businessentities.VDS vds ) { updateUpgradeAlert = ( ( ( vds == null ) || ( ( getEntity ( ) ) == null ) ) || ( ! ( vds.getId ( ) . equals ( getEntity ( ) . getId ( ) ) ) ) ) || ( ! ( vds.getStatus ( ) . equals ( getEntity ( ) . getStatus ( ) ) ) ) ; super . setEntity ( vds ) ; }
Source:
private void extractRemovedBonds ( ) { for ( org.ovirt.engine.core.common.businessentities.VdsNetworkInterface iface : getExistingIfaces ( ) . values ( ) ) { java.lang.String bondName = iface.getBondName ( ) ; if ( ( org.apache.commons.lang.StringUtils.isNotBlank ( bondName ) ) && ( ! ( bonds.containsKey ( bondName ) ) ) ) { removedBonds.add ( getExistingIfaces ( ) . get ( bondName ) ) ; } } }

Target:
private void extractRemovedBonds ( ) { for ( org.ovirt.engine.core.common.businessentities.VdsNetworkInterface iface : getExistingIfaces ( ) . values ( ) ) { java.lang.String bondName = iface.getBondName ( ) ; if ( ( org.apache.commons.lang.StringUtils.isNotBlank ( bondName ) ) && ( ! ( bonds.containsKey ( bondName ) ) ) ) { removedBonds.add ( bondName ) ; } } }
Source:
protected java.lang.String getMemoryFromActiveSnapshot ( ) { if ( memoryFromSnapshotUsed ) { return org.apache.commons.lang.StringUtils.EMPTY ; } if ( ( getFlow ( ) ) == ( org.ovirt.engine.core.common.action.RunVmParams.RunVmFlow.RESUME_HIBERNATE ) ) { return org.ovirt.engine.core.bll.RunVmCommand.getActiveSnapshot ( ) . getMemoryVolume ( ) ; } if ( ! ( org.ovirt.engine.core.common.FeatureSupported.isMemorySnapshotSupportedByArchitecture ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getClusterArch ( ) , org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getCompatibilityVersion ( ) ) ) ) { return org.apache.commons.lang.StringUtils.EMPTY ; } return org.ovirt.engine.core.bll.RunVmCommand.getActiveSnapshot ( ) . getMemoryVolume ( ) ; }

Target:
private java.lang.String getMemoryFromActiveSnapshot ( ) { if ( memoryFromSnapshotUsed ) { return org.apache.commons.lang.StringUtils.EMPTY ; } if ( ( getFlow ( ) ) == ( org.ovirt.engine.core.common.action.RunVmParams.RunVmFlow.RESUME_HIBERNATE ) ) { return org.ovirt.engine.core.bll.RunVmCommand.getActiveSnapshot ( ) . getMemoryVolume ( ) ; } if ( ! ( org.ovirt.engine.core.common.FeatureSupported.isMemorySnapshotSupportedByArchitecture ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getClusterArch ( ) , org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getCompatibilityVersion ( ) ) ) ) { return org.apache.commons.lang.StringUtils.EMPTY ; } return org.ovirt.engine.core.bll.RunVmCommand.getActiveSnapshot ( ) . getMemoryVolume ( ) ; }
Source:
public void testAddOperationAction ( ) { org.ovirt.engine.ui.frontend.communication.VdcOperation < org.ovirt.engine.core.common.action.ActionType , org.ovirt.engine.core.common.action.ActionParametersBase > testOperation = new org.ovirt.engine.ui.frontend.communication.VdcOperation ( org.ovirt.engine.core.common.action.ActionType.AddNetworkOnProvider , new org.ovirt.engine.core.common.action.ActionParametersBase ( ) , null ) ; testManager.addOperation ( testOperation ) ; org.mockito.Mockito.verify ( mockOperationProcessor ) . processOperation ( testManager ) ; org.mockito.Mockito.verify ( mockEventBus ) . fireEvent ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.ui.frontend.communication.EngineSessionRefreshedEvent.class ) ) ; org.junit.Assert.assertEquals ( "Operations must match" , testOperation , testManager.pollOperation ( ) ) ; }

Target:
public void testAddOperationAction ( ) { org.ovirt.engine.ui.frontend.communication.VdcOperation < org.ovirt.engine.core.common.action.ActionType , org.ovirt.engine.core.common.action.ActionParametersBase > testOperation = new org.ovirt.engine.ui.frontend.communication.VdcOperation ( org.ovirt.engine.core.common.action.ActionType.AddNetworkOnProvider , new org.ovirt.engine.core.common.action.ActionParametersBase ( ) , null ) ; testManager.addOperation ( testOperation ) ; org.mockito.Mockito.verify ( mockOperationProcessor ) . processOperation ( testManager ) ; org.mockito.Mockito.verify ( mockEventBus ) . fireEvent ( org.mockito.ArgumentMatchers.any ( ) ) ; org.junit.Assert.assertEquals ( "Operations must match" , testOperation , testManager.pollOperation ( ) ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService insertTestService ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService service = new org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService ( ) ; service.setId ( org.ovirt.engine.core.compat.Guid.createGuidFromStringDefaultEmpty ( org.ovirt.engine.core.dao.gluster.GlusterServerServiceDaoTest.NEW_SERVICE_ID ) ) ; service.setServerId ( org.ovirt.engine.core.compat.Guid.createGuidFromStringDefaultEmpty ( org.ovirt.engine.core.dao.gluster.GlusterServerServiceDaoTest.SERVER1_ID ) ) ; service.setServiceId ( org.ovirt.engine.core.compat.Guid.createGuidFromStringDefaultEmpty ( org.ovirt.engine.core.dao.gluster.GlusterServerServiceDaoTest.SERVICE2_ID ) ) ; service.setServiceType ( org.ovirt.engine.core.dao.gluster.GlusterServerServiceDaoTest.SERVICE2_TYPE ) ; service.setStatus ( GlusterServiceStatus.UNKNOWN ) ; service.setMessage ( "test message" ) ; service.setPid ( org.ovirt.engine.core.dao.gluster.GlusterServerServiceDaoTest.NEW_PID ) ; service.setHostName ( org.ovirt.engine.core.dao.gluster.GlusterServerServiceDaoTest.VDS_NAME1 ) ; dao.save ( service ) ; return service ; }

Target:
private org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService insertTestService ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService service = new org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService ( ) ; service.setId ( org.ovirt.engine.core.dao.gluster.GlusterServerServiceDaoTest.NEW_SERVICE_ID ) ; service.setServerId ( org.ovirt.engine.core.dao.gluster.GlusterServerServiceDaoTest.SERVER1_ID ) ; service.setServiceId ( org.ovirt.engine.core.dao.gluster.GlusterServerServiceDaoTest.SERVICE2_ID ) ; service.setServiceType ( org.ovirt.engine.core.dao.gluster.GlusterServerServiceDaoTest.SERVICE2_TYPE ) ; service.setStatus ( GlusterServiceStatus.UNKNOWN ) ; service.setMessage ( "test message" ) ; service.setPid ( org.ovirt.engine.core.dao.gluster.GlusterServerServiceDaoTest.NEW_PID ) ; service.setHostName ( org.ovirt.engine.core.dao.gluster.GlusterServerServiceDaoTest.VDS_NAME1 ) ; dao.save ( service ) ; return service ; }
Source:
public void fillReportedConfigurations ( java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > networkAttachments , org.ovirt.engine.core.compat.Guid hostId ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > allInterfacesForHost = interfaceDao.getAllInterfacesForVds ( hostId ) ; java.util.Map < java.lang.String , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > networkNameToNicMap = nicsByNetworkId ( allInterfacesForHost ) ; org.ovirt.engine.core.common.businessentities.BusinessEntityMap < org.ovirt.engine.core.common.businessentities.network.Network > networkMap = new org.ovirt.engine.core.common.businessentities.BusinessEntityMap ( networkDao.getAllForCluster ( vdsDao.get ( hostId ) . getClusterId ( ) ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment : networkAttachments ) { fillReportedConfigurations ( networkNameToNicMap , networkMap , networkAttachment ) ; } }

Target:
public void fillReportedConfigurations ( java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > networkAttachments , org.ovirt.engine.core.compat.Guid hostId ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > allInterfacesForHost = interfaceDao.getAllInterfacesForVds ( hostId ) ; org.ovirt.engine.core.common.businessentities.BusinessEntityMap < org.ovirt.engine.core.common.businessentities.network.Network > networkMap = new org.ovirt.engine.core.common.businessentities.BusinessEntityMap ( networkDao.getAllForCluster ( vdsDao.get ( hostId ) . getClusterId ( ) ) ) ; fillReportedConfigurations ( allInterfacesForHost , networkMap , networkAttachments ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { if ( ! ( getCluster ( ) . getSelectedItem ( ) . getId ( ) . equals ( cluster.getId ( ) ) ) ) { return ; } if ( ( ( java.lang.Boolean ) ( returnValue ) ) ) { getAddBricksCommand ( ) . setIsExecutionAllowed ( true ) ; setMessage ( null ) ; } else { getAddBricksCommand ( ) . setIsExecutionAllowed ( false ) ; setMessage ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . volumeEmptyClusterValidationMsg ( ) ) ; } }

Target:
public void onSuccess ( java.lang.Boolean returnValue ) { if ( ! ( getCluster ( ) . getSelectedItem ( ) . getId ( ) . equals ( cluster.getId ( ) ) ) ) { return ; } if ( returnValue ) { getAddBricksCommand ( ) . setIsExecutionAllowed ( true ) ; setMessage ( null ) ; } else { getAddBricksCommand ( ) . setIsExecutionAllowed ( false ) ; setMessage ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . volumeEmptyClusterValidationMsg ( ) ) ; } }
Source:
public org.ovirt.engine.core.bll.ValidationResult vmDuringInitialization ( org.ovirt.engine.core.common.businessentities.VM vm ) { boolean isVmDuringInit = isVmDuringInitiating ( vm ) ; if ( ( ( vm.isRunning ( ) ) || ( ( vm.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.NotResponding ) ) ) || isVmDuringInit ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_VM_IS_RUNNING ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult vmDuringInitialization ( org.ovirt.engine.core.common.businessentities.VM vm ) { if ( ( ( vm.isRunning ( ) ) || ( ( vm.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.NotResponding ) ) ) || ( isVmDuringInitiating ( vm ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_VM_IS_RUNNING ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
public void replaceBrick ( org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity oldBrick , org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity newBrick ) { getCallsHandler ( ) . executeModification ( "UpdateGlusterVolumeBrick" , getCustomMapSqlParameterSource ( ) . addValue ( "id" , oldBrick.getId ( ) ) . addValue ( "new_id" , newBrick.getId ( ) ) . addValue ( "new_server_id" , newBrick.getServerId ( ) ) . addValue ( "new_brick_dir" , newBrick.getBrickDirectory ( ) ) . addValue ( "new_status" , org.ovirt.engine.core.common.utils.EnumUtils.nameOrNull ( newBrick.getStatus ( ) ) ) ) ; }

Target:
public void replaceBrick ( org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity oldBrick , org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity newBrick ) { getCallsHandler ( ) . executeModification ( "UpdateGlusterVolumeBrick" , getCustomMapSqlParameterSource ( ) . addValue ( "id" , oldBrick.getId ( ) ) . addValue ( "new_id" , newBrick.getId ( ) ) . addValue ( "new_server_id" , newBrick.getServerId ( ) ) . addValue ( "new_status" , org.ovirt.engine.core.common.utils.EnumUtils.nameOrNull ( newBrick.getStatus ( ) ) ) ) ; }
Source:
private void runNextActionFlowWithFirstActionFailureTestCommon ( boolean waitFoResult ) { org.ovirt.engine.ui.uicommonweb.action.UiAction action1 = createAction ( waitFoResult , true ) ; org.ovirt.engine.ui.uicommonweb.action.UiAction action2 = createAction ( waitFoResult , true ) ; action1.then ( action2 ) ; action1.runAction ( ) ; verifyRunActionAndExecuteCallbacksRandomly ( false , action1.getActionFlowState ( ) , 1 , waitFoResult ) ; verifyRunActionAndExecuteCallbacksRandomly ( true , action1.getActionFlowState ( ) , 2 , 1 , waitFoResult ) ; assertFinishedWithErrors ( new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.action.UiAction > ( java.util.Arrays.asList ( action1 , action2 ) ) , 1 ) ; }

Target:
private void runNextActionFlowWithFirstActionFailureTestCommon ( boolean waitFoResult ) { org.ovirt.engine.ui.uicommonweb.action.UiAction action1 = createAction ( waitFoResult , true ) ; org.ovirt.engine.ui.uicommonweb.action.UiAction action2 = createAction ( waitFoResult , true ) ; action1.then ( action2 ) ; action1.runAction ( ) ; verifyRunActionAndExecuteCallbacksRandomly ( false , action1.getActionFlowState ( ) , 1 , waitFoResult ) ; verifyRunActionAndExecuteCallbacksRandomly ( true , action1.getActionFlowState ( ) , 2 , 1 , waitFoResult ) ; assertFinishedWithErrors ( java.util.Arrays.asList ( action1 , action2 ) , 1 ) ; }
Source:
public void testExecuteQueryCommnadFails ( ) { org.mockito.Mockito.when ( getQueryParameters ( ) . getServer ( ) ) . thenReturn ( null ) ; getQuery ( ) . executeQueryCommand ( ) ; java.lang.String serverFingerprint = getQuery ( ) . getQueryReturnValue ( ) . getReturnValue ( ) ; org.junit.Assert.assertNull ( serverFingerprint ) ; }

Target:
public void testExecuteQueryCommnadFails ( ) { getQuery ( ) . executeQueryCommand ( ) ; java.lang.String serverFingerprint = getQuery ( ) . getQueryReturnValue ( ) . getReturnValue ( ) ; org.junit.Assert.assertNull ( serverFingerprint ) ; }
Source:
public void canDoActionPreallocatedSpaceCheckSucceeds ( ) { final int availableSize = 12 ; final int usedSize = 8 ; org.ovirt.engine.core.compat.Guid sdid = org.ovirt.engine.core.compat.Guid.NewGuid ( ) ; initializeCommand ( sdid , VolumeType.Preallocated ) ; mockVm ( ) ; org.ovirt.engine.core.common.businessentities.StorageDomain domains = mockStorageDomain ( sdid , availableSize , usedSize ) ; mockStoragePoolIsoMap ( ) ; org.junit.Assert.assertTrue ( command.canDoAction ( ) ) ; }

Target:
public void canDoActionPreallocatedSpaceCheckSucceeds ( ) { final int availableSize = 12 ; final int usedSize = 8 ; org.ovirt.engine.core.compat.Guid sdid = org.ovirt.engine.core.compat.Guid.NewGuid ( ) ; initializeCommand ( sdid , VolumeType.Preallocated ) ; mockVm ( ) ; mockStorageDomain ( sdid , availableSize , usedSize ) ; mockStoragePoolIsoMap ( ) ; org.junit.Assert.assertTrue ( command.canDoAction ( ) ) ; }
Source:
public < T extends java.lang.Object > T instanceOf ( java.lang.Class < T > clazz ) { javax.enterprise.inject.spi.Bean bean = org.ovirt.engine.core.di.Injector.injector.manager.getBeans ( clazz ) . iterator ( ) . next ( ) ; return ( ( T ) ( org.ovirt.engine.core.di.Injector.injector.manager.getReference ( bean , clazz , org.ovirt.engine.core.di.Injector.injector.manager.createCreationalContext ( bean ) ) ) ) ; }

Target:
public < T extends java.lang.Object > T instanceOf ( java.lang.Class < T > clazz ) { javax.enterprise.inject.spi.Bean < ? > bean = org.ovirt.engine.core.di.Injector.injector.manager.getBeans ( clazz ) . iterator ( ) . next ( ) ; return ( ( T ) ( org.ovirt.engine.core.di.Injector.injector.manager.getReference ( bean , clazz , org.ovirt.engine.core.di.Injector.injector.manager.createCreationalContext ( bean ) ) ) ) ; }
Source:
private void refreshServerData ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster , org.ovirt.engine.core.common.businessentities.VDS upServer , java.util.List < org.ovirt.engine.core.common.businessentities.VDS > existingServers ) { if ( cluster.supportsVirtService ( ) ) { log.debugFormat ( "As cluster {0} supports virt service as well, it's servers will not be synced with glusterfs" , cluster.getname ( ) ) ; return ; } acquireLock ( cluster.getId ( ) ) ; try { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerInfo > fetchedServers = fetchServers ( cluster , upServer , existingServers ) ; if ( fetchedServers != null ) { removeDetachedServers ( existingServers , fetchedServers ) ; } } finally { releaseLock ( cluster.getId ( ) ) ; } }

Target:
private void refreshServerData ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster , org.ovirt.engine.core.common.businessentities.VDS upServer , java.util.List < org.ovirt.engine.core.common.businessentities.VDS > existingServers ) { if ( cluster.supportsVirtService ( ) ) { log.debugFormat ( "As cluster {0} supports virt service as well, it's servers will not be synced with glusterfs" , cluster.getName ( ) ) ; return ; } acquireLock ( cluster.getId ( ) ) ; try { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerInfo > fetchedServers = fetchServers ( cluster , upServer , existingServers ) ; if ( fetchedServers != null ) { removeDetachedServers ( existingServers , fetchedServers ) ; } } finally { releaseLock ( cluster.getId ( ) ) ; } }