org.apache.jcs.auxiliary.remote.server
Class BasicRemoteCacheClientServerUnitTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.apache.jcs.auxiliary.remote.server.BasicRemoteCacheClientServerUnitTest
All Implemented Interfaces:
junit.framework.Test

public class BasicRemoteCacheClientServerUnitTest
extends junit.framework.TestCase

These tests startup the remote server and make requests to it.

Author:
Aaron Smuts

Constructor Summary
BasicRemoteCacheClientServerUnitTest()
          Starts the server.
 
Method Summary
 void testPutaMultipleAndListen()
          Register a listener with the server.
 void testPutAndListen()
          Register a listener with the server.
 void testPutRemove()
          Verify that we can remove an item via the remote server.
 void testSinglePut()
          Verify that we can start the remote cache server.
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, setUp, tearDown, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BasicRemoteCacheClientServerUnitTest

public BasicRemoteCacheClientServerUnitTest()
Starts the server. This is not in a setup, since the server is slow to kill right now.

Method Detail

testSinglePut

public void testSinglePut()
                   throws Exception
Verify that we can start the remote cache server. Send an item to the remote. Verify that the remote put count goes up. If we go through JCS, the manager will be shared and we will get into an endless loop. We will use a mock cache manager instead.

The remote server uses the real JCS. We can verify that items are added to JCS behind the server by calling get. We cannot access it directly via JCS since it is serialized.

This test uses a mock injected client to test a normal server.

Throws:
Exception

testPutRemove

public void testPutRemove()
                   throws Exception
Verify that we can remove an item via the remote server.

Throws:
Exception

testPutAndListen

public void testPutAndListen()
                      throws Exception
Register a listener with the server. Send an update. Verify that the listener received it.

Throws:
Exception

testPutaMultipleAndListen

public void testPutaMultipleAndListen()
                               throws Exception
Register a listener with the server. Send an update. Verify that the listener received it.

Throws:
Exception


Copyright © 2002-2013 The Apache Software Foundation. All Rights Reserved.