|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.objectweb.jonas_lib.deployment.tests.AbsDeploymentTest
public abstract class AbsDeploymentTest
Defines an abstract class for testing the classes built with Digester
Constructor Summary | |
---|---|
protected |
AbsDeploymentTest()
Build a new Test |
Method Summary | |
---|---|
protected void |
addElement(Element element,
java.lang.reflect.Method method,
java.lang.Class[] argsMethod,
boolean random)
Add to an element its sub element Add many times a sub-element if random is not set to true |
protected boolean |
aleatOK()
Random for returning true or false |
protected void |
checkDiff(java.lang.String xmlOriginal,
java.lang.String xmlParsed)
Check the difference between original xml and parsed xml |
protected java.lang.String |
convertUpperCaseToXml(java.lang.String name)
Convert the name of an element into its xml string representation example : WebApp --> web-app |
void |
fill(Element element,
boolean random)
Fill the structure of the given element. |
protected void |
fillQName(Element element,
java.lang.reflect.Method method,
boolean random)
Set the QName attribute of the given element |
protected void |
fillString(Element element,
java.lang.reflect.Method method,
boolean random)
Set the string attribute of the given element |
protected java.lang.String |
getNameCounterForElement(Element element,
java.lang.reflect.Method method)
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 |
abstract AbsElement |
getTopLevelElement()
|
protected int |
nbAleat()
Gives a number between 0 and 5 |
abstract java.lang.String |
parse(java.io.Reader reader,
java.lang.String name,
boolean validation)
|
void |
parseElement()
Gets the xml after digester parsing |
void |
parseXmlfromFile(java.lang.String fileName)
parse with validation from an xml file |
protected void |
setElement(Element element,
java.lang.reflect.Method method,
java.lang.Class[] argsMethod,
boolean random)
Set the subelement of an element The subelement may not be set if random is used |
void |
startTest(boolean random)
Defines the function for the specific test |
void |
stress()
Create an xml structure and then parse the resulting xml and check the result No validation is done if random is set to true |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected AbsDeploymentTest()
Method Detail |
---|
public void stress() throws java.lang.Exception
java.lang.Exception
- if the stress test is not successfullpublic abstract AbsElement getTopLevelElement() throws java.lang.Exception
java.lang.Exception
public abstract java.lang.String parse(java.io.Reader reader, java.lang.String name, boolean validation) throws java.lang.Exception
java.lang.Exception
public void startTest(boolean random) throws java.lang.Exception
random
- use random or not to fill elements
java.lang.Exception
- if the test failedpublic void parseElement() throws java.lang.Exception
java.lang.Exception
- if the parsing failpublic void parseXmlfromFile(java.lang.String fileName) throws java.lang.Exception
java.lang.Exception
- if the parsing failprotected void checkDiff(java.lang.String xmlOriginal, java.lang.String xmlParsed) throws java.lang.Exception
xmlOriginal
- original XMLxmlParsed
- parsed XML
java.lang.Exception
- if there is a difference between original and parsed
XMLpublic void fill(Element element, boolean random) throws java.lang.Exception
element
- element to fillrandom
- determines if the element must be filled randomly or not
java.lang.Exception
- if the element can not be filledprotected boolean aleatOK()
protected int nbAleat()
protected void addElement(Element element, java.lang.reflect.Method method, java.lang.Class[] argsMethod, boolean random) throws java.lang.Exception
element
- element on which we have to add sub elementsmethod
- method of the element (determine type of the sub elementargsMethod
- arguments of the methodrandom
- use random or not
java.lang.Exception
- if the subelement can not be addedprotected void setElement(Element element, java.lang.reflect.Method method, java.lang.Class[] argsMethod, boolean random) throws java.lang.Exception
element
- element on which we have to add sub elementsmethod
- method of the element (determine type of the sub elementargsMethod
- arguments of the methodrandom
- use random or not
java.lang.Exception
- if the subelement can not be setprotected void fillString(Element element, java.lang.reflect.Method method, boolean random) throws java.lang.Exception
element
- element on which we have to set the stringmethod
- method of the element (determine type of the sub elementrandom
- use random or not
java.lang.Exception
- if the String attribute can not be addedprotected void fillQName(Element element, java.lang.reflect.Method method, boolean random) throws java.lang.Exception
element
- element on which we have to set the stringmethod
- method of the element (determine type of the sub elementrandom
- use random or not
java.lang.Exception
- if the QName can not be setprotected java.lang.String getNameCounterForElement(Element element, java.lang.reflect.Method method)
element
- the given element for which we want a countermethod
- the name of the string to add
protected java.lang.String convertUpperCaseToXml(java.lang.String name)
name
- the name of the element to convert
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |