javancss.test
Class JavancssTest

java.lang.Object
  extended byccl.util.Test
      extended byjavancss.test.JavancssTest
All Implemented Interfaces:
JavancssConstants, java.lang.Runnable

public class JavancssTest
extends ccl.util.Test
implements JavancssConstants

Test class for the JavaNCSS application. $Id: JavancssTest.java,v 1.33 2006/07/25 19:08:02 clemens Exp clemens $ 3. 9. 1996


Field Summary
private  java.lang.String _sTestDir
           
 
Fields inherited from class ccl.util.Test
 
Fields inherited from interface javancss.JavancssConstants
FCT_CCN, FCT_JVDC, FCT_JVDC_LINES, FCT_MULTI_LINES, FCT_NAME, FCT_NCSS, FCT_SINGLE_LINES, OBJ_CLSSS, OBJ_FCTS, OBJ_JVDC_LINES, OBJ_JVDCS, OBJ_MULTI_LINES, OBJ_NAME, OBJ_NCSS, OBJ_SINGLE_LINES
 
Constructor Summary
JavancssTest()
           
JavancssTest(ccl.util.Test pTest_)
           
 
Method Summary
private  void _checkInnerClasses()
          This method tries to reproduce a bug reported by Chris Williamson.
private  void _checkJavadocLines()
          Check that Javadoc line counts are correct.
private  void _checkJavadocLines(int[] aTestFile, java.lang.String sPackage, int javadocLines)
           
private  void _checkJavadocLines(int testFile, java.lang.String sPackage, int javadocLines)
           
private  void _checkJavadocLines(Javancss pJavancss, java.lang.String sPackage, int javadocLines)
           
private  void _checkJavadocLines(java.lang.String sJavaSource, java.lang.String sPackage, int javadocLines)
           
private  void _checkJavadocLines(java.util.Vector vJavaSources, java.lang.String sPackage, int javadocLines)
           
private  void _checkJavadocs()
          There has been a bug introduced for version 16.34 which counts Javadoc comments (**) for fields as well as for methods, while I am only in the later ones.
protected  void _doIt()
           
private  void _doJvdcsTest(int testFileNumber, int expectedJvdcsResult)
           
private  void _doNcssTest(int testNumber)
           
private  void _doNcssTest(int testNumber, int expectedNcss)
           
private  void assertCCN(java.util.Vector vFunctions, int methodIndex, int expectedCCN)
           
private  int getCCN(java.util.Vector vFunctions, int methodIndex)
           
private  Javancss measureTestFile(java.lang.String sLocalPath, int testFileId)
           
 void setTestDir(java.lang.String sTestDir_)
           
 void testCCN(java.lang.String sLocalPath)
          Tests the cyclomatic complexity number measurement.
 
Methods inherited from class ccl.util.Test
_enterSubTest, _exitSubTest, _getValue, _increment, _setTests, _showLiveSignals, assert, Assert, assert, Assert, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertNotNull, assertNotNull, assertTrue, assertTrue, assertTrue, bug, bugIf, bugIf, bugIf, fail, fail, getBugs, getComment, getGlobalTests, getLocalTests, getName, getTestClassDirectory, getTestDirectory, getTestName, getTestName, getValue, initialize, isTest, isTiming, isVerbose, printResult, printResult, redirectStandardStreams, run, setBug, setParentTest, setTests, setTiming, setValue, setVerbose, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_sTestDir

private java.lang.String _sTestDir
Constructor Detail

JavancssTest

public JavancssTest()

JavancssTest

public JavancssTest(ccl.util.Test pTest_)
Method Detail

_doNcssTest

private void _doNcssTest(int testNumber,
                         int expectedNcss)

_doNcssTest

private void _doNcssTest(int testNumber)

_checkJavadocs

private void _checkJavadocs()
There has been a bug introduced for version 16.34 which counts Javadoc comments (**) for fields as well as for methods, while I am only in the later ones. File Test20 has 6 methods and 6 + 1 ** comments. This test should make sure that 3 attribute comments won't be counted.


_checkJavadocLines

private void _checkJavadocLines()
Check that Javadoc line counts are correct. There is one bug where there are only two files with a package jacob in the test directory (Test1.java and Test28.java), and while both have no javadocs at all, the count is still 11. The eleven seem to come from files Test20.java and Test21.java. This test shall trace this bug down and shall later asure that it got fixed.


_checkJavadocLines

private void _checkJavadocLines(java.util.Vector vJavaSources,
                                java.lang.String sPackage,
                                int javadocLines)

_checkJavadocLines

private void _checkJavadocLines(java.lang.String sJavaSource,
                                java.lang.String sPackage,
                                int javadocLines)

_checkJavadocLines

private void _checkJavadocLines(int testFile,
                                java.lang.String sPackage,
                                int javadocLines)

_checkJavadocLines

private void _checkJavadocLines(int[] aTestFile,
                                java.lang.String sPackage,
                                int javadocLines)

_checkJavadocLines

private void _checkJavadocLines(Javancss pJavancss,
                                java.lang.String sPackage,
                                int javadocLines)

_checkInnerClasses

private void _checkInnerClasses()
This method tries to reproduce a bug reported by Chris Williamson. He reported problems with code like this: F150MemoryMap f150Map = (F150MemoryMap) F150.super.memMap;


_doIt

protected void _doIt()
              throws java.lang.Exception
Throws:
java.lang.Exception

_doJvdcsTest

private void _doJvdcsTest(int testFileNumber,
                          int expectedJvdcsResult)

testCCN

public void testCCN(java.lang.String sLocalPath)
Tests the cyclomatic complexity number measurement.


assertCCN

private void assertCCN(java.util.Vector vFunctions,
                       int methodIndex,
                       int expectedCCN)

getCCN

private int getCCN(java.util.Vector vFunctions,
                   int methodIndex)

measureTestFile

private Javancss measureTestFile(java.lang.String sLocalPath,
                                 int testFileId)

setTestDir

public void setTestDir(java.lang.String sTestDir_)