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


Java OnePassingKoan类代码示例

本文整理汇总了Java中com.sandwich.koan.suite.OnePassingKoan的典型用法代码示例。如果您正苦于以下问题:Java OnePassingKoan类的具体用法?Java OnePassingKoan怎么用?Java OnePassingKoan使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


OnePassingKoan类属于com.sandwich.koan.suite包,在下文中一共展示了OnePassingKoan类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: progressFiftyFifty

import com.sandwich.koan.suite.OnePassingKoan; //导入依赖的package包/类
@Test
public void progressFiftyFifty() throws Throwable {
	stubAllKoans(Arrays.asList(new OnePassingKoan(), new OneFailingKoan()));
	new CommandLineArgumentRunner().run();
	StringBuilder sb = new StringBuilder(
			PROGRESS).append(" ").append(
			PROGRESS_BAR_START);
	for(int i = 0; i < PROGRESS_BAR_WIDTH / 2; i++){ // 50% succeeded
		sb.append(COMPLETE_CHAR);
	}
	for(int i = 0; i < PROGRESS_BAR_WIDTH / 2; i++){ // 50% failed
		sb.append(INCOMPLETE_CHAR);
	}
	sb.append("] 1/2").append(EOL);
	assertSystemOutContains(sb.toString());
}
 
开发者ID:nkalupahana,项目名称:completed-koans,代码行数:17,代码来源:ConsolePresenterTest.java

示例2: testNoWarningFromPlacingExpecationOnRightSide

import com.sandwich.koan.suite.OnePassingKoan; //导入依赖的package包/类
@Test
public void testNoWarningFromPlacingExpecationOnRightSide()
		throws Throwable {
	stubAllKoans(Arrays.asList(new OnePassingKoan()));
	Logger.getLogger(CommandLineArgumentRunner.class.getSimpleName()).addHandler(
			new Handler() {
				@Override
				public void close() throws SecurityException {
				}

				@Override
				public void flush() {
				}

				@Override
				public void publish(LogRecord arg0) {
					fail("No logging necessary when koan passes, otherwise - logging is new, adjust accordingly.");
				}
			});
	new CommandLineArgumentRunner().run();
}
 
开发者ID:nkalupahana,项目名称:completed-koans,代码行数:22,代码来源:AppReadinessForDeploymentTest.java

示例3: progressFiftyFifty

import com.sandwich.koan.suite.OnePassingKoan; //导入依赖的package包/类
@Test
public void progressFiftyFifty() throws Throwable {
	stubAllKoans(Arrays.asList(new OnePassingKoan(), new OneFailingKoan()));
	new CommandLineArgumentRunner().run();
	StringBuilder sb = new StringBuilder(
			Strings.getMessage("progress")).append(" ").append(
			PROGRESS_BAR_START);
	for(int i = 0; i < PROGRESS_BAR_WIDTH / 2; i++){ // 50% succeeded
		sb.append(COMPLETE_CHAR);
	}
	for(int i = 0; i < PROGRESS_BAR_WIDTH / 2; i++){ // 50% failed
		sb.append(INCOMPLETE_CHAR);
	}
	sb.append("] 1/2").append(EOL);
	assertSystemOutContains(sb.toString());
}
 
开发者ID:nkalupahana,项目名称:completed-koans,代码行数:17,代码来源:ConsolePresenterTest.java

示例4: testNoWarningFromPlacingExpectationOnRightSide

import com.sandwich.koan.suite.OnePassingKoan; //导入依赖的package包/类
@Test
public void testNoWarningFromPlacingExpectationOnRightSide()
		throws Throwable {
	stubAllKoans(Arrays.asList(new OnePassingKoan()));
	Logger.getLogger(CommandLineArgumentRunner.class.getSimpleName()).addHandler(
			new Handler() {
				@Override
				public void close() throws SecurityException {
				}

				@Override
				public void flush() {
				}

				@Override
				public void publish(LogRecord arg0) {
					fail("No logging necessary when koan passes, otherwise - logging is new, adjust accordingly.\n"+arg0.getMessage());
				}
			});
	new CommandLineArgumentRunner().run();
}
 
开发者ID:nkalupahana,项目名称:completed-koans,代码行数:22,代码来源:AppReadinessForDeploymentTest.java

示例5: testOneHundredPercentSuccessReward

import com.sandwich.koan.suite.OnePassingKoan; //导入依赖的package包/类
@Test
public void testOneHundredPercentSuccessReward() throws Throwable {
	stubAllKoans(Arrays.asList(new Class<?>[] { 
			OnePassingKoan.class }));
	new CommandLineArgumentRunner().run();
	assertSystemOutContains(ALL_SUCCEEDED);
	assertSystemOutDoesntContain(CONQUERED);
	assertSystemOutDoesntContain(ENCOURAGEMENT);
}
 
开发者ID:nkalupahana,项目名称:completed-koans,代码行数:10,代码来源:ConsolePresenterTest.java

示例6: failingAndPassingSuites

import com.sandwich.koan.suite.OnePassingKoan; //导入依赖的package包/类
@Test
public void failingAndPassingSuites() throws Throwable {
	stubAllKoans(Arrays.asList(new OnePassingKoan(), new OneFailingKoan()));
	new CommandLineArgumentRunner().run();
	assertSystemOutContains(PASSING_SUITES+" OnePassingKoan"+EOL+
							FAILING_SUITES+" OneFailingKoan");
}
 
开发者ID:nkalupahana,项目名称:completed-koans,代码行数:8,代码来源:ConsolePresenterTest.java

示例7: progressAllPassing

import com.sandwich.koan.suite.OnePassingKoan; //导入依赖的package包/类
@Test
public void progressAllPassing() throws Throwable {
	stubAllKoans(Arrays.asList(new OnePassingKoan()));
	new CommandLineArgumentRunner().run();
	StringBuilder sb = new StringBuilder(PROGRESS).append(" ")
								.append(PROGRESS_BAR_START);
	for(int i = 0; i < PROGRESS_BAR_WIDTH; i++){ // 100% success
		sb.append(COMPLETE_CHAR);
	}
	sb.append("] 1/1").append(EOL);
	assertSystemOutContains(sb.toString());
}
 
开发者ID:nkalupahana,项目名称:completed-koans,代码行数:13,代码来源:ConsolePresenterTest.java

示例8: testGetKoans

import com.sandwich.koan.suite.OnePassingKoan; //导入依赖的package包/类
@Test
public void testGetKoans() throws Exception {
	stubAllKoans(Arrays.asList(new OnePassingKoan()));
	Map<String, Map<String, KoanElementAttributes>> koans = PathToEnlightenment.getPathToEnlightenment().iterator().next().getValue();
	assertEquals(1, koans.size());
	Entry<String, Map<String, KoanElementAttributes>> entry = koans.entrySet().iterator().next();
	assertEquals(OnePassingKoan.class.getName(), entry.getKey());
	assertEquals(	OnePassingKoan.class.getDeclaredMethod("koan").toString(), 
					KoanMethod.getInstance(entry.getValue().get("koan")).getMethod().toString());
}
 
开发者ID:nkalupahana,项目名称:completed-koans,代码行数:11,代码来源:AppReadinessForDeploymentTest.java

示例9: testOneHundredPercentSuccessReward

import com.sandwich.koan.suite.OnePassingKoan; //导入依赖的package包/类
@Test
public void testOneHundredPercentSuccessReward() throws Throwable {
	stubAllKoans(Arrays.asList(new Class<?>[] { 
			OnePassingKoan.class }));
	new CommandLineArgumentRunner().run();
	assertSystemOutContains(Strings.getMessage("all_koans_succeeded"));
	assertSystemOutDoesntContain(Strings.getMessage("you_have_conquered"));
	assertSystemOutDoesntContain(Strings.getMessage("encouragement"));
}
 
开发者ID:nkalupahana,项目名称:completed-koans,代码行数:10,代码来源:ConsolePresenterTest.java

示例10: failingAndPassingSuites

import com.sandwich.koan.suite.OnePassingKoan; //导入依赖的package包/类
@Test
public void failingAndPassingSuites() throws Throwable {
	stubAllKoans(Arrays.asList(new OnePassingKoan(), new OneFailingKoan()));
	new CommandLineArgumentRunner().run();
	assertSystemOutContains(Strings.getMessage("passing_suites")+": OnePassingKoan"+EOL+
			Strings.getMessage("remaining_suites")+": OneFailingKoan");
}
 
开发者ID:nkalupahana,项目名称:completed-koans,代码行数:8,代码来源:ConsolePresenterTest.java

示例11: progressAllPassing

import com.sandwich.koan.suite.OnePassingKoan; //导入依赖的package包/类
@Test
public void progressAllPassing() throws Throwable {
	stubAllKoans(Arrays.asList(new OnePassingKoan()));
	new CommandLineArgumentRunner().run();
	StringBuilder sb = new StringBuilder(Strings.getMessage("progress")).append(" ")
								.append(PROGRESS_BAR_START);
	for(int i = 0; i < PROGRESS_BAR_WIDTH; i++){ // 100% success
		sb.append(COMPLETE_CHAR);
	}
	sb.append("] 1/1").append(EOL);
	assertSystemOutContains(sb.toString());
}
 
开发者ID:nkalupahana,项目名称:completed-koans,代码行数:13,代码来源:ConsolePresenterTest.java

示例12: passingSuites

import com.sandwich.koan.suite.OnePassingKoan; //导入依赖的package包/类
@Test
public void passingSuites() throws Throwable {
	stubAllKoans(Arrays.asList(new OnePassingKoan(), new OnePassingKoanDifferentName()));
	new CommandLineArgumentRunner().run();
	assertSystemOutContains(PASSING_SUITES+" OnePassingKoan, OnePassingKoanDifferentName");
}
 
开发者ID:nkalupahana,项目名称:completed-koans,代码行数:7,代码来源:ConsolePresenterTest.java

示例13: testMainMethodWithClassNameArg_qualifiedWithPkgName

import com.sandwich.koan.suite.OnePassingKoan; //导入依赖的package包/类
@Test
public void testMainMethodWithClassNameArg_qualifiedWithPkgName() throws Throwable {
	stubAllKoans(Arrays.asList(new OnePassingKoan()));
	new CommandLineArgumentRunner().run();
	assertSystemOutContains(KoanConstants.PASSING_SUITES+" "+OnePassingKoan.class.getSimpleName());
}
 
开发者ID:nkalupahana,项目名称:completed-koans,代码行数:7,代码来源:AppReadinessForDeploymentTest.java

示例14: testMainMethodWithClassNameArg_classSimpleName

import com.sandwich.koan.suite.OnePassingKoan; //导入依赖的package包/类
@Test
public void testMainMethodWithClassNameArg_classSimpleName() throws Throwable {
	stubAllKoans(Arrays.asList(new OnePassingKoan()));
	new CommandLineArgumentRunner().run();
	assertSystemOutContains(KoanConstants.PASSING_SUITES+" "+OnePassingKoan.class.getSimpleName());
}
 
开发者ID:nkalupahana,项目名称:completed-koans,代码行数:7,代码来源:AppReadinessForDeploymentTest.java

示例15: passingSuites

import com.sandwich.koan.suite.OnePassingKoan; //导入依赖的package包/类
@Test
public void passingSuites() throws Throwable {
	stubAllKoans(Arrays.asList(new OnePassingKoan(), new OnePassingKoanDifferentName()));
	new CommandLineArgumentRunner().run();
	assertSystemOutContains(Strings.getMessage("passing_suites")+": OnePassingKoan, OnePassingKoanDifferentName");
}
 
开发者ID:nkalupahana,项目名称:completed-koans,代码行数:7,代码来源:ConsolePresenterTest.java


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