From f317d21f04d7df7033c475d6b3c655b04e9203da Mon Sep 17 00:00:00 2001 From: mpollack Date: Thu, 20 Dec 2012 03:45:42 +0800 Subject: [PATCH] Fix Bootstrap test by not staring the shell and hence other threads that block the completion of tests run via gradle --- .../org/springframework/shell/BootstrapTest.java | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/src/test/java/org/springframework/shell/BootstrapTest.java b/src/test/java/org/springframework/shell/BootstrapTest.java index 199ef831..623b28cd 100644 --- a/src/test/java/org/springframework/shell/BootstrapTest.java +++ b/src/test/java/org/springframework/shell/BootstrapTest.java @@ -1,7 +1,5 @@ package org.springframework.shell; -import static org.junit.Assert.*; - import java.io.IOException; import java.util.logging.Logger; @@ -9,24 +7,18 @@ import junit.framework.Assert; import org.junit.Test; import org.springframework.shell.core.JLineShellComponent; -import org.springframework.shell.event.ShellStatus; -import org.springframework.shell.event.ShellStatus.Status; import org.springframework.shell.support.logging.HandlerUtils; public class BootstrapTest { @Test - public void test() throws IOException, InterruptedException { + public void test() throws IOException { try { Bootstrap bootstrap = new Bootstrap(null); JLineShellComponent shell = bootstrap.getJLineShellComponent(); - shell.start(); - while (shell.getShellStatus().getStatus() != ShellStatus.Status.USER_INPUT) { - Thread.sleep(100); - } + System.out.println("about to start shell..."); Assert.assertEquals("Number of CommandMarkers is incorrect", 4, shell.getSimpleParser().getCommandMarkers().size()); - Assert.assertEquals("Number of Converters is incorrect", 16, shell.getSimpleParser().getConverters().size()); - shell.stop(); + Assert.assertEquals("Number of Converters is incorrect", 16, shell.getSimpleParser().getConverters().size()); } catch (RuntimeException t) { throw t; } finally {