Announcement Announcement Module
No announcement yet.
Thoughts on writing Spring integration tests that include @OnServers function calls? Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Thoughts on writing Spring integration tests that include @OnServers function calls?

    To integration test an @OnServers GemFire function call, we'd want to stand up a GemFire server (which requires a GemFire cache) and connect to it using client regions and a client cache. However, standing up two GemFire caches in the same JVM isn't permitted (caches are singletons). What are your thoughts on the best way to approach testing?

    Extra points for working test code where appropriate!

  • #2
    @jschan Hi, I have a solution for you (as in... "working test code") and it is based on work I did on the GemFire team building the 'start-locator/server' commands in Gfsh that also borrows a few ideas from the Spring Data GemFire project for launching/starting servers in more complex, integration-based tests (e.g., testing client/server functionality) that are part of the project test suite.

    In fact, if you look at the ForkUtil class on GitHub and where this class is being used in the SDG test suite, you will see examples of test classes that start a GemFire Server process with a Spring Data GemFire configuration file and interact with that GemFire Server during the test run.

    However, if you would like a more specific and detailed example of an actual test class testing client/server function execution based on your description above, feel free to email me [jblum at gopivotal dot com].


    • #3
      Awsome John! I took a quick gander at the ForkUtil, and I'm excited about checking it out more in depth! It looks like there's probably plenty of examples linked to it, but I'll let you know how it works out. Thanks a ton!