|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.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,
Method method,
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(String xmlOriginal,
String xmlParsed)
Check the difference between original xml and parsed xml |
protected String |
convertUpperCaseToXml(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,
Method method,
boolean random)
Set the QName attribute of the given element |
protected void |
fillString(Element element,
Method method,
boolean random)
Set the string attribute of the given element |
protected String |
getNameCounterForElement(Element element,
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 String |
parse(Reader reader,
String name,
boolean validation)
|
void |
parseElement()
Gets the xml after digester parsing |
void |
parseXmlfromFile(String fileName)
parse with validation from an xml file |
protected void |
setElement(Element element,
Method method,
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 Exception
Exception
- if the stress test is not successfullpublic abstract AbsElement getTopLevelElement() throws Exception
Exception
public abstract String parse(Reader reader, String name, boolean validation) throws Exception
Exception
public void startTest(boolean random) throws Exception
random
- use random or not to fill elements
Exception
- if the test failedpublic void parseElement() throws Exception
Exception
- if the parsing failpublic void parseXmlfromFile(String fileName) throws Exception
Exception
- if the parsing failprotected void checkDiff(String xmlOriginal, String xmlParsed) throws Exception
xmlOriginal
- original XMLxmlParsed
- parsed XML
Exception
- if there is a difference between original and parsed
XMLpublic void fill(Element element, boolean random) throws Exception
element
- element to fillrandom
- determines if the element must be filled randomly or not
Exception
- if the element can not be filledprotected boolean aleatOK()
protected int nbAleat()
protected void addElement(Element element, Method method, Class[] argsMethod, boolean random) throws 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
Exception
- if the subelement can not be addedprotected void setElement(Element element, Method method, Class[] argsMethod, boolean random) throws 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
Exception
- if the subelement can not be setprotected void fillString(Element element, Method method, boolean random) throws 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
Exception
- if the String attribute can not be addedprotected void fillQName(Element element, Method method, boolean random) throws 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
Exception
- if the QName can not be setprotected String getNameCounterForElement(Element element, Method method)
element
- the given element for which we want a countermethod
- the name of the string to add
protected String convertUpperCaseToXml(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 |