~brian-thomason/+junk/groovy-1.7.2

« back to all changes in this revision

Viewing changes to src/test/groovy/xml/SAXTest.groovy

  • Committer: Brian Thomason
  • Date: 2011-12-20 17:31:12 UTC
  • Revision ID: brian.thomason@canonical.com-20111220173112-u53pbzhiy5y1hau0
Initial import

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
package groovy.xml
 
2
 
 
3
/**
 
4
 * This test uses the concise syntax to test the generation
 
5
 * of SAX events using GroovyMarkup
 
6
 */
 
7
class SAXTest extends TestXmlSupport {
 
8
    
 
9
    void testSmallTree() {
 
10
        def b = createSAXBuilder()
 
11
        
 
12
        def root = b.root1(a:5, b:7) {
 
13
            elem1('hello1')
 
14
            elem2('hello2')
 
15
            elem3(x:7)
 
16
        }
 
17
    }
 
18
    
 
19
    void testTree() {
 
20
        def b = createSAXBuilder()
 
21
        
 
22
        def root = b.root2(a:5, b:7) {
 
23
            elem1('hello1')
 
24
            elem2('hello2')
 
25
            nestedElem(x:'abc', y:'def') {
 
26
                child(z:'def')
 
27
                child2()  
 
28
            }
 
29
            
 
30
            nestedElem2(z:'zzz') {
 
31
                child(z:'def')
 
32
                child2("hello")  
 
33
            }
 
34
        }
 
35
    }
 
36
}
 
 
b'\\ No newline at end of file'