当前位置: 首页>>代码示例>>Java>>正文


Java ArgRunner类代码示例

本文整理汇总了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);
}
 
开发者ID:nkalupahana,项目名称:completed-koans,代码行数:23,代码来源:TestUtilsTest.java

示例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);
}
 
开发者ID:nkalupahana,项目名称:completed-koans,代码行数:20,代码来源:TestUtilsTest.java

示例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);
}
 
开发者ID:nkalupahana,项目名称:completed-koans,代码行数:20,代码来源:TestUtilsTest.java

示例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);
}
 
开发者ID:nkalupahana,项目名称:completed-koans,代码行数:20,代码来源:TestUtilsTest.java

示例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);
}
 
开发者ID:nkalupahana,项目名称:completed-koans,代码行数:20,代码来源:TestUtilsTest.java

示例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);
}
 
开发者ID:nkalupahana,项目名称:completed-koans,代码行数:23,代码来源:TestUtilsTest.java

示例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);
}
 
开发者ID:nkalupahana,项目名称:completed-koans,代码行数:23,代码来源:TestUtilsTest.java

示例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());
	}
}
 
开发者ID:nkalupahana,项目名称:completed-koans,代码行数:21,代码来源:CommandLineTestCase.java

示例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);
}
 
开发者ID:nkalupahana,项目名称:completed-koans,代码行数:23,代码来源:TestUtilsTest.java

示例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);
}
 
开发者ID:nkalupahana,项目名称:completed-koans,代码行数:23,代码来源:TestUtilsTest.java

示例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);
	}
}
 
开发者ID:nkalupahana,项目名称:completed-koans,代码行数:21,代码来源:CommandLineTestCase.java

示例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);
}
 
开发者ID:nkalupahana,项目名称:completed-koans,代码行数:13,代码来源:TestUtilsTest.java


注:本文中的com.sandwich.koan.TestUtils.ArgRunner类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。