Example usage for org.springframework.data.gemfire IndexFactoryBean doLookupQueryService

List of usage examples for org.springframework.data.gemfire IndexFactoryBean doLookupQueryService

Introduction

In this page you can find the example usage for org.springframework.data.gemfire IndexFactoryBean doLookupQueryService.

Prototype

QueryService doLookupQueryService() 

Source Link

Usage

From source file:org.springframework.data.gemfire.IndexFactoryBeanTest.java

@Test
public void doLookupQueryService() {

    QueryService mockQueryServiceOne = mockQueryService("testDoLookupQueryService.MockQueryService.One");

    IndexFactoryBean indexFactoryBean = newIndexFactoryBean();

    indexFactoryBean.setQueryService(mockQueryServiceOne);

    assertThat(indexFactoryBean.doLookupQueryService()).isSameAs(mockQueryServiceOne);

    verify(mockCache, never()).getQueryService();
}

From source file:org.springframework.data.gemfire.IndexFactoryBeanTest.java

@Test
public void doLookupQueryServiceOnClientCache() {

    ClientCache mockClientCache = mock(ClientCache.class);
    QueryService mockQueryService = mockQueryService("testDoLookupQueryServiceOnClientCache.MockQueryService");

    when(mockClientCache.getLocalQueryService()).thenReturn(mockQueryService);

    IndexFactoryBean indexFactoryBean = newIndexFactoryBean();

    indexFactoryBean.setCache(mockClientCache);
    indexFactoryBean.setQueryService(null);

    assertThat(indexFactoryBean.doLookupQueryService()).isSameAs(mockQueryService);

    verify(mockClientCache, times(1)).getLocalQueryService();
    verify(mockClientCache, never()).getQueryService();
}

From source file:org.springframework.data.gemfire.IndexFactoryBeanTest.java

@Test
public void doLookupQueryServiceOnPeerCache() {

    IndexFactoryBean indexFactoryBean = newIndexFactoryBean();

    indexFactoryBean.setCache(mockCache);
    indexFactoryBean.setQueryService(null);

    assertThat(indexFactoryBean.doLookupQueryService()).isSameAs(mockQueryService);

    verify(mockCache, times(1)).getQueryService();
}