org.jtestcase.core.model
Class AssertInstance

java.lang.Object
  extended by org.jtestcase.core.model.AssertInstance
All Implemented Interfaces:
AbstractType, IUINode

public class AssertInstance
extends java.lang.Object
implements AbstractType, IUINode

Represents an assert tag from the JTestCaseWizard XML.

Author:
Fausto Lelli $Id: AssertInstance.java,v 1.1 2005/10/12 20:20:08 faustothegrey Exp $

Field Summary
 java.lang.String content
          The content of the assert element
 java.lang.String key_type
          The type of the keys for complex types in assert elements
 java.lang.String name
          The name of the assert
 java.util.List nestedInstances
          The list of nested instances in the assert
 java.lang.String type
          The type of the assert
 java.lang.String value_type
          The type of the value for complex types in assert elements
 
Constructor Summary
AssertInstance(java.lang.String name, java.lang.String type, java.lang.String action, java.lang.String content, java.lang.String key_type, java.lang.String value_type)
          Standard constructor.
 
Method Summary
 void add(IUINode toAdd)
          Callback function should delegate to addAssert()
 void addAssert(AssertInstance nestedInstance)
          Adds a nested assert instance to the list of nested instances
static AssertInstance createAssertInstance(org.jdom.Element expected)
          Creates an assert instance from an assert element.
static AssertInstance createAssertInstance(java.lang.String name, java.lang.String type, java.lang.String action, java.lang.String content, java.lang.String key_type, java.lang.String value_type)
           
 boolean equals(AssertInstance anotherExpectedInstance)
          two ExpectedInstances should be considered equal if their fields are equal name field is case sensitive type field is not case sensitive ( to review ) content field is case sensitive
 java.lang.String getAction()
          Returns the action of the assert
 java.lang.String getContent()
          Returns the content of the param or assert element
 java.lang.String getKey_type()
          Returns the type of the keys for complex types in param or assert elements
 java.lang.String getName()
          Returns the name of the param or assert
 java.util.List getNestedInstances()
          Returns the list of nested instances in the param or assert
 IUINode getNode()
           
 java.lang.String getNodeImage()
           
 java.lang.String getNodeLabel()
           
 java.util.List getNodes()
           
 java.lang.String getType()
          Returns the type of the param or assert
 java.lang.Object getUISupport()
           
 java.lang.String getValue_type()
          Returns the type of the value for complex types in param or assert elements
 boolean isGUIsupported()
           
 void remove(IUINode toRemove)
           
 void removeAssert(AssertInstance nestedInstance)
           
 void setAction(java.lang.String action)
          Sets the action of the assert
 void setContent(java.lang.String content)
          Sets the content of the assert element
 void setGUIsupported(boolean isGUIsupported)
           
 void setKey_type(java.lang.String key_type)
          Sets the type of the keys for complex types in assert elements
 void setName(java.lang.String name)
          Sets the name of the assert
 void setType(java.lang.String type)
          Sets the type of the assert
 void setValue_type(java.lang.String value_type)
          Sets the type of the value for complex types in assert elements
 int size()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

name

public java.lang.String name
The name of the assert


type

public java.lang.String type
The type of the assert


content

public java.lang.String content
The content of the assert element


key_type

public java.lang.String key_type
The type of the keys for complex types in assert elements


value_type

public java.lang.String value_type
The type of the value for complex types in assert elements


nestedInstances

public java.util.List nestedInstances
The list of nested instances in the assert

Constructor Detail

AssertInstance

public AssertInstance(java.lang.String name,
                      java.lang.String type,
                      java.lang.String action,
                      java.lang.String content,
                      java.lang.String key_type,
                      java.lang.String value_type)
Standard constructor. Sets all internal members.

Parameters:
name - the name of the assert
type - the type of the assert
action - the action string for this assert
content - the content of the assert element
key_type - the type of the keys for complex types in assert elements
value_type - the type of the value for complex types in assert elements
Method Detail

setName

public void setName(java.lang.String name)
Sets the name of the assert

Parameters:
name - the name of the assert

setType

public void setType(java.lang.String type)
Sets the type of the assert

Parameters:
type - the type of the assert

setAction

public void setAction(java.lang.String action)
Sets the action of the assert

Parameters:
action - the action of the assert

setContent

public void setContent(java.lang.String content)
Sets the content of the assert element

Parameters:
content - the content of the assert element

getName

public java.lang.String getName()
Description copied from interface: AbstractType
Returns the name of the param or assert

Specified by:
getName in interface AbstractType
Returns:
the name of the param or assert
See Also:
AbstractType.getName()

getType

public java.lang.String getType()
Description copied from interface: AbstractType
Returns the type of the param or assert

Specified by:
getType in interface AbstractType
Returns:
the type of the param or assert
See Also:
AbstractType.getType()

getAction

public java.lang.String getAction()
Returns the action of the assert

Returns:
the action of the assert

getContent

public java.lang.String getContent()
Description copied from interface: AbstractType
Returns the content of the param or assert element

Specified by:
getContent in interface AbstractType
Returns:
the content of the param or assert element
See Also:
AbstractType.getContent()

getKey_type

public java.lang.String getKey_type()
Description copied from interface: AbstractType
Returns the type of the keys for complex types in param or assert elements

Specified by:
getKey_type in interface AbstractType
Returns:
the type of the keys for complex types in param or assert elements
See Also:
AbstractType.getKey_type()

setKey_type

public void setKey_type(java.lang.String key_type)
Sets the type of the keys for complex types in assert elements

Parameters:
key_type - the type of the keys for complex types in assert elements

getValue_type

public java.lang.String getValue_type()
Description copied from interface: AbstractType
Returns the type of the value for complex types in param or assert elements

Specified by:
getValue_type in interface AbstractType
Returns:
the type of the value for complex types in param or assert elements
See Also:
AbstractType.getValue_type()

setValue_type

public void setValue_type(java.lang.String value_type)
Sets the type of the value for complex types in assert elements

Parameters:
value_type - the type of the value for complex types in assert elements

addAssert

public void addAssert(AssertInstance nestedInstance)
Adds a nested assert instance to the list of nested instances

Parameters:
nestedInstance - an assert instance

removeAssert

public void removeAssert(AssertInstance nestedInstance)

getNestedInstances

public java.util.List getNestedInstances()
Description copied from interface: AbstractType
Returns the list of nested instances in the param or assert

Specified by:
getNestedInstances in interface AbstractType
Returns:
the list of nested instances in the param or assert
See Also:
AbstractType.getNestedInstances()

getUISupport

public java.lang.Object getUISupport()
Specified by:
getUISupport in interface IUINode

getNodeImage

public java.lang.String getNodeImage()
Specified by:
getNodeImage in interface IUINode

getNodeLabel

public java.lang.String getNodeLabel()
Specified by:
getNodeLabel in interface IUINode

add

public void add(IUINode toAdd)
Callback function should delegate to addAssert()

Specified by:
add in interface IUINode

getNode

public IUINode getNode()
Specified by:
getNode in interface IUINode

getNodes

public java.util.List getNodes()
Specified by:
getNodes in interface IUINode

remove

public void remove(IUINode toRemove)
Specified by:
remove in interface IUINode

size

public int size()
Specified by:
size in interface IUINode

equals

public boolean equals(AssertInstance anotherExpectedInstance)
two ExpectedInstances should be considered equal if their fields are equal name field is case sensitive type field is not case sensitive ( to review ) content field is case sensitive

Parameters:
anotherExpectedInstance -
Returns:
boolean

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
See Also:
Object.toString()

isGUIsupported

public boolean isGUIsupported()
Specified by:
isGUIsupported in interface IUINode

setGUIsupported

public void setGUIsupported(boolean isGUIsupported)

createAssertInstance

public static AssertInstance createAssertInstance(org.jdom.Element expected)
Creates an assert instance from an assert element. Creates the instance without the nested instances.

Parameters:
expected - the assert element
Returns:
an assert instance

createAssertInstance

public static AssertInstance createAssertInstance(java.lang.String name,
                                                  java.lang.String type,
                                                  java.lang.String action,
                                                  java.lang.String content,
                                                  java.lang.String key_type,
                                                  java.lang.String value_type)