Clover coverage report - JFCUnit Test Coverage
Coverage timestamp: Mon Dec 20 2004 23:38:10 MST
file stats: LOC: 110   Methods: 5
NCLOC: 65   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
AssertNotSameTagHandlerT.java - 100% 100% 100%
coverage
 1   
 package junit.extensions.xml.elements;
 2   
 
 3   
 import java.awt.Point;
 4   
 
 5   
 import org.w3c.dom.Element;
 6   
 import junit.extensions.xml.IXMLTestCase;
 7   
 import junit.extensions.xml.XMLException;
 8   
 import junit.framework.AssertionFailedError;
 9   
 import junit.framework.TestCase;
 10   
 import junit.extensions.xml.XMLTagResourceBundle;
 11   
 
 12   
 /**
 13   
  * <p>Title: Test AssertNotSameTagHandler.</p>
 14   
  * <p>Copyright: Copyright (c) 2003</p>
 15   
  * <p>Company: JFCUnit OpenSource Project</p>
 16   
  * @author Kevin Wilson
 17   
  * @version 1.0
 18   
  */
 19   
 
 20   
 public class AssertNotSameTagHandlerT
 21   
     extends TestCase {
 22   
   /**
 23   
    * Test tag handler.
 24   
    */
 25   
   private AssertNotSameTagHandler m_tagHandler = null;
 26   
 
 27   
   /**
 28   
    * Test fixture.
 29   
    */
 30   
   private ElementFixture m_fixture;
 31   
 
 32   
   /**
 33   
    * Setup the test.
 34   
    * @throws Exception may be thrown.
 35   
    */
 36  3
   protected void setUp() throws Exception {
 37  3
     super.setUp();
 38  3
     m_fixture = new ElementFixture(this);
 39  3
     m_fixture.setUp();
 40   
   }
 41   
 
 42   
   /**
 43   
    * Tear down the test.
 44   
    * @throws Exception may be thrown.
 45   
    */
 46  3
   protected void tearDown() throws Exception {
 47  3
     m_tagHandler = null;
 48  3
     m_fixture.tearDown();
 49  3
     m_fixture = null;
 50  3
     super.tearDown();
 51   
   }
 52   
 
 53   
   /**
 54   
    * Different objects.
 55   
    * @throws XMLException may be thrown.
 56   
    */
 57  1
   public void testProcessElement() throws XMLException {
 58  1
     IXMLTestCase tc = m_fixture.getTestCase();
 59  1
     Element e = m_fixture.newElement("assertnotsame", new String[] {
 60   
                                      "message", "TEST",
 61   
                                      "actualrefid", "data1",
 62   
                                      "expectedrefid", "data2"
 63   
     });
 64  1
     Point p1 = new Point(0, 0);
 65  1
     Point p2 = new Point(0, 0);
 66  1
     tc.addProperty("data1", p1);
 67  1
     tc.addProperty("data2", p2);
 68  1
     m_tagHandler = new AssertNotSameTagHandler(e, tc);
 69  1
     m_tagHandler.processElement();
 70   
   }
 71   
 
 72   
   /**
 73   
    * Same objects.
 74   
    * @throws XMLException may be thrown.
 75   
    */
 76  1
   public void testProcessElement2() throws XMLException {
 77  1
     IXMLTestCase tc = m_fixture.getTestCase();
 78  1
     Element e = m_fixture.newElement("assertnotsame", new String[] {
 79   
                                      "message", "TEST",
 80   
                                      "actualrefid", "data1",
 81   
                                      "expectedrefid", "data2"
 82   
     });
 83  1
     Point p1 = new Point(0, 0);
 84  1
     tc.addProperty("data1", p1);
 85  1
     tc.addProperty("data2", p1);
 86  1
     m_tagHandler = new AssertNotSameTagHandler(e, tc);
 87   
 
 88  1
     AssertionFailedError err = null;
 89  1
     try {
 90  1
       m_tagHandler.processElement();
 91   
     } catch (AssertionFailedError afe) {
 92  1
       err = afe;
 93   
     }
 94  1
     assertNotNull("Exception not thrown.", err);
 95   
   }
 96   
 
 97   
   /**
 98   
    * Test the Lookup.
 99   
    */
 100  1
   public void testLookup() {
 101  1
     Element element = m_fixture.newElement("assertnotsame", new String[] {
 102   
                                            "actualrefid", "data1",
 103   
                                            "expectedrefid", "data2"});
 104  1
     IXMLTestCase testCase = m_fixture.getTestCase();
 105  1
     Object o = XMLTagResourceBundle.getTagHandler(element, testCase, "assertnotsame");
 106  1
     assertNotNull(o);
 107   
   }
 108   
 
 109   
 }
 110