junit.quilt.framework
Class CoverageSegmentImpl

java.lang.Object
  |
  +--junit.quilt.framework.CoverageSegmentImpl
All Implemented Interfaces:
CoverageSegment
Direct Known Subclasses:
BranchSegment, StatementSegmentImpl

public class CoverageSegmentImpl
extends java.lang.Object
implements CoverageSegment


Constructor Summary
CoverageSegmentImpl()
           
 
Method Summary
protected  void addVisits(int numVisits)
           
 java.lang.String getAdvice()
          getAdvice() This method returns a human readable string containing advice on how to cover this segment.
 java.lang.String getCustomXML()
           
 java.lang.String getDescription()
          getDescription This method returns a description of the segment which is defined by this class.
 int getNumVisits()
          getNumVisits This returns the number of times that this segment has been executed by the code.
 java.util.List getTimes()
          getTimes() This method may return NULL if no timing is done.
 void reset()
           
 java.lang.String toXML()
          toXML All Coverage Segments are required to output whatever data they have in XML format.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CoverageSegmentImpl

public CoverageSegmentImpl()
Method Detail

getNumVisits

public int getNumVisits()
Description copied from interface: CoverageSegment
getNumVisits This returns the number of times that this segment has been executed by the code. This value may be either 0 or 1 if the algorithm cannot collect the number of visits, but can only collect whether it has been visited or not.
Specified by:
getNumVisits in interface CoverageSegment

getCustomXML

public java.lang.String getCustomXML()

toXML

public java.lang.String toXML()
Description copied from interface: CoverageSegment
toXML All Coverage Segments are required to output whatever data they have in XML format. The top element should be what type of segment this is. It should include custom information to allow a machine to recreate the segment. It needs to include these elements: NumVisits = Number of Visits Times = Collection of running times (if supported) Advice = Advice on meeting coverage (if supported) Description = Human readable description of this segment.
 
   14
   20
   65
   
      
      
        ...
   
   Execute FooBar.runStuff(a) with a != 1
   Lines 14 - 20 of FooBar.java
 
Specified by:
toXML in interface CoverageSegment

getTimes

public java.util.List getTimes()
Description copied from interface: CoverageSegment
getTimes() This method may return NULL if no timing is done. It may return an empty list if timing is done, but the segment has not been covered. The list returned will have java.lang.Float values.
Specified by:
getTimes in interface CoverageSegment

getAdvice

public java.lang.String getAdvice()
Description copied from interface: CoverageSegment
getAdvice() This method returns a human readable string containing advice on how to cover this segment. If good advice is not available, then this should return the description. I hope it can be something like: Run method foo.bar(int a) with a < 0
Specified by:
getAdvice in interface CoverageSegment

getDescription

public java.lang.String getDescription()
Description copied from interface: CoverageSegment
getDescription This method returns a description of the segment which is defined by this class. This should be similar to: Lines 14 - 20 of FooBar.java
Specified by:
getDescription in interface CoverageSegment

reset

public void reset()

addVisits

protected void addVisits(int numVisits)


Copyright © 2001-2002 David Dixon-Peugh. All Rights Reserved.