本文整理汇总了Java中com.sandwich.koan.TestUtils.ArgRunner类的典型用法代码示例。如果您正苦于以下问题:Java ArgRunner类的具体用法?Java ArgRunner怎么用?Java ArgRunner使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ArgRunner类属于com.sandwich.koan.TestUtils包,在下文中一共展示了ArgRunner类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testForEachLine_threeNewLines
import com.sandwich.koan.TestUtils.ArgRunner; //导入依赖的package包/类
@Test
public void testForEachLine_threeNewLines() throws Exception {
@SuppressWarnings("unchecked")
ArgRunner<String> runner = EasyMock.createStrictMock(ArgRunner.class);
runner.run("");
EasyMock.expectLastCall();
runner.run("");
EasyMock.expectLastCall();
runner.run("");
EasyMock.expectLastCall();
runner.run("");
EasyMock.expectLastCall();
EasyMock.replay(runner);
TestUtils.forEachLine("\n\n\n", runner);
EasyMock.verify(runner);
}
示例2: testForEachLine_spaceNewLineNewLine
import com.sandwich.koan.TestUtils.ArgRunner; //导入依赖的package包/类
@Test
public void testForEachLine_spaceNewLineNewLine(){
@SuppressWarnings("unchecked")
ArgRunner<String> runner = EasyMock.createStrictMock(ArgRunner.class);
runner.run(" ");
EasyMock.expectLastCall();
runner.run("");
EasyMock.expectLastCall();
runner.run("");
EasyMock.expectLastCall();
EasyMock.replay(runner);
TestUtils.forEachLine(" \n\n", runner);
EasyMock.verify(runner);
}
示例3: testForEachLine_newLineNewLineSpace
import com.sandwich.koan.TestUtils.ArgRunner; //导入依赖的package包/类
@Test
public void testForEachLine_newLineNewLineSpace(){
@SuppressWarnings("unchecked")
ArgRunner<String> runner = EasyMock.createStrictMock(ArgRunner.class);
runner.run("");
EasyMock.expectLastCall();
runner.run("");
EasyMock.expectLastCall();
runner.run(" ");
EasyMock.expectLastCall();
EasyMock.replay(runner);
TestUtils.forEachLine("\n\n ", runner);
EasyMock.verify(runner);
}
示例4: testMixingBackslashRAndBackslashNNewLines
import com.sandwich.koan.TestUtils.ArgRunner; //导入依赖的package包/类
@Test
public void testMixingBackslashRAndBackslashNNewLines() throws Exception {
@SuppressWarnings("unchecked")
ArgRunner<String> runner = EasyMock.createStrictMock(ArgRunner.class);
runner.run("");
EasyMock.expectLastCall();
runner.run(" ");
EasyMock.expectLastCall();
runner.run(" ");
EasyMock.expectLastCall();
EasyMock.replay(runner);
TestUtils.forEachLine("\r \n ", runner); // can mix and match \r and \n
EasyMock.verify(runner);
}
示例5: testMixingBackslashNAndBackslashRNewLines
import com.sandwich.koan.TestUtils.ArgRunner; //导入依赖的package包/类
@Test
public void testMixingBackslashNAndBackslashRNewLines() throws Exception {
@SuppressWarnings("unchecked")
ArgRunner<String> runner = EasyMock.createStrictMock(ArgRunner.class);
runner.run("");
EasyMock.expectLastCall();
runner.run(" ");
EasyMock.expectLastCall();
runner.run(" ");
EasyMock.expectLastCall();
EasyMock.replay(runner);
TestUtils.forEachLine("\n \r ", runner); // can mix and match \r and \n
EasyMock.verify(runner);
}
示例6: testForEachLine_nothingThreeNewLinesSeperatedBy1Space
import com.sandwich.koan.TestUtils.ArgRunner; //导入依赖的package包/类
@Test
public void testForEachLine_nothingThreeNewLinesSeperatedBy1Space() throws Exception {
@SuppressWarnings("unchecked")
ArgRunner<String> runner = EasyMock.createStrictMock(ArgRunner.class);
runner.run("");
EasyMock.expectLastCall();
runner.run(" ");
EasyMock.expectLastCall();
runner.run(" ");
EasyMock.expectLastCall();
runner.run("");
EasyMock.expectLastCall();
EasyMock.replay(runner);
TestUtils.forEachLine("\n \n \n", runner);
EasyMock.verify(runner);
}
示例7: testForEachLine_nothingThreeNewLinesSeperatedBy1SpaceThen2Spaces
import com.sandwich.koan.TestUtils.ArgRunner; //导入依赖的package包/类
@Test
public void testForEachLine_nothingThreeNewLinesSeperatedBy1SpaceThen2Spaces() throws Exception {
@SuppressWarnings("unchecked")
ArgRunner<String> runner = EasyMock.createStrictMock(ArgRunner.class);
runner.run("");
EasyMock.expectLastCall();
runner.run(" ");
EasyMock.expectLastCall();
runner.run(" ");
EasyMock.expectLastCall();
runner.run("");
EasyMock.expectLastCall();
EasyMock.replay(runner);
TestUtils.forEachLine("\n \n \n", runner);
EasyMock.verify(runner);
}
示例8: assertSystemOutLineEquals
import com.sandwich.koan.TestUtils.ArgRunner; //导入依赖的package包/类
public void assertSystemOutLineEquals(final int lineNumber, final String lineText,
final boolean trimLinesString) {
final int[] onLine = new int[]{0};
final boolean[] found = new boolean[]{false};
TestUtils.forEachLine(bytes.toString(), new ArgRunner<String>(){
public void run(String s){
if(onLine[0] == lineNumber){
if(trimLinesString){
s = s.trim();
}
assertEquals(lineText, s);
found[0] = true;
}
onLine[0]++;
}
});
if(!found[0]){
throw new KoanIncompleteException(lineText+" was expected, but not found in: "+bytes.toString());
}
}
示例9: testForEachLine_nothingThreeNewLinesSeparatedBy1Space
import com.sandwich.koan.TestUtils.ArgRunner; //导入依赖的package包/类
@Test
public void testForEachLine_nothingThreeNewLinesSeparatedBy1Space() throws Exception {
@SuppressWarnings("unchecked")
ArgRunner<String> runner = EasyMock.createStrictMock(ArgRunner.class);
runner.run("");
EasyMock.expectLastCall();
runner.run(" ");
EasyMock.expectLastCall();
runner.run(" ");
EasyMock.expectLastCall();
runner.run("");
EasyMock.expectLastCall();
EasyMock.replay(runner);
TestUtils.forEachLine("\n \n \n", runner);
EasyMock.verify(runner);
}
示例10: testForEachLine_nothingThreeNewLinesSeparatedBy1SpaceThen2Spaces
import com.sandwich.koan.TestUtils.ArgRunner; //导入依赖的package包/类
@Test
public void testForEachLine_nothingThreeNewLinesSeparatedBy1SpaceThen2Spaces() throws Exception {
@SuppressWarnings("unchecked")
ArgRunner<String> runner = EasyMock.createStrictMock(ArgRunner.class);
runner.run("");
EasyMock.expectLastCall();
runner.run(" ");
EasyMock.expectLastCall();
runner.run(" ");
EasyMock.expectLastCall();
runner.run("");
EasyMock.expectLastCall();
EasyMock.replay(runner);
TestUtils.forEachLine("\n \n \n", runner);
EasyMock.verify(runner);
}
示例11: assertLineEquals
import com.sandwich.koan.TestUtils.ArgRunner; //导入依赖的package包/类
public void assertLineEquals(final int lineNumber, final String lineText, final boolean trimLinesString, ByteArrayOutputStream bytes) {
final int[] onLine = new int[]{0};
final boolean[] found = new boolean[]{false};
String bytesString = String.valueOf(bytes);
TestUtils.forEachLine(bytesString, new ArgRunner<String>(){
public void run(String s){
if(onLine[0] == lineNumber){
if(trimLinesString){
s = s.trim();
}
Assert.assertEquals(lineText, s);
found[0] = true;
}
onLine[0]++;
}
});
if(!found[0]){
throw new KoanIncompleteException(lineText+" was expected, but not found in: "+bytesString);
}
}
示例12: testForEachLine_emptyString
import com.sandwich.koan.TestUtils.ArgRunner; //导入依赖的package包/类
@Test
public void testForEachLine_emptyString() throws Exception {
@SuppressWarnings("unchecked")
ArgRunner<String> runner = EasyMock.createStrictMock(ArgRunner.class);
runner.run("");
EasyMock.expectLastCall();
EasyMock.replay(runner);
TestUtils.forEachLine("", runner);
EasyMock.verify(runner);
}