Coverage Report - net.sourceforge.combean.test.graph.util.TestIncidentEdgeAsOutgoingEdgeIterator
 
Classes in this File Line Coverage Branch Coverage Complexity
TestIncidentEdgeAsOutgoingEdgeIterator
91%
20/22
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.util;
 23  
 
 24  
 import junit.framework.TestCase;
 25  
 import net.sourceforge.combean.graph.NumberNode;
 26  
 import net.sourceforge.combean.graph.iterators.IncidentEdgeAsOutgoingEdgeIterator;
 27  
 import net.sourceforge.combean.interfaces.graph.EdgeIterator;
 28  
 import net.sourceforge.combean.samples.simplegraphs.Clique;
 29  
 import net.sourceforge.combean.samples.simplegraphs.NumberGraph;
 30  
 import net.sourceforge.combean.test.helpers.checks.CheckGraph;
 31  
 
 32  
 /**
 33  
  * @author schickin
 34  
  *
 35  
  */
 36  
 public class TestIncidentEdgeAsOutgoingEdgeIterator extends TestCase {
 37  
 
 38  
     private static final int GRAPHSIZE = 5;
 39  6
     private Clique clique = null;
 40  6
     private NumberNode firstNode = null;
 41  6
     private NumberNode secondNode = null;
 42  
 
 43  6
     private EdgeIterator itEdgeFirst = null;
 44  
 
 45  
     public static void main(String[] args) {
 46  0
         junit.textui.TestRunner
 47  
                 .run(TestIncidentEdgeAsOutgoingEdgeIterator.class);
 48  0
     }
 49  
 
 50  
     /*
 51  
      * @see TestCase#setUp()
 52  
      */
 53  
     protected void setUp() throws Exception {
 54  6
         super.setUp();
 55  
  
 56  6
         this.clique = new Clique(GRAPHSIZE);
 57  6
         this.firstNode = new NumberNode(NumberGraph.FIRSTNODE); 
 58  6
         this.secondNode = new NumberNode(NumberGraph.FIRSTNODE+1); 
 59  6
         this.itEdgeFirst = this.clique.getIncidentEdges(this.firstNode);
 60  6
     }
 61  
 
 62  
     /*
 63  
      * @see TestCase#tearDown()
 64  
      */
 65  
     protected void tearDown() throws Exception {
 66  6
         super.tearDown();
 67  6
     }
 68  
 
 69  
     /**
 70  
      * Constructor for TestIncidentEdgeAsOutgoingEdgeIterator.
 71  
      * @param name
 72  
      */
 73  
     public TestIncidentEdgeAsOutgoingEdgeIterator(String name) {
 74  6
         super(name);
 75  6
     }
 76  
 
 77  
     public final void testIterationThroughFilteredNeighborsAtSource() {
 78  3
         EdgeIterator itFiltered =
 79  
             new IncidentEdgeAsOutgoingEdgeIterator(this.clique,
 80  
                     this.firstNode, this.itEdgeFirst);
 81  3
         CheckGraph.checkNumIterations(itFiltered, GRAPHSIZE-1);
 82  3
     }
 83  
      
 84  
     public final void testIterationThroughFilteredNeighborsNotAtSource() {
 85  3
         EdgeIterator itFiltered =
 86  
             new IncidentEdgeAsOutgoingEdgeIterator(this.clique,
 87  
                     this.secondNode, this.itEdgeFirst);
 88  3
         CheckGraph.checkNumIterations(itFiltered, 0);
 89  3
     }
 90  
 }