| 1 | 
   | 
 | 
 
| 2 | 
   | 
 | 
 
| 3 | 
   | 
 | 
 
| 4 | 
   | 
 | 
 
| 5 | 
   | 
 | 
 
| 6 | 
   | 
 | 
 
| 7 | 
   | 
 | 
 
| 8 | 
   | 
 | 
 
| 9 | 
   | 
 | 
 
| 10 | 
   | 
 | 
 
| 11 | 
   | 
 | 
 
| 12 | 
   | 
 | 
 
| 13 | 
   | 
 | 
 
| 14 | 
   | 
 | 
 
| 15 | 
   | 
 | 
 
| 16 | 
   | 
 | 
 
| 17 | 
   | 
 | 
 
| 18 | 
   | 
 | 
 
| 19 | 
   | 
 | 
 
| 20 | 
   | 
 | 
 
| 21 | 
   | 
 | 
 
| 22 | 
   | 
 | 
 
| 23 | 
   | 
 | 
 
| 24 | 
   | 
package io.codeclou.java.junit.xml.merger.model; | 
 
| 25 | 
   | 
 | 
 
| 26 | 
   | 
import io.codeclou.java.junit.xml.merger.GetterSetterValidator; | 
 
| 27 | 
   | 
import io.codeclou.java.junit.xml.merger.JunitXmlParser; | 
 
| 28 | 
   | 
import org.junit.Test; | 
 
| 29 | 
   | 
import org.w3c.dom.Document; | 
 
| 30 | 
   | 
 | 
 
| 31 | 
   | 
import static org.junit.Assert.assertEquals; | 
 
| 32 | 
   | 
 | 
|   | 
     | 
    
        
            
                 | 100% | 
                Uncovered Elements: 0 (16) | 
                Complexity: 2 | 
                Complexity Density: 0,14 | 
                             
         
     | 
| 33 | 
   | 
public class TestSuitesTest { | 
|   | 
     | 
    
        
            
                 | 100% | 
                Uncovered Elements: 0 (1) | 
                Complexity: 1 | 
                Complexity Density: 1 | 
                                          1PASS
   | 
                             
         
     | 
| 34 | 
 1 | 
     @Test... | 
 
| 35 | 
   | 
    public void testPojoGetterSetter() { | 
 
| 36 | 
 1 | 
        GetterSetterValidator.validateAccessors(TestSuites.class); | 
 
| 37 | 
   | 
    } | 
 
| 38 | 
   | 
 | 
|   | 
     | 
    
        
            
                 | 100% | 
                Uncovered Elements: 0 (13) | 
                Complexity: 1 | 
                Complexity Density: 0,08 | 
                                          1PASS
   | 
                             
         
     | 
| 39 | 
 1 | 
     @Test... | 
 
| 40 | 
   | 
    public void testToXml() throws Exception { | 
 
| 41 | 
 1 | 
        JunitXmlParser jxml = new JunitXmlParser(); | 
 
| 42 | 
 1 | 
        TestSuite suite1 = jxml.transform(XmlHelper.xmlFromString("<testsuite name='foo' time='4.20' errors='1' tests='3' failures='5' skipped='2'></testsuite>".replaceAll("'", "\""))); | 
 
| 43 | 
 1 | 
        TestSuite suite2 = jxml.transform(XmlHelper.xmlFromString("<testsuite name='bar' time='21.01' errors='2' tests='4' failures='3' skipped='6'></testsuite>".replaceAll("'", "\""))); | 
 
| 44 | 
 1 | 
        TestSuites suites = new TestSuites(); | 
 
| 45 | 
 1 | 
        suites.setName("foobar23"); | 
 
| 46 | 
 1 | 
        suites.getTestSuites().add(suite1); | 
 
| 47 | 
 1 | 
        suites.getTestSuites().add(suite2); | 
 
| 48 | 
 1 | 
        assertEquals(suites.getFailures(), new Long(8L)); | 
 
| 49 | 
 1 | 
        assertEquals(suites.getTests(), new Long(7L)); | 
 
| 50 | 
 1 | 
        assertEquals(suites.getName(), "foobar23"); | 
 
| 51 | 
 1 | 
        assertEquals(suites.getTime(), new Double(25.21)); | 
 
| 52 | 
   | 
 | 
 
| 53 | 
 1 | 
        Document d = suites.toXml(); | 
 
| 54 | 
 1 | 
        assertEquals(d.getFirstChild().getAttributes().getNamedItem("failures").getNodeValue(), "8"); | 
 
| 55 | 
   | 
    } | 
 
| 56 | 
   | 
} |