Merge pull request #7 from dturanski/continuous
renamed Continous* to Continuous*
This commit is contained in:
@@ -23,9 +23,9 @@ import org.springframework.beans.factory.support.BeanDefinitionBuilder;
|
|||||||
import org.springframework.beans.factory.support.ManagedSet;
|
import org.springframework.beans.factory.support.ManagedSet;
|
||||||
import org.springframework.beans.factory.xml.AbstractSimpleBeanDefinitionParser;
|
import org.springframework.beans.factory.xml.AbstractSimpleBeanDefinitionParser;
|
||||||
import org.springframework.beans.factory.xml.ParserContext;
|
import org.springframework.beans.factory.xml.ParserContext;
|
||||||
import org.springframework.data.gemfire.listener.ContinousQueryDefinition;
|
import org.springframework.data.gemfire.listener.ContinuousQueryDefinition;
|
||||||
import org.springframework.data.gemfire.listener.ContinousQueryListenerContainer;
|
import org.springframework.data.gemfire.listener.ContinuousQueryListenerContainer;
|
||||||
import org.springframework.data.gemfire.listener.adapter.ContinousQueryListenerAdapter;
|
import org.springframework.data.gemfire.listener.adapter.ContinuousQueryListenerAdapter;
|
||||||
import org.springframework.util.Assert;
|
import org.springframework.util.Assert;
|
||||||
import org.springframework.util.StringUtils;
|
import org.springframework.util.StringUtils;
|
||||||
import org.springframework.util.xml.DomUtils;
|
import org.springframework.util.xml.DomUtils;
|
||||||
@@ -41,8 +41,8 @@ import org.w3c.dom.NamedNodeMap;
|
|||||||
class GemfireListenerContainerParser extends AbstractSimpleBeanDefinitionParser {
|
class GemfireListenerContainerParser extends AbstractSimpleBeanDefinitionParser {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Class<ContinousQueryListenerContainer> getBeanClass(Element element) {
|
protected Class<ContinuousQueryListenerContainer> getBeanClass(Element element) {
|
||||||
return ContinousQueryListenerContainer.class;
|
return ContinuousQueryListenerContainer.class;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -85,14 +85,14 @@ class GemfireListenerContainerParser extends AbstractSimpleBeanDefinitionParser
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Parses a listener definition. Returns the listener bean reference definition (of a {@link ContinousQueryDefinition}).
|
* Parses a listener definition. Returns the listener bean reference definition (of a {@link ContinuousQueryDefinition}).
|
||||||
*
|
*
|
||||||
* @param element
|
* @param element
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private BeanDefinition parseListener(Element element) {
|
private BeanDefinition parseListener(Element element) {
|
||||||
|
|
||||||
BeanDefinitionBuilder builder = BeanDefinitionBuilder.genericBeanDefinition(ContinousQueryListenerAdapter.class);
|
BeanDefinitionBuilder builder = BeanDefinitionBuilder.genericBeanDefinition(ContinuousQueryListenerAdapter.class);
|
||||||
builder.addConstructorArgReference(element.getAttribute("ref"));
|
builder.addConstructorArgReference(element.getAttribute("ref"));
|
||||||
|
|
||||||
String attr = element.getAttribute("method");
|
String attr = element.getAttribute("method");
|
||||||
@@ -100,7 +100,7 @@ class GemfireListenerContainerParser extends AbstractSimpleBeanDefinitionParser
|
|||||||
builder.addPropertyValue("defaultListenerMethod", attr);
|
builder.addPropertyValue("defaultListenerMethod", attr);
|
||||||
}
|
}
|
||||||
|
|
||||||
BeanDefinitionBuilder defBuilder = BeanDefinitionBuilder.genericBeanDefinition(ContinousQueryDefinition.class);
|
BeanDefinitionBuilder defBuilder = BeanDefinitionBuilder.genericBeanDefinition(ContinuousQueryDefinition.class);
|
||||||
|
|
||||||
attr = element.getAttribute("name");
|
attr = element.getAttribute("name");
|
||||||
if (StringUtils.hasText(attr)) {
|
if (StringUtils.hasText(attr)) {
|
||||||
|
|||||||
@@ -27,31 +27,31 @@ import com.gemstone.gemfire.cache.query.CqQuery;
|
|||||||
*
|
*
|
||||||
* @author Costin Leau
|
* @author Costin Leau
|
||||||
*/
|
*/
|
||||||
public class ContinousQueryDefinition implements InitializingBean {
|
public class ContinuousQueryDefinition implements InitializingBean {
|
||||||
|
|
||||||
private String name = null, query = null;
|
private String name = null, query = null;
|
||||||
private ContinuousQueryListener listener = null;
|
private ContinuousQueryListener listener = null;
|
||||||
private boolean durable = false;
|
private boolean durable = false;
|
||||||
|
|
||||||
public ContinousQueryDefinition() {
|
public ContinuousQueryDefinition() {
|
||||||
}
|
}
|
||||||
|
|
||||||
public ContinousQueryDefinition(String query, ContinuousQueryListener listener) {
|
public ContinuousQueryDefinition(String query, ContinuousQueryListener listener) {
|
||||||
this(query, listener, false);
|
this(query, listener, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ContinousQueryDefinition(String query, ContinuousQueryListener listener, boolean durable) {
|
public ContinuousQueryDefinition(String query, ContinuousQueryListener listener, boolean durable) {
|
||||||
this.query = query;
|
this.query = query;
|
||||||
this.listener = listener;
|
this.listener = listener;
|
||||||
this.durable = durable;
|
this.durable = durable;
|
||||||
afterPropertiesSet();
|
afterPropertiesSet();
|
||||||
}
|
}
|
||||||
|
|
||||||
public ContinousQueryDefinition(String name, String query, ContinuousQueryListener listener) {
|
public ContinuousQueryDefinition(String name, String query, ContinuousQueryListener listener) {
|
||||||
this(name, query, listener, false);
|
this(name, query, listener, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ContinousQueryDefinition(String name, String query, ContinuousQueryListener listener, boolean durable) {
|
public ContinuousQueryDefinition(String name, String query, ContinuousQueryListener listener, boolean durable) {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.query = query;
|
this.query = query;
|
||||||
this.listener = listener;
|
this.listener = listener;
|
||||||
@@ -51,7 +51,7 @@ import com.gemstone.gemfire.internal.concurrent.ConcurrentHashSet;
|
|||||||
*
|
*
|
||||||
* @author Costin Leau
|
* @author Costin Leau
|
||||||
*/
|
*/
|
||||||
public class ContinousQueryListenerContainer implements InitializingBean, DisposableBean, BeanNameAware, SmartLifecycle {
|
public class ContinuousQueryListenerContainer implements InitializingBean, DisposableBean, BeanNameAware, SmartLifecycle {
|
||||||
|
|
||||||
private class EventDispatcherAdapter implements CqListener {
|
private class EventDispatcherAdapter implements CqListener {
|
||||||
private final ContinuousQueryListener delegate;
|
private final ContinuousQueryListener delegate;
|
||||||
@@ -78,7 +78,7 @@ public class ContinousQueryListenerContainer implements InitializingBean, Dispos
|
|||||||
/**
|
/**
|
||||||
* Default thread name prefix: "ContinousQueryListenerContainer-".
|
* Default thread name prefix: "ContinousQueryListenerContainer-".
|
||||||
*/
|
*/
|
||||||
public static final String DEFAULT_THREAD_NAME_PREFIX = ClassUtils.getShortName(ContinousQueryListenerContainer.class)
|
public static final String DEFAULT_THREAD_NAME_PREFIX = ClassUtils.getShortName(ContinuousQueryListenerContainer.class)
|
||||||
+ "-";
|
+ "-";
|
||||||
|
|
||||||
private Executor subscriptionExecutor;
|
private Executor subscriptionExecutor;
|
||||||
@@ -92,7 +92,7 @@ public class ContinousQueryListenerContainer implements InitializingBean, Dispos
|
|||||||
private volatile boolean initialized = false;
|
private volatile boolean initialized = false;
|
||||||
private volatile boolean manageExecutor = false;
|
private volatile boolean manageExecutor = false;
|
||||||
|
|
||||||
private Set<ContinousQueryDefinition> defs = new LinkedHashSet<ContinousQueryDefinition>();
|
private Set<ContinuousQueryDefinition> defs = new LinkedHashSet<ContinuousQueryDefinition>();
|
||||||
private Set<CqQuery> queries = new ConcurrentHashSet<CqQuery>();
|
private Set<CqQuery> queries = new ConcurrentHashSet<CqQuery>();
|
||||||
|
|
||||||
private QueryService queryService;
|
private QueryService queryService;
|
||||||
@@ -335,7 +335,7 @@ public class ContinousQueryListenerContainer implements InitializingBean, Dispos
|
|||||||
*
|
*
|
||||||
* @param queries set of queries
|
* @param queries set of queries
|
||||||
*/
|
*/
|
||||||
public void setQueryListeners(Set<ContinousQueryDefinition> queries) {
|
public void setQueryListeners(Set<ContinuousQueryDefinition> queries) {
|
||||||
defs.clear();
|
defs.clear();
|
||||||
defs.addAll(queries);
|
defs.addAll(queries);
|
||||||
}
|
}
|
||||||
@@ -346,11 +346,11 @@ public class ContinousQueryListenerContainer implements InitializingBean, Dispos
|
|||||||
*
|
*
|
||||||
* @param listener event cqQuery
|
* @param listener event cqQuery
|
||||||
*/
|
*/
|
||||||
public void addListener(ContinousQueryDefinition cqQuery) {
|
public void addListener(ContinuousQueryDefinition cqQuery) {
|
||||||
doAddListener(cqQuery);
|
doAddListener(cqQuery);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initMapping(Set<ContinousQueryDefinition> queryDefinitions) {
|
private void initMapping(Set<ContinuousQueryDefinition> queryDefinitions) {
|
||||||
// stop the listener if currently running
|
// stop the listener if currently running
|
||||||
if (isRunning()) {
|
if (isRunning()) {
|
||||||
stop();
|
stop();
|
||||||
@@ -358,7 +358,7 @@ public class ContinousQueryListenerContainer implements InitializingBean, Dispos
|
|||||||
|
|
||||||
closeQueries();
|
closeQueries();
|
||||||
|
|
||||||
for (ContinousQueryDefinition def : queryDefinitions) {
|
for (ContinuousQueryDefinition def : queryDefinitions) {
|
||||||
addCQuery(def);
|
addCQuery(def);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -368,7 +368,7 @@ public class ContinousQueryListenerContainer implements InitializingBean, Dispos
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void doAddListener(ContinousQueryDefinition def) {
|
private void doAddListener(ContinuousQueryDefinition def) {
|
||||||
CqQuery cq = addCQuery(def);
|
CqQuery cq = addCQuery(def);
|
||||||
|
|
||||||
if (isRunning()) {
|
if (isRunning()) {
|
||||||
@@ -376,7 +376,7 @@ public class ContinousQueryListenerContainer implements InitializingBean, Dispos
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private CqQuery addCQuery(ContinousQueryDefinition def) {
|
private CqQuery addCQuery(ContinuousQueryDefinition def) {
|
||||||
try {
|
try {
|
||||||
CqAttributesFactory caf = new CqAttributesFactory();
|
CqAttributesFactory caf = new CqAttributesFactory();
|
||||||
caf.addCqListener(new EventDispatcherAdapter(def.getListener()));
|
caf.addCqListener(new EventDispatcherAdapter(def.getListener()));
|
||||||
@@ -17,13 +17,13 @@
|
|||||||
package org.springframework.data.gemfire.listener;
|
package org.springframework.data.gemfire.listener;
|
||||||
|
|
||||||
import org.springframework.dao.InvalidDataAccessApiUsageException;
|
import org.springframework.dao.InvalidDataAccessApiUsageException;
|
||||||
import org.springframework.data.gemfire.listener.adapter.ContinousQueryListenerAdapter;
|
import org.springframework.data.gemfire.listener.adapter.ContinuousQueryListenerAdapter;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Exception thrown when the execution of a listener method failed.
|
* Exception thrown when the execution of a listener method failed.
|
||||||
*
|
*
|
||||||
* @author Costin Leau
|
* @author Costin Leau
|
||||||
* @see ContinousQueryListenerAdapter
|
* @see ContinuousQueryListenerAdapter
|
||||||
*/
|
*/
|
||||||
public class GemfireListenerExecutionFailedException extends InvalidDataAccessApiUsageException {
|
public class GemfireListenerExecutionFailedException extends InvalidDataAccessApiUsageException {
|
||||||
|
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ import com.gemstone.gemfire.cache.query.CqQuery;
|
|||||||
* @author Costin Leau
|
* @author Costin Leau
|
||||||
* @see org.springframework.jms.listener.adapter.MessageListenerAdapter
|
* @see org.springframework.jms.listener.adapter.MessageListenerAdapter
|
||||||
*/
|
*/
|
||||||
public class ContinousQueryListenerAdapter implements ContinuousQueryListener {
|
public class ContinuousQueryListenerAdapter implements ContinuousQueryListener {
|
||||||
|
|
||||||
private class MethodInvoker {
|
private class MethodInvoker {
|
||||||
private final Object delegate;
|
private final Object delegate;
|
||||||
@@ -192,18 +192,18 @@ public class ContinousQueryListenerAdapter implements ContinuousQueryListener {
|
|||||||
private MethodInvoker invoker;
|
private MethodInvoker invoker;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new {@link ContinousQueryListenerAdapter} with default settings.
|
* Create a new {@link ContinuousQueryListenerAdapter} with default settings.
|
||||||
*/
|
*/
|
||||||
public ContinousQueryListenerAdapter() {
|
public ContinuousQueryListenerAdapter() {
|
||||||
setDelegate(this);
|
setDelegate(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new {@link ContinousQueryListenerAdapter} for the given delegate.
|
* Create a new {@link ContinuousQueryListenerAdapter} for the given delegate.
|
||||||
*
|
*
|
||||||
* @param delegate the delegate object
|
* @param delegate the delegate object
|
||||||
*/
|
*/
|
||||||
public ContinousQueryListenerAdapter(Object delegate) {
|
public ContinuousQueryListenerAdapter(Object delegate) {
|
||||||
setDelegate(delegate);
|
setDelegate(delegate);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1108,7 +1108,7 @@ Required.
|
|||||||
<xsd:attribute name="query" type="xsd:string" use="required">
|
<xsd:attribute name="query" type="xsd:string" use="required">
|
||||||
<xsd:annotation>
|
<xsd:annotation>
|
||||||
<xsd:documentation><![CDATA[
|
<xsd:documentation><![CDATA[
|
||||||
The query for the GemFire continous query.
|
The query for the GemFire continuous query.
|
||||||
]]></xsd:documentation>
|
]]></xsd:documentation>
|
||||||
</xsd:annotation>
|
</xsd:annotation>
|
||||||
</xsd:attribute>
|
</xsd:attribute>
|
||||||
@@ -1123,14 +1123,14 @@ interface or provide a method named 'handleEvent'.
|
|||||||
<xsd:attribute name="name" type="xsd:string" use="optional">
|
<xsd:attribute name="name" type="xsd:string" use="optional">
|
||||||
<xsd:annotation>
|
<xsd:annotation>
|
||||||
<xsd:documentation><![CDATA[
|
<xsd:documentation><![CDATA[
|
||||||
The name of the resulting GemFire continous query. Useful for monitoring and statistics querying.
|
The name of the resulting GemFire continuous query. Useful for monitoring and statistics querying.
|
||||||
]]></xsd:documentation>
|
]]></xsd:documentation>
|
||||||
</xsd:annotation>
|
</xsd:annotation>
|
||||||
</xsd:attribute>
|
</xsd:attribute>
|
||||||
<xsd:attribute name="durable" type="xsd:string" use="optional">
|
<xsd:attribute name="durable" type="xsd:string" use="optional">
|
||||||
<xsd:annotation>
|
<xsd:annotation>
|
||||||
<xsd:documentation><![CDATA[
|
<xsd:documentation><![CDATA[
|
||||||
Whether the resulting GemFire continous query is durable or not.
|
Whether the resulting GemFire continuous query is durable or not.
|
||||||
]]></xsd:documentation>
|
]]></xsd:documentation>
|
||||||
</xsd:annotation>
|
</xsd:annotation>
|
||||||
</xsd:attribute>
|
</xsd:attribute>
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ import org.junit.Before;
|
|||||||
import org.junit.BeforeClass;
|
import org.junit.BeforeClass;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.springframework.data.gemfire.ForkUtil;
|
import org.springframework.data.gemfire.ForkUtil;
|
||||||
import org.springframework.data.gemfire.listener.adapter.ContinousQueryListenerAdapter;
|
import org.springframework.data.gemfire.listener.adapter.ContinuousQueryListenerAdapter;
|
||||||
|
|
||||||
import com.gemstone.gemfire.cache.RegionService;
|
import com.gemstone.gemfire.cache.RegionService;
|
||||||
import com.gemstone.gemfire.cache.client.ClientCacheFactory;
|
import com.gemstone.gemfire.cache.client.ClientCacheFactory;
|
||||||
@@ -38,7 +38,7 @@ import com.gemstone.gemfire.cache.query.CqEvent;
|
|||||||
public class ListenerContainerTests {
|
public class ListenerContainerTests {
|
||||||
|
|
||||||
private final BlockingDeque<CqEvent> bag = new LinkedBlockingDeque<CqEvent>();
|
private final BlockingDeque<CqEvent> bag = new LinkedBlockingDeque<CqEvent>();
|
||||||
protected ContinousQueryListenerContainer container;
|
protected ContinuousQueryListenerContainer container;
|
||||||
|
|
||||||
private static RegionService cache = null;
|
private static RegionService cache = null;
|
||||||
private static Pool pool = null;
|
private static Pool pool = null;
|
||||||
@@ -49,7 +49,7 @@ public class ListenerContainerTests {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
private final ContinousQueryListenerAdapter adapter = new ContinousQueryListenerAdapter(handler);
|
private final ContinuousQueryListenerAdapter adapter = new ContinuousQueryListenerAdapter(handler);
|
||||||
|
|
||||||
@BeforeClass
|
@BeforeClass
|
||||||
public static void startUp() throws Exception {
|
public static void startUp() throws Exception {
|
||||||
@@ -92,12 +92,12 @@ public class ListenerContainerTests {
|
|||||||
public void setUp() throws Exception {
|
public void setUp() throws Exception {
|
||||||
String query = "SELECT * from /test-cq";
|
String query = "SELECT * from /test-cq";
|
||||||
|
|
||||||
container = new ContinousQueryListenerContainer();
|
container = new ContinuousQueryListenerContainer();
|
||||||
container.setCache(cache);
|
container.setCache(cache);
|
||||||
//container.setPoolName("client");
|
//container.setPoolName("client");
|
||||||
container.setBeanName("container");
|
container.setBeanName("container");
|
||||||
container.afterPropertiesSet();
|
container.afterPropertiesSet();
|
||||||
container.addListener(new ContinousQueryDefinition("test", query, adapter));
|
container.addListener(new ContinuousQueryDefinition("test", query, adapter));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ import org.junit.BeforeClass;
|
|||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.springframework.context.support.GenericXmlApplicationContext;
|
import org.springframework.context.support.GenericXmlApplicationContext;
|
||||||
import org.springframework.data.gemfire.ForkUtil;
|
import org.springframework.data.gemfire.ForkUtil;
|
||||||
import org.springframework.data.gemfire.listener.ContinousQueryListenerContainer;
|
import org.springframework.data.gemfire.listener.ContinuousQueryListenerContainer;
|
||||||
|
|
||||||
import com.gemstone.gemfire.cache.Cache;
|
import com.gemstone.gemfire.cache.Cache;
|
||||||
import com.gemstone.gemfire.cache.client.Pool;
|
import com.gemstone.gemfire.cache.client.Pool;
|
||||||
@@ -51,7 +51,7 @@ public class ContainerXmlSetupTest {
|
|||||||
GenericXmlApplicationContext ctx = new GenericXmlApplicationContext(
|
GenericXmlApplicationContext ctx = new GenericXmlApplicationContext(
|
||||||
"/org/springframework/data/gemfire/listener/container.xml");
|
"/org/springframework/data/gemfire/listener/container.xml");
|
||||||
|
|
||||||
ContinousQueryListenerContainer container = ctx.getBean(ContinousQueryListenerContainer.class);
|
ContinuousQueryListenerContainer container = ctx.getBean(ContinuousQueryListenerContainer.class);
|
||||||
assertTrue(container.isRunning());
|
assertTrue(container.isRunning());
|
||||||
|
|
||||||
Cache cache = ctx.getBean("gemfire-cache", Cache.class);
|
Cache cache = ctx.getBean("gemfire-cache", Cache.class);
|
||||||
|
|||||||
@@ -37,11 +37,11 @@ import com.gemstone.gemfire.cache.query.internal.CqQueryImpl;
|
|||||||
*/
|
*/
|
||||||
public class QueryListenerAdapterTest {
|
public class QueryListenerAdapterTest {
|
||||||
|
|
||||||
private ContinousQueryListenerAdapter adapter;
|
private ContinuousQueryListenerAdapter adapter;
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
public void setUp() {
|
public void setUp() {
|
||||||
adapter = new ContinousQueryListenerAdapter();
|
adapter = new ContinuousQueryListenerAdapter();
|
||||||
}
|
}
|
||||||
|
|
||||||
CqEvent event() {
|
CqEvent event() {
|
||||||
@@ -113,14 +113,14 @@ public class QueryListenerAdapterTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testThatTheDefaultHandlingMethodNameIsTheConstantDefault() throws Exception {
|
public void testThatTheDefaultHandlingMethodNameIsTheConstantDefault() throws Exception {
|
||||||
assertEquals(ContinousQueryListenerAdapter.ORIGINAL_DEFAULT_LISTENER_METHOD, adapter.getDefaultListenerMethod());
|
assertEquals(ContinuousQueryListenerAdapter.ORIGINAL_DEFAULT_LISTENER_METHOD, adapter.getDefaultListenerMethod());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testAdapterWithListenerAndDefaultMessage() throws Exception {
|
public void testAdapterWithListenerAndDefaultMessage() throws Exception {
|
||||||
ContinuousQueryListener mock = mock(ContinuousQueryListener.class);
|
ContinuousQueryListener mock = mock(ContinuousQueryListener.class);
|
||||||
|
|
||||||
ContinousQueryListenerAdapter adapter = new ContinousQueryListenerAdapter(mock);
|
ContinuousQueryListenerAdapter adapter = new ContinuousQueryListenerAdapter(mock);
|
||||||
CqEvent event = event();
|
CqEvent event = event();
|
||||||
adapter.onEvent(event);
|
adapter.onEvent(event);
|
||||||
verify(mock).onEvent(event);
|
verify(mock).onEvent(event);
|
||||||
@@ -129,7 +129,7 @@ public class QueryListenerAdapterTest {
|
|||||||
@Test
|
@Test
|
||||||
public void testHandleEvent() throws Exception {
|
public void testHandleEvent() throws Exception {
|
||||||
Delegate mock = mock(Delegate.class);
|
Delegate mock = mock(Delegate.class);
|
||||||
ContinousQueryListenerAdapter adapter = new ContinousQueryListenerAdapter(mock);
|
ContinuousQueryListenerAdapter adapter = new ContinuousQueryListenerAdapter(mock);
|
||||||
CqEvent event = event();
|
CqEvent event = event();
|
||||||
|
|
||||||
adapter.onEvent(event);
|
adapter.onEvent(event);
|
||||||
@@ -139,7 +139,7 @@ public class QueryListenerAdapterTest {
|
|||||||
@Test
|
@Test
|
||||||
public void testHandleArray() throws Exception {
|
public void testHandleArray() throws Exception {
|
||||||
Delegate mock = mock(Delegate.class);
|
Delegate mock = mock(Delegate.class);
|
||||||
ContinousQueryListenerAdapter adapter = new ContinousQueryListenerAdapter(mock);
|
ContinuousQueryListenerAdapter adapter = new ContinuousQueryListenerAdapter(mock);
|
||||||
adapter.setDefaultListenerMethod("handleArray");
|
adapter.setDefaultListenerMethod("handleArray");
|
||||||
CqEvent event = event();
|
CqEvent event = event();
|
||||||
adapter.onEvent(event);
|
adapter.onEvent(event);
|
||||||
@@ -149,7 +149,7 @@ public class QueryListenerAdapterTest {
|
|||||||
@Test
|
@Test
|
||||||
public void testHandleKey() throws Exception {
|
public void testHandleKey() throws Exception {
|
||||||
Delegate mock = mock(Delegate.class);
|
Delegate mock = mock(Delegate.class);
|
||||||
ContinousQueryListenerAdapter adapter = new ContinousQueryListenerAdapter(mock);
|
ContinuousQueryListenerAdapter adapter = new ContinuousQueryListenerAdapter(mock);
|
||||||
adapter.setDefaultListenerMethod("handleKey");
|
adapter.setDefaultListenerMethod("handleKey");
|
||||||
CqEvent event = event();
|
CqEvent event = event();
|
||||||
|
|
||||||
@@ -160,7 +160,7 @@ public class QueryListenerAdapterTest {
|
|||||||
@Test
|
@Test
|
||||||
public void testHandleKV() throws Exception {
|
public void testHandleKV() throws Exception {
|
||||||
Delegate mock = mock(Delegate.class);
|
Delegate mock = mock(Delegate.class);
|
||||||
ContinousQueryListenerAdapter adapter = new ContinousQueryListenerAdapter(mock);
|
ContinuousQueryListenerAdapter adapter = new ContinuousQueryListenerAdapter(mock);
|
||||||
adapter.setDefaultListenerMethod("handleKV");
|
adapter.setDefaultListenerMethod("handleKV");
|
||||||
CqEvent event = event();
|
CqEvent event = event();
|
||||||
|
|
||||||
@@ -171,7 +171,7 @@ public class QueryListenerAdapterTest {
|
|||||||
@Test
|
@Test
|
||||||
public void testHandleEx() throws Exception {
|
public void testHandleEx() throws Exception {
|
||||||
Delegate mock = mock(Delegate.class);
|
Delegate mock = mock(Delegate.class);
|
||||||
ContinousQueryListenerAdapter adapter = new ContinousQueryListenerAdapter(mock);
|
ContinuousQueryListenerAdapter adapter = new ContinuousQueryListenerAdapter(mock);
|
||||||
adapter.setDefaultListenerMethod("handleEx");
|
adapter.setDefaultListenerMethod("handleEx");
|
||||||
CqEvent event = event();
|
CqEvent event = event();
|
||||||
|
|
||||||
@@ -182,7 +182,7 @@ public class QueryListenerAdapterTest {
|
|||||||
@Test
|
@Test
|
||||||
public void testHandleOps() throws Exception {
|
public void testHandleOps() throws Exception {
|
||||||
Delegate mock = mock(Delegate.class);
|
Delegate mock = mock(Delegate.class);
|
||||||
ContinousQueryListenerAdapter adapter = new ContinousQueryListenerAdapter(mock);
|
ContinuousQueryListenerAdapter adapter = new ContinuousQueryListenerAdapter(mock);
|
||||||
adapter.setDefaultListenerMethod("handleOps");
|
adapter.setDefaultListenerMethod("handleOps");
|
||||||
CqEvent event = event();
|
CqEvent event = event();
|
||||||
|
|
||||||
@@ -193,7 +193,7 @@ public class QueryListenerAdapterTest {
|
|||||||
@Test
|
@Test
|
||||||
public void testHandleAll() throws Exception {
|
public void testHandleAll() throws Exception {
|
||||||
Delegate mock = mock(Delegate.class);
|
Delegate mock = mock(Delegate.class);
|
||||||
ContinousQueryListenerAdapter adapter = new ContinousQueryListenerAdapter(mock);
|
ContinuousQueryListenerAdapter adapter = new ContinuousQueryListenerAdapter(mock);
|
||||||
adapter.setDefaultListenerMethod("handleAll");
|
adapter.setDefaultListenerMethod("handleAll");
|
||||||
CqEvent event = event();
|
CqEvent event = event();
|
||||||
|
|
||||||
@@ -205,7 +205,7 @@ public class QueryListenerAdapterTest {
|
|||||||
@Test
|
@Test
|
||||||
public void testInvalid() throws Exception {
|
public void testInvalid() throws Exception {
|
||||||
Delegate mock = mock(Delegate.class);
|
Delegate mock = mock(Delegate.class);
|
||||||
ContinousQueryListenerAdapter adapter = new ContinousQueryListenerAdapter(mock);
|
ContinuousQueryListenerAdapter adapter = new ContinuousQueryListenerAdapter(mock);
|
||||||
adapter.setDefaultListenerMethod("handleInvalid");
|
adapter.setDefaultListenerMethod("handleInvalid");
|
||||||
|
|
||||||
adapter.onEvent(event());
|
adapter.onEvent(event());
|
||||||
|
|||||||
Reference in New Issue
Block a user