| java.lang.Object org.objectweb.jonas_lib.deployment.tests.AbsDeploymentTest
All known Subclasses: org.objectweb.jonas_client.deployment.tests.JonasClientDeploymentTest, org.objectweb.jonas_ejb.deployment.tests.JonasEJBDeploymentTest, org.objectweb.jonas_web.deployment.tests.WebDeploymentTest, org.objectweb.jonas_ws.deployment.tests.WsDeploymentTest, org.objectweb.jonas_domain.tests.DomainMapTest, org.objectweb.jonas_web.deployment.tests.JonasWebDeploymentTest, org.objectweb.jonas_clusterd.tests.ClusterDaemonConfigurationTest, org.objectweb.jonas_ejb.deployment.tests.EJBDeploymentTest, org.objectweb.jonas_client.deployment.tests.ClientDeploymentTest, org.objectweb.jonas_rar.deployment.tests.JonasRarDeploymentTest, org.objectweb.jonas_ws.deployment.tests.JonasWsDeploymentTest, org.objectweb.jonas_rar.deployment.tests.RarDeploymentTest, org.objectweb.jonas_ear.deployment.tests.EarDeploymentTest,
AbsDeploymentTest | abstract public class AbsDeploymentTest (Code) | | Defines an abstract class for testing the classes built with Digester
author: Florent Benoit |
Method Summary | |
protected void | addElement(Element element, Method method, Class[] argsMethod, boolean random) | protected boolean | aleatOK() | protected void | checkDiff(String xmlOriginal, String xmlParsed) | protected String | convertUpperCaseToXml(String name) | public void | fill(Element element, boolean random) Fill the structure of the given element. | protected void | fillQName(Element element, Method method, boolean random) | protected void | fillString(Element element, Method method, boolean random) | protected String | getNameCounterForElement(Element element, Method method) | abstract public AbsElement | getTopLevelElement() | protected int | nbAleat() | abstract public String | parse(Reader reader, String name, boolean validation) | public void | parseElement() | public void | parseXmlfromFile(String fileName) | protected void | setElement(Element element, Method method, Class[] argsMethod, boolean random) | public void | startTest(boolean random) | public void | stress() |
AbsDeploymentTest | protected AbsDeploymentTest()(Code) | | Build a new Test
|
addElement | protected void addElement(Element element, Method method, Class[] argsMethod, boolean random) throws Exception(Code) | | 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 Parameters: method - method of the element (determine type of the sub element Parameters: argsMethod - arguments of the method Parameters: random - use random or not throws: Exception - if the subelement can not be added |
aleatOK | protected boolean aleatOK()(Code) | | Random for returning true or false
true or false with random |
checkDiff | protected void checkDiff(String xmlOriginal, String xmlParsed) throws Exception(Code) | | Check the difference between original xml and parsed xml
Parameters: xmlOriginal - original XML Parameters: xmlParsed - parsed XML throws: Exception - if there is a difference between original and parsedXML |
convertUpperCaseToXml | protected String convertUpperCaseToXml(String name)(Code) | | Convert the name of an element into its xml string representation example :
WebApp --> web-app
Parameters: name - the name of the element to convert the xml string representation of an element |
fill | public void fill(Element element, boolean random) throws Exception(Code) | | Fill the structure of the given element. Fill randomly if random is set
to true
Parameters: element - element to fill Parameters: random - determines if the element must be filled randomly or not throws: Exception - if the element can not be filled |
fillQName | protected void fillQName(Element element, Method method, boolean random) throws Exception(Code) | | Set the QName attribute of the given element
Parameters: element - element on which we have to set the string Parameters: method - method of the element (determine type of the sub element Parameters: random - use random or not throws: Exception - if the QName can not be set |
fillString | protected void fillString(Element element, Method method, boolean random) throws Exception(Code) | | Set the string attribute of the given element
Parameters: element - element on which we have to set the string Parameters: method - method of the element (determine type of the sub element Parameters: random - use random or not throws: Exception - if the String attribute can not be added |
getNameCounterForElement | protected String getNameCounterForElement(Element element, Method method)(Code) | | 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 Parameters: method - the name of the string to add the Name + counter for the specified element type |
nbAleat | protected int nbAleat()(Code) | | Gives a number between 0 and 5
a random intger number between 0 and 5 |
parseElement | public void parseElement() throws Exception(Code) | | Gets the xml after digester parsing
throws: Exception - if the parsing fail |
parseXmlfromFile | public void parseXmlfromFile(String fileName) throws Exception(Code) | | parse with validation from an xml file
throws: Exception - if the parsing fail |
setElement | protected void setElement(Element element, Method method, Class[] argsMethod, boolean random) throws Exception(Code) | | 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 Parameters: method - method of the element (determine type of the sub element Parameters: argsMethod - arguments of the method Parameters: random - use random or not throws: Exception - if the subelement can not be set |
startTest | public void startTest(boolean random) throws Exception(Code) | | Defines the function for the specific test
Parameters: random - use random or not to fill elements throws: Exception - if the test failed |
stress | public void stress() throws Exception(Code) | | Create an xml structure and then parse the resulting xml and check the
result No validation is done if random is set to true
throws: Exception - if the stress test is not successfull |
|
|