Coverage Report - net.sourceforge.combean.test.graph.generic.AbstractTestGraph
 
Classes in this File Line Coverage Branch Coverage Complexity
AbstractTestGraph
100%
8/8
N/A
1
 
 1  
 /*
 2  
     This file is part of Combean.
 3  
 
 4  
     Combean is free software; you can redistribute it and/or modify
 5  
     it under the terms of the GNU General Public License as published by
 6  
     the Free Software Foundation; either version 2 of the License, or
 7  
     (at your option) any later version.
 8  
 
 9  
     Combean is distributed in the hope that it will be useful,
 10  
     but WITHOUT ANY WARRANTY; without even the implied warranty of
 11  
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 12  
     GNU General Public License for more details.
 13  
 
 14  
     You should have received a copy of the GNU General Public License
 15  
     along with Combean; if not, write to the Free Software
 16  
     Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 17  
 */
 18  
 /*
 19  
  * Created on 19.03.2005
 20  
  *
 21  
  */
 22  
 package net.sourceforge.combean.test.graph.generic;
 23  
 
 24  
 import net.sourceforge.combean.graph.prop.statics.GraphPropertyInitializer;
 25  
 import net.sourceforge.combean.interfaces.graph.Graph;
 26  
 import net.sourceforge.combean.interfaces.graph.prop.GlobalNodesGraphProp;
 27  
 import junit.framework.TestCase;
 28  
 
 29  
 /**
 30  
  * @author schickin
 31  
  *
 32  
  */
 33  
 public abstract class AbstractTestGraph extends TestCase {
 34  
 
 35  
     /*
 36  
      * @see TestCase#setUp()
 37  
      */
 38  
     protected void setUp() throws Exception {
 39  111
         super.setUp();
 40  
         
 41  111
         GraphPropertyInitializer.setGraphProperties(this, getGraph());
 42  111
     }
 43  
 
 44  
     /*
 45  
      * @see TestCase#tearDown()
 46  
      */
 47  
     protected void tearDown() throws Exception {
 48  111
         super.tearDown();
 49  111
     }
 50  
 
 51  
     /**
 52  
      * Constructor for AbstractTestGraph.
 53  
      * @param name
 54  
      */
 55  
     public AbstractTestGraph(String name) {
 56  111
         super(name);
 57  111
     }
 58  
 
 59  
     /**
 60  
      * Template method for accessing the size of clique to test.
 61  
      * Default implementation assumes that graph has GlobalNodesGraphProp
 62  
      * 
 63  
      * @return the size of the clique to test.
 64  
      */
 65  
     protected int getGraphSize() {
 66  66
         return ((GlobalNodesGraphProp) getGraph()).getNumNodes();
 67  
     }
 68  
 
 69  
     /**
 70  
      * Template method for accessing the size of clique to test.
 71  
      * 
 72  
      * @return the size of the clique to test.
 73  
      */
 74  
     protected abstract Graph getGraph();
 75  
 
 76  
 }