[ 
https://issues.apache.org/jira/browse/GEODE-7531?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16988254#comment-16988254
 ] 

Dan Smith commented on GEODE-7531:
----------------------------------

The only use of PoolManagerImpl.register I see in spring data geode is one unit 
test, that is trying to inject a mock pool directly into the PoolManager 
singleton, here - 
https://github.com/spring-projects/spring-data-geode/blob/896d8850d11b9c1202d91b2b7f220a5a8cb04764/spring-data-geode/src/test/java/org/springframework/data/gemfire/listener/ContinuousQueryListenerContainerUnitTests.java#L114

While singletons do suck, I think maybe a better approach for the spring data 
geode test would be to provide a way to inject a mock PoolManager into 
ContinuousQueryListenerContainer. Then that class could be unit tested without 
having to resort to modifying internal geode singletons and using non-public 
APIs.


> PoolManagerImpl.unregister(:Pool) naively assumes all Pool object instances 
> are PoolImpls
> -----------------------------------------------------------------------------------------
>
>                 Key: GEODE-7531
>                 URL: https://issues.apache.org/jira/browse/GEODE-7531
>             Project: Geode
>          Issue Type: Bug
>          Components: client/server
>    Affects Versions: 1.10.0
>         Environment: Apache Geode based applications on the JVM.
>            Reporter: John Blum
>            Priority: Blocker
>
> A recent 
> [change|https://github.com/apache/geode/blob/rel/v1.10.0/geode-core/src/main/java/org/apache/geode/internal/cache/PoolManagerImpl.java#L169-L174]
>  to the {{o.a.g.internal.cache.PoolManagerImpl}} class expects all 
> {{o.a.g.cache.client.Pools}} registered with the 
> {{o.a.g.cache.client.PoolManager}} to be 
> {{o.a.g.cache.client.internal.PoolImp}} objects.
> This is certainly not going to be the case for Unit Tests that properly 
> "mock" 1 or more {{Pool}} instances and additionally needs to register the 
> mock {{Pool}} instances with the {{PoolManager}}.  While the later may not be 
> as common for application code, it is more certainly common, and in some 
> cases necessary, for framework or tooling code.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to