testsgen.wttools
Class CodeGenImpl

java.lang.Object
  |
  +--testsgen.wttools.CodeGenImpl
All Implemented Interfaces:
CodeGenIfc

public class CodeGenImpl
extends java.lang.Object
implements CodeGenIfc

CodeGenImpl.java contains implementation of CodeGenIfc interface. This implementation generates code for test classes for JUnit test engine. It tries to create some simple test code.

Created: Mon Dec 3 23:40:12 2001

Version:
$Revision: 1.27 $
Author:
Artur Hefczyc

Field Summary
protected  java.lang.String dest_dir
           
protected  boolean force
           
protected  LogIfc log
           
protected  java.lang.String name_pattern
           
protected  PropertyIfc property
           
protected  boolean recursive
           
protected  boolean test_method_code
           
protected  boolean test_method_comments
           
protected  boolean test_only
           
protected  boolean update
           
 
Constructor Summary
CodeGenImpl()
           
 
Method Summary
 void generateCode(ParsedSourceIfc[] srcs)
           
 void generateNewCode(ParsedSourceIfc src)
           
protected  java.lang.String getClassEnd(ParsedSourceIfc src)
           
protected  java.lang.String getClassStart(ParsedSourceIfc src)
           
protected  java.lang.String getMethodFrame(MethodIfc meth, ParsedSourceIfc src)
           
protected  boolean getParameter(java.lang.String sh_name, java.lang.String l_name)
           
protected  java.lang.String getTestFileJavaDoc(ParsedSourceIfc src)
           
protected  java.lang.String getTestFileStart(ParsedSourceIfc src)
           
protected  java.lang.String licenceComments()
           
protected  java.lang.String loadFromFile(java.lang.String file_name, boolean backup)
           
protected  void sampleJUnitBuildXML()
           
protected  void setJobParameters()
           
 void setLogHandler(LogIfc log_handler)
           
 void setPropertyHandler(PropertyIfc property_handler)
           
 int updateExistingCode(ParsedSourceIfc src)
           
protected  void writeFile(java.lang.String file_name, java.lang.String file_content)
           
protected  void writeTestAllSource(ParsedSourceIfc[] srcs)
           
protected  void writeTestSource(ParsedSourceIfc psi, java.lang.String test_src)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected LogIfc log

property

protected PropertyIfc property

test_only

protected boolean test_only

recursive

protected boolean recursive

force

protected boolean force

update

protected boolean update

name_pattern

protected java.lang.String name_pattern

dest_dir

protected java.lang.String dest_dir

test_method_comments

protected boolean test_method_comments

test_method_code

protected boolean test_method_code
Constructor Detail

CodeGenImpl

public CodeGenImpl()
Method Detail

setLogHandler

public void setLogHandler(LogIfc log_handler)
Specified by:
setLogHandler in interface CodeGenIfc
Parameters:
log_handler -

setPropertyHandler

public void setPropertyHandler(PropertyIfc property_handler)
Specified by:
setPropertyHandler in interface CodeGenIfc
Parameters:
property_handler -

licenceComments

protected java.lang.String licenceComments()

writeFile

protected void writeFile(java.lang.String file_name,
                         java.lang.String file_content)
                  throws java.io.IOException

writeTestAllSource

protected void writeTestAllSource(ParsedSourceIfc[] srcs)
                           throws java.io.IOException

sampleJUnitBuildXML

protected void sampleJUnitBuildXML()
                            throws java.io.IOException

getTestFileStart

protected java.lang.String getTestFileStart(ParsedSourceIfc src)

getTestFileJavaDoc

protected java.lang.String getTestFileJavaDoc(ParsedSourceIfc src)

getClassStart

protected java.lang.String getClassStart(ParsedSourceIfc src)

getClassEnd

protected java.lang.String getClassEnd(ParsedSourceIfc src)

getMethodFrame

protected java.lang.String getMethodFrame(MethodIfc meth,
                                          ParsedSourceIfc src)

writeTestSource

protected void writeTestSource(ParsedSourceIfc psi,
                               java.lang.String test_src)
                        throws java.io.IOException

generateNewCode

public void generateNewCode(ParsedSourceIfc src)
                     throws java.io.IOException

loadFromFile

protected java.lang.String loadFromFile(java.lang.String file_name,
                                        boolean backup)
                                 throws java.io.IOException

updateExistingCode

public int updateExistingCode(ParsedSourceIfc src)
                       throws java.io.IOException

generateCode

public void generateCode(ParsedSourceIfc[] srcs)
                  throws java.io.IOException
Specified by:
generateCode in interface CodeGenIfc
Parameters:
srcs -

getParameter

protected boolean getParameter(java.lang.String sh_name,
                               java.lang.String l_name)

setJobParameters

protected void setJobParameters()


Copyright © GNU, wttools developers Team.