org.backsource.alert.agent
Class BaseCase

java.lang.Object
  extended byjunit.framework.Assert
      extended byjunit.framework.TestCase
          extended byorg.backsource.alert.agent.BaseCase
All Implemented Interfaces:
Agent, junit.framework.Test
Direct Known Subclasses:
DirTest, DiskCheckTest, FtpAgent, JabberAliveTest, JmsLogTest, SQLTest, UrlCase

public class BaseCase
extends junit.framework.TestCase
implements Agent

A base class for Agents.

This class should be extended by agents. It should override setUp() to set up any of its own properties. An agent will be setup after instantiation by the AgentCase class. Sublclasses may acces the prop field, in the setUp method

Version:
$Revision: 1.1.1.1 $
Author:
Peter Antman

Field Summary
protected  java.lang.String agentName
           
protected  java.util.Properties prop
           
 
Constructor Summary
BaseCase(java.lang.String name)
           
 
Method Summary
 java.lang.String getAgentName()
          Get the name of the agent instance.
 java.util.Properties getProperties()
          Get the properties connected to this particular instance of the agent.
 void initialize(java.lang.String agentName, java.util.Properties prop)
          Initialize the agent with a unique describing name and its properties.
protected  void setUp()
           
 java.lang.String toString()
          Owerridden to add the agent name to the string.
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, tearDown
 
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 junit.framework.Test
countTestCases, run
 

Field Detail

agentName

protected java.lang.String agentName

prop

protected java.util.Properties prop
Constructor Detail

BaseCase

public BaseCase(java.lang.String name)
Method Detail

setUp

protected void setUp()
              throws java.lang.Exception
Throws:
java.lang.Exception

initialize

public void initialize(java.lang.String agentName,
                       java.util.Properties prop)
                throws java.lang.Exception
Initialize the agent with a unique describing name and its properties.

Specified by:
initialize in interface Agent
Throws:
java.lang.Exception

getAgentName

public java.lang.String getAgentName()
Get the name of the agent instance.


getProperties

public java.util.Properties getProperties()
Get the properties connected to this particular instance of the agent.


toString

public java.lang.String toString()
Owerridden to add the agent name to the string.



Copyright © 2002-2004 Backsource. All Rights Reserved.