Clover coverage report - QedeqKernelSe Coverage Report
Coverage timestamp: Do Dez 29 2005 18:38:29 CET
file stats: LOC: 73   Methods: 2
NCLOC: 33   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
Context2SimpleXPath.java 50% 46,2% 50% 47,4%
coverage coverage
 1    /* $Id: Context2SimpleXPath.java,v 1.2 2005/09/20 18:54:24 m31 Exp $
 2    *
 3    * This file is part of the project "Hilbert II" - http://www.qedeq.org
 4    *
 5    * Copyright 2000-2005, Michael Meyling <mime@qedeq.org>.
 6    *
 7    * "Hilbert II" is free software; you can redistribute
 8    * it and/or modify it under the terms of the GNU General Public
 9    * License as published by the Free Software Foundation; either
 10    * version 2 of the License, or (at your option) any later version.
 11    *
 12    * This program is distributed in the hope that it will be useful,
 13    * but WITHOUT ANY WARRANTY; without even the implied warranty of
 14    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 15    * GNU General Public License for more details.
 16    */
 17   
 18    package org.qedeq.kernel.xml.mapper;
 19   
 20    import java.io.IOException;
 21   
 22    import javax.xml.parsers.ParserConfigurationException;
 23   
 24    import org.qedeq.kernel.bo.control.Context;
 25    import org.qedeq.kernel.xml.tracker.SimpleXPath;
 26    import org.qedeq.kernel.xml.tracker.XPathLocationFinder;
 27    import org.xml.sax.SAXException;
 28   
 29    /**
 30    * Parses complete qedeq modules.
 31    *
 32    * @version $Revision: 1.2 $
 33    * @author Michael Meyling
 34    */
 35    public final class Context2SimpleXPath {
 36   
 37    /**
 38    * Constructor.
 39    */
 40  0 private Context2SimpleXPath() {
 41    // nothing to do
 42    }
 43   
 44    /**
 45    * Transform context information into XML specific location information.
 46    *
 47    * @param context Abstract context description.
 48    * @return Information where the context could be found.
 49    */
 50  2 public static final SimpleXPath getXPath(final Context context) {
 51  2 String xpath = Context2XPath.getXPath(context);
 52  2 try {
 53  2 final SimpleXPath find = XPathLocationFinder.getXPathLocation(
 54    context.getModuleLocation(), xpath);
 55  2 if (find.getStartLocation() == null) {
 56  0 System.out.println(context);
 57  0 throw new RuntimeException("start not found: " + find);
 58    }
 59  2 if (find.getEndLocation() == null) {
 60  0 System.out.println(context);
 61  0 throw new RuntimeException("end not found: " + find);
 62    }
 63  2 return find;
 64    } catch (ParserConfigurationException e) {
 65  0 throw new RuntimeException(e);
 66    } catch (SAXException e) {
 67  0 throw new RuntimeException(e);
 68    } catch (IOException e) {
 69  0 throw new RuntimeException(e);
 70    }
 71    }
 72   
 73    }