{
fw = new FileWriter( outFile );
StringWriter writer = new StringWriter();
InputFileWrapper input =
InputFileWrapper.valueOf( inFile.getAbsolutePath(), from, converter.getInputFormats() );
OutputFileWrapper output =
OutputFileWrapper.valueOf( outFile.getAbsolutePath(), to, converter.getOutputFormats() );
converter.setFormatOutput( formatOutput );
converter.convert( input, output );
IOUtil.copy( writer.toString(), fw );
assertTrue( outFile.exists() );
assertTrue( outFile.length() != 0 );
}
finally
{
IOUtil.close( fw );
}
in = getBasedir() + "/src/test/resources/unit/apt/test.apt";
from = null;
out = getBasedir() + "/target/unit/writer/apt/test.apt.xhtml";
to = "xhtml";
inFile = new File( in );
outFile = new File( out );
outFile.getParentFile().mkdirs();
try
{
fw = new FileWriter( outFile );
StringWriter writer = new StringWriter();
InputFileWrapper input =
InputFileWrapper.valueOf( inFile.getAbsolutePath(), from, converter.getInputFormats() );
OutputFileWrapper output =
OutputFileWrapper.valueOf( outFile.getAbsolutePath(), to, converter.getOutputFormats() );
converter.setFormatOutput( formatOutput );
converter.convert( input, output );
IOUtil.copy( writer.toString(), fw );
assertTrue( outFile.exists() );
assertTrue( outFile.length() != 0 );
}
finally
{
IOUtil.close( fw );
}
in = getBasedir() + "/src/test/resources/unit/apt/test.unknown";
from = null;
out = getBasedir() + "/target/unit/writer/apt/test.apt.xhtml";
to = "xhtml";
inFile = new File( in );
outFile = new File( out );
outFile.getParentFile().mkdirs();
try
{
fw = new FileWriter( outFile );
InputFileWrapper input =
InputFileWrapper.valueOf( inFile.getAbsolutePath(), from, converter.getInputFormats() );
OutputFileWrapper output =
OutputFileWrapper.valueOf( outFile.getAbsolutePath(), to, converter.getOutputFormats() );
converter.setFormatOutput( formatOutput );