Clover coverage report - JBind Project
Coverage timestamp: Fr Mai 28 2004 11:17:36 CEST
file stats: LOC: 56   Methods: 4
NCLOC: 34   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
InstanceTest.java - 90,9% 75% 86,7%
 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 org.jbind.xml.core.data.IAnyTypeData;
 16   
 import org.jbind.xml.core.data.IDataContext;
 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 InstanceTest extends XmlTest {
 23   
 
 24   
   private File myScenarioDir = null;
 25   
   private InstanceTestInfo myInfo = null;
 26   
 
 27  31
   public InstanceTest(String aScenarioName, File aScenarioDir, InstanceTestInfo anInfo) {
 28  31
     super(aScenarioName + "/" + anInfo.fileName, aScenarioName, aScenarioDir, anInfo);
 29   
     assert null != anInfo.fileName;
 30  31
     myScenarioDir = aScenarioDir;
 31  31
     myInfo = anInfo;
 32   
   }
 33   
 
 34  31
   public void runTest() throws Exception {
 35  31
     IConstraintViolations violations = XmlMessages.constraintViolations();
 36   
 
 37  31
     URL instanceUrl = new File(myScenarioDir, myInfo.fileName).toURL();
 38   
 
 39  31
     try {
 40  31
       IAnyTypeData rootData = JBindFacade.unmarshal(instanceUrl, null);
 41  21
       doCheckInstance(rootData, violations);
 42   
     } catch (XmlException e) {
 43  10
       violations.add(e.getXmlMessage());
 44   
     }
 45   
 
 46  31
     checkErrorMessages(violations);
 47   
 
 48   
   }
 49   
 
 50  11
   protected void doCheckInstance(IAnyTypeData aData, IConstraintViolations aViolations) {}
 51   
 
 52  0
   protected IDataContext doGetDataContext() {
 53  0
     return null;
 54   
   }
 55   
 }
 56