org.osesb.objectpools.test
Class ThreadedKeyPooledJAXRPCClientTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.osesb.utilities.junit.OSESBTestCase
              extended by org.osesb.utilities.junit.OSESBThreadedTestCase
                  extended by org.osesb.objectpools.test.ThreadedKeyPooledJAXRPCClientTest
All Implemented Interfaces:
junit.framework.Test

public class ThreadedKeyPooledJAXRPCClientTest
extends OSESBThreadedTestCase

Threaded JAXRPCClientKeyedPoolFactory Test.

In Test.properties, uncomment the 'keyPooledJAXRPCClientConfiguration' entry for the platform where the web services are deployed.

Web Services must be deployed according to the jax-rpc client configurations in the pool configuration file defined by the 'keyPooledJAXRPCClientConfiguration' entry in Test.properties.

Generally, the services are deployed from the test-webservices module.

The test exercises the sendXMLMessage() method of JAXRPCDynamicSendMessageClient, which is the pooled class. The target service must accept a XML message and return a XML message. Both the secure and non-secure signatures of sendXMLMessage() are exercised.

The test assumes that the deployed web service echoes the XML message sent by JAXRPCDynamicSendMessageClient. A test passes if the root tag of the returned XML message is the same as the root tag of the message that was sent.

For the JAXRPCClientConfigurations that include a non-empty <username> tag, the test method invokes the service with a username and password that is generated randomly from a list of usernames. This tests that the use of ThreadLocal variables by the server-side security handlers in the org.osesb.connectors.jaxrpc.security package.

Generally, the test is run against the EchoMessage services in the test-webservices module, but any web service that fulfills the 'echo' requirement will do.

The test collects performance statistics and reports average time to send messages across all threads in milliseconds.

IMPORTANT NOTE: This test consistently fails at around iteration 100 when configured to use an Axis 1.3 as the client. The failure message is java.net.BindException: Address already in use: connect. The error does not occur when the test is configured to use a Weblogic SOAP client, nor does it occur in a Axis-configured, single-threaded tests. This may indicate an interaction between the Apache object pool and the Axis, SOAP client.

IMPORTANT NOTE: Test passes with Axis 1.4 as the client..


Field Summary
 
Fields inherited from class org.osesb.utilities.junit.OSESBThreadedTestCase
numberOfIterations, numberOfTestThreads, threadDelay
 
Fields inherited from class org.osesb.utilities.junit.OSESBTestCase
configFile, log, reader, testDataDirectory, testProperties, thisClassName
 
Constructor Summary
ThreadedKeyPooledJAXRPCClientTest(java.lang.String name)
          Construct a new instance.
 
Method Summary
static void main(java.lang.String[] args)
          The main method runs all the tests in the text ui
 void setUp()
          This method is called before a test is executed.
static junit.framework.Test suite()
          The suite method runs all the tests
 void tearDown()
          This method is called after a test is executed.
 void testKeyPooledJAXRPCClient()
          Test key-pooled jax-rpc clients.
 
Methods inherited from class org.osesb.utilities.junit.OSESBThreadedTestCase
displayStartupMessage
 
Methods inherited from class org.osesb.utilities.junit.OSESBTestCase
getBooleanTestProperty, getIntTestProperty, getLongTestProperty, getTestResourcesAsStreams, getTestResourcesAsText, getTestResourcesFiles, loadTestProperties, readTestFilesAsStreams
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, 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, failNotEquals, failNotSame, failSame, format
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ThreadedKeyPooledJAXRPCClientTest

public ThreadedKeyPooledJAXRPCClientTest(java.lang.String name)
Construct a new instance.

Ancestor constructors do the following:

  1. Instantiates a logging implementation.
  2. Instantiates an instance of ClassLoaderFileReader for reading test files from the ClassPath (not the file system).
  3. Loads Test.properties into ResourceBundle testProperties.
  4. Sets the testDataDirectory property using the testDataDirectory entry from Test.properties.
  5. Override standard values for numberOfTestThreads, numberOfIterations, and numberOfIterations from values in Test.properties.

Method Detail

suite

public static junit.framework.Test suite()
The suite method runs all the tests


setUp

public void setUp()
           throws java.lang.Exception
This method is called before a test is executed.

Overrides:
setUp in class OSESBTestCase
Throws:
java.lang.Exception

tearDown

public void tearDown()
              throws java.lang.Exception
This method is called after a test is executed.

Overrides:
tearDown in class OSESBTestCase
Throws:
java.lang.Exception

main

public static void main(java.lang.String[] args)
The main method runs all the tests in the text ui


testKeyPooledJAXRPCClient

public void testKeyPooledJAXRPCClient()
                               throws java.lang.Exception
Test key-pooled jax-rpc clients.

Throws:
java.lang.Exception