/**
* <p>
* sysinFileout.
* </p>
*
* @throws java.lang.Throwable if any.
*/
@Test
public void sysinFileout() throws Throwable
{
final String testName = Helper.testName();
Helper.initializeFor(testName);
final List<String> out = new ArrayList<>();
out.add("line 1");
out.add("line 2");
final StringBuilder sb = new StringBuilder();
for (final String outline : out)
sb.append(outline).append(System.getProperty("line.separator"));
final InputStream inputStream = new StringBufferInputStream(sb.toString());
System.setIn(inputStream);
final File file = Helper.outFileWhenInIsSysin();
final FunnelContext context = Funnel.sort(Helper.config(), "-o" + file.getAbsolutePath()
+ " --row 2 -c original");
Assert.assertEquals("records", 2L, context.getRecordCount());
Helper.compare(file, out);
Assert.assertTrue("delete " + file.getAbsolutePath(), file.delete());
}
InputTest.java 文件源码
java
阅读 25
收藏 0
点赞 0
评论 0
项目:com.obdobion.funnelsort
作者:
评论列表
文章目录