Clover coverage report - JBind Project
Coverage timestamp: Fr Mai 28 2004 11:17:36 CEST
file stats: LOC: 49   Methods: 2
NCLOC: 27   Classes: 1
This license of Clover is provided to support the development of JBind only. Please visit http://www.thecortex.net/clover to obtain a licensed version of Clover.
 
 Source file Conditionals Statements Methods TOTAL
SimpleInstanceTest.java - 100% 100% 100%
 1   
 /*
 2   
  * JBind
 3   
  *
 4   
  * Copyright (c) by Stefan Wachter. All rights reserved.
 5   
  *
 6   
  * Usage, modification, and redistribution is subject to license terms that are
 7   
  * available at 'http://www.jbind.org'. The JBind license is like the
 8   
  * 'Apache Software License V 1.1'.
 9   
  */
 10   
 package org.jbind.xml.test;
 11   
 
 12   
 import java.io.File;
 13   
 import java.net.URL;
 14   
 
 15   
 import junit.framework.TestCase;
 16   
 
 17   
 import org.jbind.xml.facade.JBindFacade;
 18   
 import org.jbind.xml.msg.IConstraintViolations;
 19   
 import org.jbind.xml.msg.XmlException;
 20   
 import org.jbind.xml.msg.XmlMessages;
 21   
 
 22   
 public class SimpleInstanceTest extends TestCase {
 23   
 
 24   
   private File myFile = null;
 25   
   private boolean myMustBeValid;
 26   
 
 27  184
   public SimpleInstanceTest(File aFile, boolean aMustBeValid) {
 28  184
     super(aFile.toString());
 29  184
     myFile = aFile;
 30  184
     myMustBeValid = aMustBeValid;
 31   
   }
 32   
 
 33  184
   public void runTest() throws Exception {
 34   
 //              System.out.println("-->InstanceTest: " + myFile);
 35  184
     IConstraintViolations violations = XmlMessages.constraintViolations();
 36   
 
 37  184
     URL instanceUrl = myFile.toURL();
 38   
 
 39  184
     try {
 40  184
       JBindFacade.unmarshal(instanceUrl, null);
 41  48
       assertTrue("missed invalid instance", myMustBeValid);
 42   
     } catch (XmlException e) {
 43  136
       assertTrue(e.getXmlMessage().toString(), !myMustBeValid);
 44   
     }
 45   
 //              System.out.println("<--InstanceTest: " + myFile);
 46   
   }
 47   
 
 48   
 }
 49