com.eyebolt.iplib
Class ClientTest

java.lang.Object
  |
  +--junit.framework.Assert
        |
        +--junit.framework.TestCase
              |
              +--com.eyebolt.iplib.ClientTest
All Implemented Interfaces:
junit.framework.Test

public class ClientTest
extends junit.framework.TestCase

Test iplib

Version:
0.01, 12 Jan 1998
Author:
John Gardner

Inner Class Summary
(package private)  class ClientTest.Receiver
           
(package private)  class ClientTest.TopCallback
           
 
Field Summary
(package private)  IPAddress address
           
(package private)  java.util.Date createDate
           
(package private)  long failed
           
(package private)  IPManager ipmanager
           
(package private)  IPKey key
           
private  int LEVEL_INFO
           
private  int LEVEL_TRACE
           
static int LOOPBACK_LISTEN_PORT
          Description of the Field
static int MESSAGE_TIMEOUT
          request message size; generate a request with count characters
(package private)  long messageCount
           
static int PACKET_COUNT
          How many packets to send in multi-packet tests
private  java.lang.Object packetWaiter
           
static java.lang.String PUBLIC_CONNECT_HOST
          Description of the Field
static int PUBLIC_CONNECT_PORT
          Description of the Field
static int REQUEST_MESSAGE_SIZE
          request message size; generate a request with count characters
(package private)  ServerTest server
           
private static boolean verbose
           
 
Fields inherited from class junit.framework.TestCase
fName
 
Constructor Summary
ClientTest(java.lang.String name)
          Constructor for the ClientTest object
ClientTest(java.lang.String name, boolean verbose)
          Constructor for the ClientTest object
 
Method Summary
 long connect(java.lang.String host, int port)
          Description of the Method
 void createMessage(IPMessage message)
          Load a message from disk, or generate a text message
private  void log(java.lang.Exception e)
           
private  void log(int level, java.lang.String s)
           
private  void log(java.lang.String s)
           
static void main(java.lang.String[] args)
           
 void sendBlockingMessage()
          Description of the Method
 void sendMessage()
          Description of the Method
protected  void setUp()
          Setup function, called automatically by JUnit framework
 void setVerbose(boolean verbose)
           
private static void showBytes(java.io.PrintStream out, byte[] buf)
           
static junit.framework.Test suite()
          Assembles and returns a test suite for all the test methods of this test case.
protected  void tearDown()
          Teardown function, called automatically by JUnit framework
 void testAsyncPacket()
          Test connectivity between this library and itself, with a content packet.
 void testAsyncPacketStream()
          FIXME: Not implemented correctly; needs to wait for packets Send a stream of async packets, wait until all the responses come back.
 void testConnect()
          Basic test of connectivity.
 void testPacket()
          Test connectivity between this library and itself, with a content packet.
 void testPacketStream()
          Test connectivity between this library and itself, with a content packet.
 void testSelfConnect()
          Test connectivity between this library and itself.
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, name, run, run, runBare, runTest, toString
 
Methods inherited from class junit.framework.Assert
assert, assert, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertNotNull, assertNotNull, assertNull, assertNull, assertSame, assertSame, fail, fail, failNotEquals, failNotSame
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

PUBLIC_CONNECT_HOST

public static final java.lang.String PUBLIC_CONNECT_HOST
Description of the Field

PUBLIC_CONNECT_PORT

public static final int PUBLIC_CONNECT_PORT
Description of the Field

LOOPBACK_LISTEN_PORT

public static final int LOOPBACK_LISTEN_PORT
Description of the Field

PACKET_COUNT

public static final int PACKET_COUNT
How many packets to send in multi-packet tests

REQUEST_MESSAGE_SIZE

public static final int REQUEST_MESSAGE_SIZE
request message size; generate a request with count characters

MESSAGE_TIMEOUT

public static final int MESSAGE_TIMEOUT
request message size; generate a request with count characters

LEVEL_TRACE

private final int LEVEL_TRACE

LEVEL_INFO

private final int LEVEL_INFO

server

ServerTest server

packetWaiter

private java.lang.Object packetWaiter

verbose

private static boolean verbose

ipmanager

IPManager ipmanager

address

IPAddress address

key

IPKey key

createDate

java.util.Date createDate

failed

long failed

messageCount

long messageCount
Constructor Detail

ClientTest

public ClientTest(java.lang.String name)
Constructor for the ClientTest object
Parameters:
name - Description of Parameter

ClientTest

public ClientTest(java.lang.String name,
                  boolean verbose)
Constructor for the ClientTest object
Parameters:
name - Description of Parameter
Method Detail

testConnect

public void testConnect()
                 throws java.io.IOException,
                        java.net.UnknownHostException
Basic test of connectivity.

testSelfConnect

public void testSelfConnect()
                     throws java.io.IOException,
                            java.net.UnknownHostException
Test connectivity between this library and itself. Requires first ListenTest to have been run already, so there's someone to connect to.

testPacket

public void testPacket()
                throws java.io.IOException,
                       java.net.UnknownHostException
Test connectivity between this library and itself, with a content packet. Requires ListenTest to have been run already, so there's someone to connect to.

testAsyncPacket

public void testAsyncPacket()
                     throws java.io.IOException,
                            java.net.UnknownHostException
Test connectivity between this library and itself, with a content packet. Requires ListenTest to have been run already, so there's someone to connect to.

testPacketStream

public void testPacketStream()
                      throws java.io.IOException,
                             java.net.UnknownHostException
Test connectivity between this library and itself, with a content packet. Requires ListenTest to have been run already, so there's someone to connect to.

testAsyncPacketStream

public void testAsyncPacketStream()
                           throws java.io.IOException,
                                  java.net.UnknownHostException
FIXME: Not implemented correctly; needs to wait for packets Send a stream of async packets, wait until all the responses come back.

setVerbose

public void setVerbose(boolean verbose)

connect

public long connect(java.lang.String host,
                    int port)
             throws java.net.UnknownHostException,
                    java.io.IOException
Description of the Method
Parameters:
host - Description of Parameter
port - Description of Parameter
Returns:
Description of the Returned Value

createMessage

public void createMessage(IPMessage message)
Load a message from disk, or generate a text message
Parameters:
out - Description of Parameter

sendMessage

public void sendMessage()
Description of the Method
Parameters:
out - Description of Parameter

sendBlockingMessage

public void sendBlockingMessage()
                         throws java.io.IOException
Description of the Method
Parameters:
out - Description of Parameter

suite

public static junit.framework.Test suite()
Assembles and returns a test suite for all the test methods of this test case.
Returns:
A non-null test suite.

setUp

protected void setUp()
Setup function, called automatically by JUnit framework
Overrides:
setUp in class junit.framework.TestCase

tearDown

protected void tearDown()
Teardown function, called automatically by JUnit framework
Overrides:
tearDown in class junit.framework.TestCase

main

public static void main(java.lang.String[] args)

log

private void log(java.lang.String s)

log

private void log(int level,
                 java.lang.String s)

log

private void log(java.lang.Exception e)

showBytes

private static void showBytes(java.io.PrintStream out,
                              byte[] buf)


Copyright © 2001 Eyebolt, Inc.