Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

cactus
Class SyncBeanTest  view SyncBeanTest download SyncBeanTest.java

java.lang.Object
  extended byjunit.framework.Assert
      extended byjunit.framework.TestCase
          extended byorg.apache.cactus.internal.AbstractCactusTestCase
              extended byorg.apache.cactus.ServletTestCase
                  extended bycactus.SyncBeanTest
All Implemented Interfaces:
org.apache.cactus.internal.CactusTestCase, junit.framework.Test

public class SyncBeanTest
extends org.apache.cactus.ServletTestCase

Tests of the SyncBean, the Sync4j EJB. This is to show how the client can obtain SyncBean's remote interface and invoke its business methods, processMessage(), with different message types.


Field Summary
private  byte[] requestUnknownMsg
          A message of unknown type to test the error handling.
private  byte[] requestWbXmlMsg
          A request message, in WB XML format.
private  byte[] requestXmlMsg
          A request message, in XML format.
private  sync4j.framework.server.SyncResponse response
          A reference to the response received from the SyncEJB business method.
private  sync4j.server.syncbean.SyncRemote sync
          A reference to the SyncEJB remote interface.
 
Fields inherited from class org.apache.cactus.ServletTestCase
config, request, session
 
Fields inherited from class org.apache.cactus.internal.AbstractCactusTestCase
 
Fields inherited from class junit.framework.TestCase
 
Constructor Summary
SyncBeanTest(java.lang.String theName)
          Defines the testcase name for JUnit.
 
Method Summary
protected  void setUp()
          Sets up every test by obtaining the SyncEJB by its remote interface, SyncHomeRemote and SyncRemote, and initializes different types of message for testing.
static junit.framework.Test suite()
          An aggregrate of all the tests.
 void testProcessUnknownMessage()
          Verifies that we can handle Unknown (neither XML nor WBXML) message without any problems.
 void testProcessWBXMLMessage()
          Verifies that we can process WBXML message.
 void testProcessXMLMessage()
          Verifies that we can process XML message.
 
Methods inherited from class org.apache.cactus.ServletTestCase
createProtocolHandler
 
Methods inherited from class org.apache.cactus.internal.AbstractCactusTestCase
runBare, runBareServer
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runTest, setName, 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
 
Methods inherited from interface org.apache.cactus.internal.CactusTestCase
runBareServer
 

Field Detail

sync

private sync4j.server.syncbean.SyncRemote sync
A reference to the SyncEJB remote interface. It is an entry point of all the business logic.


requestXmlMsg

private byte[] requestXmlMsg
A request message, in XML format.


requestWbXmlMsg

private byte[] requestWbXmlMsg
A request message, in WB XML format.


requestUnknownMsg

private byte[] requestUnknownMsg
A message of unknown type to test the error handling.


response

private sync4j.framework.server.SyncResponse response
A reference to the response received from the SyncEJB business method.

Constructor Detail

SyncBeanTest

public SyncBeanTest(java.lang.String theName)
Defines the testcase name for JUnit.

Method Detail

suite

public static junit.framework.Test suite()
An aggregrate of all the tests.


setUp

protected void setUp()
Sets up every test by obtaining the SyncEJB by its remote interface, SyncHomeRemote and SyncRemote, and initializes different types of message for testing.


testProcessXMLMessage

public void testProcessXMLMessage()
                           throws java.lang.Exception
Verifies that we can process XML message.


testProcessWBXMLMessage

public void testProcessWBXMLMessage()
                             throws java.lang.Exception
Verifies that we can process WBXML message.


testProcessUnknownMessage

public void testProcessUnknownMessage()
                               throws java.lang.Exception
Verifies that we can handle Unknown (neither XML nor WBXML) message without any problems.