Uploaded image for project: 'Spring Data Geode'
  1. Spring Data Geode
  2. DATAGEODE-280

Refactor ContinuousQueryListenerContainer to use PoolResolver

    XMLWordPrintable

    Details

      Description

      This test uses geode's internal PoolManagerImpl class to install a Pool into Geode's singleton list of available Pools.

      https://github.com/spring-projects/spring-data-geode/blob/896d8850d11b9c1202d91b2b7f220a5a8cb04764/spring-data-geode/src/test/java/org/springframework/data/gemfire/listener/ContinuousQueryListenerContainerUnitTests.java#L114

      This is problematic for two reasons:
      1) PoolManagerImpl is an internal class in Geode, it may change or be removed at any time.
      2) This installing a mock object into a Geode singleton. This may cause strange behavior in future tests that are running in the same JVM.

      In this case, I think this use of PoolManagerImpl looks like it should be easy to remove. If ContiniousQueryListenerContainer provided a way to inject an object to be used to look up Pools, rather than directly depending on the static PoolManager.find method, the test could avoid having to change the real Geode singleton.

        Attachments

          Activity

            People

            Assignee:
            jblum John Blum
            Reporter:
            upthewaterspout Dan Smith
            Last updater:
            Mark Paluch
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: