Clover Coverage Report
Coverage timestamp: Fri May 24 2013 13:47:27 UTC
22   94   7   3.14
0   48   0.32   7
7     1  
1    
 
  XmlReaderExceptionTest       Line # 27 22 7 86.2% 0.86206895
 
  (3)
 
1    /* This file is part of the project "Hilbert II" - http://www.qedeq.org
2    *
3    * Copyright 2000-2013, Michael Meyling <mime@qedeq.org>.
4    *
5    * "Hilbert II" is free software; you can redistribute
6    * it and/or modify it under the terms of the GNU General Public
7    * License as published by the Free Software Foundation; either
8    * version 2 of the License, or (at your option) any later version.
9    *
10    * This program is distributed in the hope that it will be useful,
11    * but WITHOUT ANY WARRANTY; without even the implied warranty of
12    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13    * GNU General Public License for more details.
14    */
15    package com.sun.syndication.io;
16   
17    import java.io.IOException;
18    import java.io.InputStream;
19   
20    import org.qedeq.base.test.QedeqTestCase;
21   
22    /**
23    * Testing {@link XmlReaderException}.
24    *
25    * @author Michael Meyling
26    */
 
27    public class XmlReaderExceptionTest extends QedeqTestCase {
28   
29    /** Test instance 1. */
30    private XmlReaderException object1;
31    private InputStream in1;
32   
33    private XmlReaderException object2;
34   
 
35  3 toggle protected void setUp() throws Exception {
36  3 super.setUp();
37  3 in1 = new InputStream(){
 
38  0 toggle public int read() throws IOException {
39  0 return 0;
40    }
41    };
42  3 object1 = new XmlReaderException("XML reading failure", "UTF8", "UTF16", "UTF32", in1);
43  3 object2 = new XmlReaderException("XML reading failure", "mime", "ISO", "UTF8", "UTF16", "UTF32", in1);
44    }
45   
 
46  3 toggle protected void tearDown() throws Exception {
47  3 super.tearDown();
48    }
49   
50    /**
51    * Test creator.
52    *
53    * @throws Exception Something bad happened.
54    */
 
55  1 toggle public void testCreator() throws Exception {
56  1 new XmlReaderException("XML reading failure", "UTF8", "UTF16", "UTF32",
57    new InputStream(){
 
58  0 toggle public int read() throws IOException {
59  0 return 0;
60    }
61    });
62    }
63   
64    /**
65    * Test getter.
66    *
67    * @throws Exception Something bad happened.
68    */
 
69  1 toggle public void testGetter() throws Exception {
70  1 assertEquals("XML reading failure", object1.getMessage());
71  1 assertEquals("UTF8", object1.getBomEncoding());
72  1 assertEquals("UTF16", object1.getXmlGuessEncoding());
73  1 assertEquals("UTF32", object1.getXmlEncoding());
74  1 assertSame(in1, object1.getInputStream());
75  1 assertNull(object1.getContentTypeEncoding());
76  1 assertNull(object1.getContentTypeMime());
77    }
78   
79    /**
80    * Test getter.
81    *
82    * @throws Exception Something bad happened.
83    */
 
84  1 toggle public void testGetter2() throws Exception {
85  1 assertEquals("XML reading failure", object2.getMessage());
86  1 assertEquals("UTF8", object2.getBomEncoding());
87  1 assertEquals("UTF16", object2.getXmlGuessEncoding());
88  1 assertEquals("UTF32", object2.getXmlEncoding());
89  1 assertSame(in1, object2.getInputStream());
90  1 assertEquals("ISO", object2.getContentTypeEncoding());
91  1 assertEquals("mime", object2.getContentTypeMime());
92    }
93   
94    }