org.objectweb.jonas_lib.deployment.tests.AbsDeploymentTest Class Reference

List of all members.

Public Member Functions

void stress () throws Exception
void startTest (boolean random) throws Exception
void parseElement () throws Exception
void parseXmlfromFile (String fileName) throws Exception
void fill (Element element, boolean random) throws Exception

Protected Member Functions

 AbsDeploymentTest ()
void checkDiff (String xmlOriginal, String xmlParsed) throws Exception
boolean aleatOK ()
int nbAleat ()
void addElement (Element element, Method method, Class[] argsMethod, boolean random) throws Exception
void setElement (Element element, Method method, Class[] argsMethod, boolean random) throws Exception
void fillString (Element element, Method method, boolean random) throws Exception
void fillQName (Element element, Method method, boolean random) throws Exception
String getNameCounterForElement (Element element, Method method)
String convertUpperCaseToXml (String name)

Detailed Description

Defines an abstract class for testing the classes built with Digester
Author:
Florent Benoit

Definition at line 48 of file AbsDeploymentTest.java.


Constructor & Destructor Documentation

org.objectweb.jonas_lib.deployment.tests.AbsDeploymentTest.AbsDeploymentTest  )  [protected]
 

Build a new Test

Definition at line 58 of file AbsDeploymentTest.java.


Member Function Documentation

void org.objectweb.jonas_lib.deployment.tests.AbsDeploymentTest.addElement Element  element,
Method  method,
Class[]  argsMethod,
boolean  random
throws Exception [protected]
 

Add to an element its sub element Add many times a sub-element if random is not set to true

Parameters:
element element on which we have to add sub elements
method method of the element (determine type of the sub element
argsMethod arguments of the method
random use random or not
Exceptions:
Exception if the subelement can not be added

Definition at line 219 of file AbsDeploymentTest.java.

boolean org.objectweb.jonas_lib.deployment.tests.AbsDeploymentTest.aleatOK  )  [protected]
 

Random for returning true or false

Returns:
true or false with random

Definition at line 198 of file AbsDeploymentTest.java.

void org.objectweb.jonas_lib.deployment.tests.AbsDeploymentTest.checkDiff String  xmlOriginal,
String  xmlParsed
throws Exception [protected]
 

Check the difference between original xml and parsed xml

Parameters:
xmlOriginal original XML
xmlParsed parsed XML
Exceptions:
Exception if there is a difference between original and parsed XML

Definition at line 136 of file AbsDeploymentTest.java.

String org.objectweb.jonas_lib.deployment.tests.AbsDeploymentTest.convertUpperCaseToXml String  name  )  [protected]
 

Convert the name of an element into its xml string representation example : WebApp --> web-app

Parameters:
name the name of the element to convert
Returns:
the xml string representation of an element

Definition at line 335 of file AbsDeploymentTest.java.

void org.objectweb.jonas_lib.deployment.tests.AbsDeploymentTest.fill Element  element,
boolean  random
throws Exception
 

Fill the structure of the given element. Fill randomly if random is set to true

Parameters:
element element to fill
random determines if the element must be filled randomly or not
Exceptions:
Exception if the element can not be filled

Definition at line 159 of file AbsDeploymentTest.java.

void org.objectweb.jonas_lib.deployment.tests.AbsDeploymentTest.fillQName Element  element,
Method  method,
boolean  random
throws Exception [protected]
 

Set the QName attribute of the given element

Parameters:
element element on which we have to set the string
method method of the element (determine type of the sub element
random use random or not
Exceptions:
Exception if the QName can not be set

Definition at line 290 of file AbsDeploymentTest.java.

void org.objectweb.jonas_lib.deployment.tests.AbsDeploymentTest.fillString Element  element,
Method  method,
boolean  random
throws Exception [protected]
 

Set the string attribute of the given element

Parameters:
element element on which we have to set the string
method method of the element (determine type of the sub element
random use random or not
Exceptions:
Exception if the String attribute can not be added

Definition at line 276 of file AbsDeploymentTest.java.

String org.objectweb.jonas_lib.deployment.tests.AbsDeploymentTest.getNameCounterForElement Element  element,
Method  method
[protected]
 

Gives a Name + counter for a type of an element This is used to add counter when adding xml attributes Only use in order to make easier the read of the parsed XML file

Parameters:
element the given element for which we want a counter
method the name of the string to add
Returns:
the Name + counter for the specified element type

Definition at line 306 of file AbsDeploymentTest.java.

int org.objectweb.jonas_lib.deployment.tests.AbsDeploymentTest.nbAleat  )  [protected]
 

Gives a number between 0 and 5

Returns:
a random intger number between 0 and 5

Definition at line 206 of file AbsDeploymentTest.java.

void org.objectweb.jonas_lib.deployment.tests.AbsDeploymentTest.parseElement  )  throws Exception
 

Gets the xml after digester parsing

Exceptions:
Exception if the parsing fail

Definition at line 100 of file AbsDeploymentTest.java.

References org.objectweb.jonas_lib.deployment.xml.AbsElement.toXML().

Here is the call graph for this function:

void org.objectweb.jonas_lib.deployment.tests.AbsDeploymentTest.parseXmlfromFile String  fileName  )  throws Exception
 

parse with validation from an xml file

Exceptions:
Exception if the parsing fail

Definition at line 115 of file AbsDeploymentTest.java.

void org.objectweb.jonas_lib.deployment.tests.AbsDeploymentTest.setElement Element  element,
Method  method,
Class[]  argsMethod,
boolean  random
throws Exception [protected]
 

Set the subelement of an element The subelement may not be set if random is used

Parameters:
element element on which we have to add sub elements
method method of the element (determine type of the sub element
argsMethod arguments of the method
random use random or not
Exceptions:
Exception if the subelement can not be set

Definition at line 238 of file AbsDeploymentTest.java.

void org.objectweb.jonas_lib.deployment.tests.AbsDeploymentTest.startTest boolean  random  )  throws Exception
 

Defines the function for the specific test

Parameters:
random use random or not to fill elements
Exceptions:
Exception if the test failed

Definition at line 87 of file AbsDeploymentTest.java.

References org.objectweb.jonas_lib.deployment.xml.AbsElement.toXML().

Here is the call graph for this function:

void org.objectweb.jonas_lib.deployment.tests.AbsDeploymentTest.stress  )  throws Exception
 

Create an xml structure and then parse the resulting xml and check the result No validation is done if random is set to true

Exceptions:
Exception if the stress test is not successfull

Definition at line 67 of file AbsDeploymentTest.java.


The documentation for this class was generated from the following file:
Generated on Tue Feb 15 15:12:25 2005 for JOnAS by  doxygen 1.3.9.1