org.finra.jtaf.core.model.test
Class TestComponent

java.lang.Object
  extended by org.finra.jtaf.core.model.test.TestComponent
Direct Known Subclasses:
TestNamespace, TestScript

public abstract class TestComponent
extends Object

Base class of all test-related components within the model, includes only TestScripts and TestNamespaces. This class serves a few primary tasks: 1. It ensures that all subcomponents have proper names 2. It provides generic methods that can be used to crawl the model


Constructor Summary
TestComponent(String name)
           
 
Method Summary
abstract  void acceptTestVisitor(ITestVisitor v)
           
 String getFullName()
           
 String getName()
           
 List<TestComponent> getNeighbor(String token)
          Returns a parent or child of the current node depending upon the token provided.
 TestNamespace getParent()
           
 void setName(String name)
           
protected  void setParent(TestNamespace parent)
          Invoked by TestNamespace.addChild().
 List<TestComponent> toComponent(String path)
          Convenience method: Converts a String to a TestPath
 List<TestComponent> toComponent(TestPath path)
          Travel from this component to another component via the given path.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TestComponent

public TestComponent(String name)
              throws NameFormatException
Parameters:
name -
parent -
Throws:
NameFormatException
Method Detail

getName

public final String getName()

setName

public final void setName(String name)

getFullName

public final String getFullName()
Returns:
The full name of the component, including names of parent components

getParent

public final TestNamespace getParent()
Returns:
The TestGroup object that owns this TestTarget, or null if none exists

setParent

protected final void setParent(TestNamespace parent)
Invoked by TestNamespace.addChild(). TestNamespace handles the details of disconnecting the previous parent.

Parameters:
parent -

getNeighbor

public List<TestComponent> getNeighbor(String token)
Returns a parent or child of the current node depending upon the token provided. Subclasses should invoke super.getNeighbor() before implementing their own logic

Parameters:
token -
Returns:

toComponent

public final List<TestComponent> toComponent(TestPath path)
Travel from this component to another component via the given path. This just calls getNeighbor() repeatedly against the components of the path until the destination is reached.

Parameters:
path -
Returns:

toComponent

public final List<TestComponent> toComponent(String path)
Convenience method: Converts a String to a TestPath

Parameters:
path -
Returns:

acceptTestVisitor

public abstract void acceptTestVisitor(ITestVisitor v)
                                throws Exception
Throws:
Exception


Copyright © 2014. All rights reserved.