|
|||||||||||||||||||
Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
SaveTagHandlerT.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.extensions.xml.XMLException;
|
|
6 |
import junit.framework.TestCase;
|
|
7 |
import junit.extensions.xml.XMLTagResourceBundle;
|
|
8 |
|
|
9 |
/**
|
|
10 |
* <p>Title: Test the save tag handler.</p>
|
|
11 |
* <p>Copyright: Copyright (c) 2003</p>
|
|
12 |
* <p>Company: JFCUnit OpenSource Project</p>
|
|
13 |
* @author Kevin Wilson
|
|
14 |
* @version 1.0
|
|
15 |
*/
|
|
16 |
public class SaveTagHandlerT |
|
17 |
extends TestCase {
|
|
18 |
/**
|
|
19 |
* Test tag handler.
|
|
20 |
*/
|
|
21 |
private SaveTagHandler m_tagHandler = null; |
|
22 |
|
|
23 |
/**
|
|
24 |
* Test fixture.
|
|
25 |
*/
|
|
26 |
private ElementFixture m_fixture;
|
|
27 |
|
|
28 |
/**
|
|
29 |
* Setup the test.
|
|
30 |
* @throws Exception may be thrown.
|
|
31 |
*/
|
|
32 | 2 |
protected void setUp() throws Exception { |
33 | 2 |
super.setUp();
|
34 | 2 |
m_fixture = new ElementFixture(this); |
35 |
|
|
36 | 2 |
m_fixture.setUp(); |
37 |
} |
|
38 |
|
|
39 |
/**
|
|
40 |
* Tear down the test.
|
|
41 |
* @throws Exception may be thrown.
|
|
42 |
*/
|
|
43 | 2 |
protected void tearDown() throws Exception { |
44 | 2 |
m_tagHandler = null;
|
45 | 2 |
m_fixture.tearDown(); |
46 |
|
|
47 | 2 |
m_fixture = null;
|
48 | 2 |
super.tearDown();
|
49 |
} |
|
50 |
|
|
51 |
/**
|
|
52 |
* Test the save.
|
|
53 |
* @throws XMLException may be thrown.
|
|
54 |
*/
|
|
55 | 1 |
public void testProcessElement() throws XMLException { |
56 | 1 |
Element save = m_fixture.newElement("save", new String[] { |
57 |
"file", "save.xml" |
|
58 |
}); |
|
59 | 1 |
IXMLTestCase tc = m_fixture.getTestCase(); |
60 | 1 |
m_tagHandler = new SaveTagHandler(save, tc);
|
61 | 1 |
m_tagHandler.processElement(); |
62 |
} |
|
63 |
|
|
64 |
/**
|
|
65 |
* Test with the Tag lookup.
|
|
66 |
*/
|
|
67 | 1 |
public void testLookup() { |
68 | 1 |
Element save = m_fixture.newElement("save", new String[] { |
69 |
"file", "save.xml" |
|
70 |
}); |
|
71 | 1 |
IXMLTestCase tc = m_fixture.getTestCase(); |
72 | 1 |
Object o = XMLTagResourceBundle.getTagHandler(save, tc, "save");
|
73 | 1 |
assertNotNull(o); |
74 |
} |
|
75 |
} |
|
76 |
|
|