Package randoop.output
Class MinimizerWriter
- java.lang.Object
-
- randoop.output.MinimizerWriter
-
- All Implemented Interfaces:
CodeWriter
public class MinimizerWriter extends Object implements CodeWriter
ACodeWriter
that, for an error-revealing test class, writes both the original and minimized class. Minimizes the methods of the test class usingMinimize.mainMinimize(Path, String, int, boolean)
.
-
-
Field Summary
Fields Modifier and Type Field Description private JavaFileWriter
javaFileWriter
TheJavaFileWriter
used to write classes.
-
Constructor Summary
Constructors Constructor Description MinimizerWriter(JavaFileWriter javaFileWriter)
Creates aMinimizerWriter
using the givenJavaFileWriter
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Path
writeClassCode(String packageName, String classname, String classCode)
Writes the given class using thisCodeWriter
.Path
writeUnmodifiedClassCode(String packageName, String classname, String classCode)
Writes the given class.
-
-
-
Field Detail
-
javaFileWriter
private final JavaFileWriter javaFileWriter
TheJavaFileWriter
used to write classes.
-
-
Constructor Detail
-
MinimizerWriter
public MinimizerWriter(JavaFileWriter javaFileWriter)
Creates aMinimizerWriter
using the givenJavaFileWriter
.- Parameters:
javaFileWriter
- theJavaFileWriter
for writing the classes
-
-
Method Detail
-
writeClassCode
public Path writeClassCode(String packageName, String classname, String classCode) throws RandoopOutputException
Writes the given class using thisCodeWriter
. May modify the class text before writing it. May write additional files (but those are not returned).Writes both the original class and the minimized class. Returns the original class.
- Specified by:
writeClassCode
in interfaceCodeWriter
- Parameters:
packageName
- the package name of the classclassname
- the simple name of the classclassCode
- the text of a Java class, must be compilable- Returns:
- the
Path
object for the Java file written - Throws:
RandoopOutputException
- if there is an error while writing the code
-
writeUnmodifiedClassCode
public Path writeUnmodifiedClassCode(String packageName, String classname, String classCode) throws RandoopOutputException
Description copied from interface:CodeWriter
Writes the given class. Does not modify the class text.- Specified by:
writeUnmodifiedClassCode
in interfaceCodeWriter
- Parameters:
packageName
- the package name of the classclassname
- the simple name of the classclassCode
- the text of the class to be written, must be compilable- Returns:
- the
Path
object for the Java file written - Throws:
RandoopOutputException
- if there is an error while writing the code
-
-