Would it be viable to consider using the REST API for this? --Jens
On Mon, Apr 3, 2017 at 2:31 PM, Kirk Lund <kl...@apache.org> wrote: > Has anyone written a test where they use a single JVM in which they start a > server Cache and then fake up a connection from a non-existent client to > feed messages into the server? > > I think most folks have gone the easy route of using dunit for > client/server tests. I need to do something like this for benchmarking, but > I'm not sure I want to try using dunit within JMH. > > My current (non-dunit) options are: > > 1) write a benchmark in which I fork a JVM for the server and then use the > test JVM for a real ClientCache > > 2) write a benchmark in which I use Mockito to fake huge parts of either > the server or the client > > I can imagine someone trying to use ClassLoader magic to create a server > Cache and a ClientCache in one JVM... but I think there must be an easier > way to do this by diving straight into some of the server-side code to > construct my own instances of ServerConnection and ClientProxyMembershipID > so that I can feed messages to the server from within the same JVM. > > Benchmarking client-side or server-side code is going to be difficult and > trouble-some if we always have to fork JVMs within the setup of a JMH > benchmark. Also, maybe the client/server protocol changes that folks are > talking about could create a mechanism to better facilitate this kind of > testing? >