Search in sources :

Example 1 with SearchObjectAutoCompleter

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);
}
Also used : SearchObjectAutoCompleter(org.ovirt.engine.core.searchbackend.SearchObjectAutoCompleter)

Example 2 with SearchObjectAutoCompleter

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);
}
Also used : SearchObjectAutoCompleter(org.ovirt.engine.core.searchbackend.SearchObjectAutoCompleter) Before(org.junit.Before)

Example 3 with SearchObjectAutoCompleter

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);
}
Also used : VDS(org.ovirt.engine.core.common.businessentities.VDS) SearchObjectAutoCompleter(org.ovirt.engine.core.searchbackend.SearchObjectAutoCompleter) Before(org.junit.Before)

Example 4 with SearchObjectAutoCompleter

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);
}
Also used : SearchObjectAutoCompleter(org.ovirt.engine.core.searchbackend.SearchObjectAutoCompleter) Before(org.junit.Before)

Example 5 with SearchObjectAutoCompleter

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);
}
Also used : SearchObjectAutoCompleter(org.ovirt.engine.core.searchbackend.SearchObjectAutoCompleter) Before(org.junit.Before)

Aggregations

SearchObjectAutoCompleter (org.ovirt.engine.core.searchbackend.SearchObjectAutoCompleter)9 Before (org.junit.Before)8 VDS (org.ovirt.engine.core.common.businessentities.VDS)1 VmTemplate (org.ovirt.engine.core.common.businessentities.VmTemplate)1