|
|||||||||||||||||||
Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
AWTEventQueueTagHandlerT.java | - | 100% | 100% | 100% |
|
1 |
package junit.extensions.jfcunit.xml;
|
|
2 |
|
|
3 |
import org.w3c.dom.Element;
|
|
4 |
import junit.extensions.xml.XMLException;
|
|
5 |
import junit.extensions.xml.XMLTagResourceBundle;
|
|
6 |
import junit.extensions.xml.elements.ElementFixture;
|
|
7 |
import junit.framework.TestCase;
|
|
8 |
import junit.framework.TestResult;
|
|
9 |
|
|
10 |
/**
|
|
11 |
* <p>Title: Test AWTEventQueueTagHandler</p>
|
|
12 |
* <p>Description: Test the tag handler for the AWTEventQueue.</p>
|
|
13 |
* <p>Copyright: Copyright (c) 2003</p>
|
|
14 |
* <p>Company: </p>
|
|
15 |
* @author Kevin Wilson not attributable
|
|
16 |
* @version 1.0
|
|
17 |
*/
|
|
18 |
|
|
19 |
public class AWTEventQueueTagHandlerT |
|
20 |
extends TestCase {
|
|
21 |
|
|
22 |
/**
|
|
23 |
* Tag handler to be tested.
|
|
24 |
*/
|
|
25 |
private AWTEventQueueTagHandler m_tagHandler = null; |
|
26 |
/**
|
|
27 |
* Test fixture which generates elements.
|
|
28 |
*/
|
|
29 |
private ElementFixture m_fixture;
|
|
30 |
|
|
31 |
/**
|
|
32 |
* Setup the test.
|
|
33 |
* @throws Exception may be thrown.
|
|
34 |
*/
|
|
35 | 2 |
protected void setUp() throws Exception { |
36 | 2 |
super.setUp();
|
37 | 2 |
m_fixture = new ElementFixture(this); |
38 | 2 |
m_fixture.setUp(); |
39 |
} |
|
40 |
|
|
41 |
/**
|
|
42 |
* Tear down the test case.
|
|
43 |
* @throws Exception may be thrown.
|
|
44 |
*/
|
|
45 | 2 |
protected void tearDown() throws Exception { |
46 | 2 |
m_tagHandler = null;
|
47 | 2 |
m_fixture.tearDown(); |
48 | 2 |
m_fixture = null;
|
49 | 2 |
super.tearDown();
|
50 |
} |
|
51 |
|
|
52 |
/**
|
|
53 |
* Test the lookup of awteventqueue tag.
|
|
54 |
*/
|
|
55 | 1 |
public void testLookup() { |
56 | 1 |
JFCXMLTestCase tc = m_fixture.getJFCTestCase(); |
57 | 1 |
Element e = m_fixture.newElement("awteventqueue",
|
58 |
new String[] {
|
|
59 |
"action", "pause" |
|
60 |
}); |
|
61 |
|
|
62 | 1 |
Object o = XMLTagResourceBundle.getTagHandler(e, tc, "awteventqueue");
|
63 | 1 |
assertNotNull("Lookup failed", o);
|
64 |
} |
|
65 |
|
|
66 |
/**
|
|
67 |
* Test the process element.
|
|
68 |
* @throws XMLException may be thrown.
|
|
69 |
*/
|
|
70 | 1 |
public void testProcessElement() throws XMLException { |
71 | 1 |
JFCXMLTestCase testc = m_fixture.getJFCTestCase(); |
72 |
|
|
73 | 1 |
Element e = m_fixture.newElement("awteventqueue",
|
74 |
new String[] {
|
|
75 |
"action", "pause" |
|
76 |
}); |
|
77 | 1 |
e = m_fixture.newElement("awteventqueue",
|
78 |
new String[] {
|
|
79 |
"action", "resume" |
|
80 |
}); |
|
81 | 1 |
e = m_fixture.newElement("awteventqueue",
|
82 |
new String[] {
|
|
83 |
"action", "flush" |
|
84 |
}); |
|
85 |
|
|
86 | 1 |
TestResult result = testc.run(); |
87 | 1 |
assertEquals("Errors:", 0, result.errorCount());
|
88 | 1 |
assertEquals("Failures:", 0, result.failureCount());
|
89 |
} |
|
90 |
|
|
91 |
} |
|
92 |
|
|