|
|||||||||||||||||||
| Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
| NoOpTagHandlerT.java | - | 100% | 100% | 100% |
|
||||||||||||||
| 1 |
package junit.extensions.xml.elements;
|
|
| 2 |
|
|
| 3 |
import org.w3c.dom.Element;
|
|
| 4 |
import junit.extensions.xml.IXMLTestCase;
|
|
| 5 |
import junit.framework.TestCase;
|
|
| 6 |
import junit.extensions.xml.XMLTagResourceBundle;
|
|
| 7 |
|
|
| 8 |
/**
|
|
| 9 |
* <p>Title: Test the noop tag handler.</p>
|
|
| 10 |
* <p>Description: </p>
|
|
| 11 |
* <p>Copyright: Copyright (c) 2003</p>
|
|
| 12 |
* <p>Company: </p>
|
|
| 13 |
* @author Kevin Wilson not attributable
|
|
| 14 |
* @version 1.0
|
|
| 15 |
*/
|
|
| 16 |
public class NoOpTagHandlerT extends TestCase { |
|
| 17 |
/**
|
|
| 18 |
* Noop tag handler.
|
|
| 19 |
*/
|
|
| 20 |
private NoOpTagHandler m_noOpTagHandler = null; |
|
| 21 |
/**
|
|
| 22 |
* element fixture.
|
|
| 23 |
*/
|
|
| 24 |
private ElementFixture m_elementFixture;
|
|
| 25 |
|
|
| 26 |
/**
|
|
| 27 |
* Set up the test.
|
|
| 28 |
* @throws Exception may be thrown.
|
|
| 29 |
*/
|
|
| 30 | 2 |
protected void setUp() throws Exception { |
| 31 | 2 |
super.setUp();
|
| 32 | 2 |
m_elementFixture = new ElementFixture(this); |
| 33 |
|
|
| 34 | 2 |
m_elementFixture.setUp(); |
| 35 |
} |
|
| 36 |
|
|
| 37 |
/**
|
|
| 38 |
* Tear down the test.
|
|
| 39 |
* @throws Exception may be thrown.
|
|
| 40 |
*/
|
|
| 41 | 2 |
protected void tearDown() throws Exception { |
| 42 | 2 |
m_noOpTagHandler = null;
|
| 43 | 2 |
m_elementFixture.tearDown(); |
| 44 |
|
|
| 45 | 2 |
m_elementFixture = null;
|
| 46 | 2 |
super.tearDown();
|
| 47 |
} |
|
| 48 |
|
|
| 49 |
/**
|
|
| 50 |
* Test the noop.
|
|
| 51 |
*/
|
|
| 52 | 1 |
public void testNoOpTagHandler() { |
| 53 | 1 |
Element element = m_elementFixture.newElement("noop", new String[] { |
| 54 |
}); |
|
| 55 |
|
|
| 56 | 1 |
IXMLTestCase testcase = m_elementFixture.getTestCase(); |
| 57 | 1 |
m_noOpTagHandler = new NoOpTagHandler(element, testcase);
|
| 58 | 1 |
m_noOpTagHandler.processElement(); |
| 59 |
} |
|
| 60 |
|
|
| 61 |
/**
|
|
| 62 |
* Test with the Tag lookup.
|
|
| 63 |
*/
|
|
| 64 | 1 |
public void testLookup() { |
| 65 | 1 |
Element element = m_elementFixture.newElement("noop", new String[] { |
| 66 |
}); |
|
| 67 |
|
|
| 68 | 1 |
IXMLTestCase testcase = m_elementFixture.getTestCase(); |
| 69 | 1 |
Object o = XMLTagResourceBundle.getTagHandler(element, testcase, "noop");
|
| 70 | 1 |
assertNotNull(o); |
| 71 |
} |
|
| 72 |
|
|
| 73 |
} |
|
| 74 |
|
|
||||||||||