Coverage Report - net.sourceforge.combean.test.graph.iterators.TestIndexedNodeIterator
 
Classes in this File Line Coverage Branch Coverage Complexity
TestIndexedNodeIterator
100%
17/17
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 24.02.2005
 20  
  *
 21  
  */
 22  
 package net.sourceforge.combean.test.graph.iterators;
 23  
 
 24  
 import junit.framework.TestCase;
 25  
 import net.sourceforge.combean.graph.iterators.IndexedNodeIterator;
 26  
 import net.sourceforge.combean.interfaces.graph.prop.GlobalIndexedNodesGraphProp;
 27  
 import net.sourceforge.combean.samples.simplegraphs.IsolatedNodes;
 28  
 import net.sourceforge.combean.test.helpers.checks.CheckGraph;
 29  
 
 30  
 /**
 31  
  * @author schickin
 32  
  *
 33  
  */
 34  
 public class TestIndexedNodeIterator extends TestCase {
 35  
     
 36  3
     private GlobalIndexedNodesGraphProp emptyGraph = null;
 37  3
     private GlobalIndexedNodesGraphProp graph = null;
 38  
     private static final int NUMNODES = 4;
 39  
     
 40  3
     private IndexedNodeIterator nodeItOnEmptyGraph = null;
 41  3
     private IndexedNodeIterator nodeIt = null;
 42  
 
 43  
     /*
 44  
      * @see TestCase#setUp()
 45  
      */
 46  
     protected void setUp() throws Exception {
 47  3
         super.setUp();
 48  
         
 49  3
         this.emptyGraph = new IsolatedNodes(0);
 50  3
         this.nodeItOnEmptyGraph = new IndexedNodeIterator(this.emptyGraph);
 51  3
         this.graph = new IsolatedNodes(NUMNODES);
 52  3
         this.nodeIt = new IndexedNodeIterator(this.graph);
 53  3
     }
 54  
 
 55  
     /*
 56  
      * @see TestCase#tearDown()
 57  
      */
 58  
     protected void tearDown() throws Exception {
 59  3
         super.tearDown();
 60  3
     }
 61  
 
 62  
     /**
 63  
      * Constructor for TestIndexedNodeIterator.
 64  
      * @param name
 65  
      */
 66  
     public TestIndexedNodeIterator(String name) {
 67  3
         super(name);
 68  3
     }
 69  
 
 70  
     public final void testIteration() {
 71  3
         assertFalse(this.nodeItOnEmptyGraph.hasNext());
 72  
         
 73  3
         CheckGraph.checkNumIterations(this.nodeIt, NUMNODES);
 74  3
     }
 75  
 
 76  
 }