|
|||||||||||||||||||
| Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
| XMLProcedure.java | - | 100% | 100% | 100% |
|
||||||||||||||
| 1 |
package junit.extensions.xml;
|
|
| 2 |
|
|
| 3 |
import junit.framework.Assert;
|
|
| 4 |
|
|
| 5 |
import org.w3c.dom.Element;
|
|
| 6 |
|
|
| 7 |
|
|
| 8 |
/**
|
|
| 9 |
* XMLProcedure Interface for containing the procedure.
|
|
| 10 |
*
|
|
| 11 |
* @author Kevin Wilson
|
|
| 12 |
*/
|
|
| 13 |
public class XMLProcedure implements IXMLProcedure, XMLConstants { |
|
| 14 |
/**
|
|
| 15 |
* Element of the procedure definition.
|
|
| 16 |
*/
|
|
| 17 |
private Element m_element;
|
|
| 18 |
|
|
| 19 |
/**
|
|
| 20 |
* Constructor.
|
|
| 21 |
* @param e Element must be a procedure definition.
|
|
| 22 |
*/
|
|
| 23 | 7 |
public XMLProcedure(final Element e) {
|
| 24 | 7 |
m_element = e; |
| 25 | 7 |
Assert.assertNotNull( |
| 26 |
"Procedure name not specified",
|
|
| 27 |
getName()); |
|
| 28 |
} |
|
| 29 |
|
|
| 30 |
/**
|
|
| 31 |
* Get the Element containing the procedure.
|
|
| 32 |
* @return Element containting the procedure.
|
|
| 33 |
*/
|
|
| 34 | 3 |
public Element getElement() {
|
| 35 | 3 |
return m_element;
|
| 36 |
} |
|
| 37 |
|
|
| 38 |
/**
|
|
| 39 |
* Get the name for the test case.
|
|
| 40 |
* @return name of the test case.
|
|
| 41 |
*/
|
|
| 42 | 14 |
public String getName() {
|
| 43 | 14 |
return XMLUtil.getAttribute(m_element, NAME);
|
| 44 |
} |
|
| 45 |
} |
|
| 46 |
|
|
||||||||||