本文整理汇总了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());
}
示例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();
}
示例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());
}
示例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();
}
示例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);
}
示例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");
}
示例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());
}
示例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());
}
示例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"));
}
示例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");
}
示例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());
}
示例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");
}
示例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());
}
示例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());
}
示例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");
}