use of org.ovirt.engine.core.searchbackend.SearchObjectAutoCompleter in project ovirt-engine by oVirt.
the class SearchQueryTest method mockVMDao.
/**
* Mock VM Dao so that when getAllWithQuery will be called with the appropriate query string, a unique list will be
* returned. <BR/>
* This returned list will indicate, if the correct string has been passed as an argument to the getAllWithQuery
* API.
* @param vmDao
* - The dao to be used
*/
public void mockVMDao() {
SearchObjectAutoCompleter search = new SearchObjectAutoCompleter();
when(vmDao.getAllUsingQuery(matches(getVMRegexString(search)))).thenReturn(vmResultList);
}
use of org.ovirt.engine.core.searchbackend.SearchObjectAutoCompleter in project ovirt-engine by oVirt.
the class SearchQueryTest method mockStoragePoolDao.
/**
* Mock storage pool Dao so that when getAllWithQuery will be called with the appropriate query string, a unique
* list will be returned. <BR/>
* This returned list will indicate, if the correct string has been passed as an argument to the getAllWithQuery
* API.
* @param storagePoolDao
* - The dao to be used
*/
@Before
public void mockStoragePoolDao() {
SearchObjectAutoCompleter search = new SearchObjectAutoCompleter();
when(storagePoolDao.getAllWithQuery(matches(getStoragePoolRegexString(search)))).thenReturn(storagePoolResultList);
}
use of org.ovirt.engine.core.searchbackend.SearchObjectAutoCompleter in project ovirt-engine by oVirt.
the class SearchQueryTest method mockVdsDao.
/**
* Mock Vds Dao so that when getAllWithQuery will be called with the appropriate query string, a unique list will be
* returned. <BR/>
* This returned list will indicate, if the correct string has been passed as an argument to the getAllWithQuery
* API.
* @param diskImageDao
* - The dao to be used
*/
@Before
public void mockVdsDao() {
SearchObjectAutoCompleter search = new SearchObjectAutoCompleter();
when(vdsDao.getAllWithQuery(matches(getVdsRegexString(search)))).thenReturn(vdsResultList);
VDS vds = new VDS();
vds.setCpuFlags("flag");
vds.setClusterCompatibilityVersion(Version.getLast());
vdsResultList.add(vds);
}
use of org.ovirt.engine.core.searchbackend.SearchObjectAutoCompleter in project ovirt-engine by oVirt.
the class SearchQueryTest method mockDiskDao.
/**
* Mock disk Dao so that when getAllWithQuery will be called with the appropriate query string, a unique list will
* be returned. <BR/>
* This returned list will indicate, if the correct string has been passed as an argument to the getAllWithQuery
* API.
* @param diskDao
* - The dao to be used
*/
@Before
public void mockDiskDao() {
SearchObjectAutoCompleter search = new SearchObjectAutoCompleter();
when(diskDao.getAllWithQuery(matches(getDiskImageRegexString(search)))).thenReturn(diskImageResultList);
}
use of org.ovirt.engine.core.searchbackend.SearchObjectAutoCompleter in project ovirt-engine by oVirt.
the class SearchQueryTest method mockClusterDao.
/**
* Mock vds group Dao so that when getAllWithQuery will be called with the appropriate query string, a unique list
* will be returned. <BR/>
* This returned list will indicate, if the correct string has been passed as an argument to the getAllWithQuery
* API.
* @param clusterDao
* - The dao to be used
*/
@Before
public void mockClusterDao() {
SearchObjectAutoCompleter search = new SearchObjectAutoCompleter();
when(clusterDao.getAllWithQuery(matches(getClusterRegexString(search)))).thenReturn(clusterResultList);
}
Aggregations