Package restructure
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.zero.cli;
|
||||
package org.springframework.cli;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.PrintStream;
|
||||
@@ -30,7 +30,7 @@ import org.junit.Before;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
import org.springframework.zero.cli.command.RunCommand;
|
||||
import org.springframework.cli.command.RunCommand;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
@@ -85,7 +85,7 @@ public class SampleIntegrationTests {
|
||||
|
||||
@BeforeClass
|
||||
public static void clean() {
|
||||
// SpringZeroCli.main("clean");
|
||||
// SpringCli.main("clean");
|
||||
// System.setProperty("ivy.message.logger.level", "3");
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package org.springframework.zero.cli;
|
||||
package org.springframework.cli;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.EnumSet;
|
||||
@@ -10,11 +10,11 @@ import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
import org.mockito.Mock;
|
||||
import org.mockito.MockitoAnnotations;
|
||||
import org.springframework.zero.cli.Command;
|
||||
import org.springframework.zero.cli.NoSuchCommandException;
|
||||
import org.springframework.zero.cli.SpringZeroCli;
|
||||
import org.springframework.zero.cli.SpringZeroCli.NoArgumentsException;
|
||||
import org.springframework.zero.cli.SpringZeroCli.NoHelpCommandArgumentsException;
|
||||
import org.springframework.cli.Command;
|
||||
import org.springframework.cli.NoSuchCommandException;
|
||||
import org.springframework.cli.SpringCli;
|
||||
import org.springframework.cli.SpringCli.NoArgumentsException;
|
||||
import org.springframework.cli.SpringCli.NoHelpCommandArgumentsException;
|
||||
|
||||
import static org.hamcrest.Matchers.equalTo;
|
||||
import static org.junit.Assert.assertThat;
|
||||
@@ -23,17 +23,17 @@ import static org.mockito.BDDMockito.willThrow;
|
||||
import static org.mockito.Mockito.verify;
|
||||
|
||||
/**
|
||||
* Tests for {@link SpringZeroCli}.
|
||||
* Tests for {@link SpringCli}.
|
||||
*
|
||||
* @author Phillip Webb
|
||||
* @author Dave Syer
|
||||
*/
|
||||
public class SpringZeroCliTests {
|
||||
public class SpringCliTests {
|
||||
|
||||
@Rule
|
||||
public ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
private SpringZeroCli cli;
|
||||
private SpringCli cli;
|
||||
|
||||
@Mock
|
||||
private Command regularCommand;
|
||||
@@ -43,23 +43,23 @@ public class SpringZeroCliTests {
|
||||
@Before
|
||||
public void setup() {
|
||||
MockitoAnnotations.initMocks(this);
|
||||
this.cli = new SpringZeroCli() {
|
||||
this.cli = new SpringCli() {
|
||||
|
||||
@Override
|
||||
protected void showUsage() {
|
||||
SpringZeroCliTests.this.calls.add(Call.SHOW_USAGE);
|
||||
SpringCliTests.this.calls.add(Call.SHOW_USAGE);
|
||||
super.showUsage();
|
||||
};
|
||||
|
||||
@Override
|
||||
protected void errorMessage(String message) {
|
||||
SpringZeroCliTests.this.calls.add(Call.ERROR_MESSAGE);
|
||||
SpringCliTests.this.calls.add(Call.ERROR_MESSAGE);
|
||||
super.errorMessage(message);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void printStackTrace(Exception ex) {
|
||||
SpringZeroCliTests.this.calls.add(Call.PRINT_STACK_TRACE);
|
||||
SpringCliTests.this.calls.add(Call.PRINT_STACK_TRACE);
|
||||
super.printStackTrace(ex);
|
||||
}
|
||||
};
|
||||
@@ -14,12 +14,14 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.zero.cli.command;
|
||||
package org.springframework.cli.command;
|
||||
|
||||
import groovy.lang.GroovyObjectSupport;
|
||||
import groovy.lang.Script;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.springframework.cli.command.OptionHandler;
|
||||
import org.springframework.cli.command.ScriptCommand;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotSame;
|
||||
@@ -1,5 +1,5 @@
|
||||
def run = { msg ->
|
||||
org.springframework.zero.cli.command.ScriptCommandTests.executed = true
|
||||
org.springframework.cli.command.ScriptCommandTests.executed = true
|
||||
println "Hello ${msg}"
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ class TestCommand implements Command {
|
||||
String usageHelp = "Not very useful"
|
||||
|
||||
void run(String... args) {
|
||||
org.springframework.zero.cli.command.ScriptCommandTests.executed = true
|
||||
org.springframework.cli.command.ScriptCommandTests.executed = true
|
||||
println "Hello ${args[0]}"
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ class TestCommand extends OptionHandler {
|
||||
void run(OptionSet options) {
|
||||
// Demonstrate use of Grape.grab to load dependencies before running
|
||||
println "Clean : " + Git.open(".." as File).status().call().isClean()
|
||||
org.springframework.zero.cli.command.ScriptCommandTests.executed = true
|
||||
org.springframework.cli.command.ScriptCommandTests.executed = true
|
||||
println "Hello ${options.nonOptionArguments()}: ${options.has('foo')}"
|
||||
}
|
||||
|
||||
|
||||
@@ -2,5 +2,5 @@ void options() {
|
||||
option "foo", "Foo set"
|
||||
}
|
||||
|
||||
org.springframework.zero.cli.command.ScriptCommandTests.executed = true
|
||||
org.springframework.cli.command.ScriptCommandTests.executed = true
|
||||
println "Hello ${options.nonOptionArguments()}: ${options.has('foo')}"
|
||||
|
||||
@@ -4,7 +4,7 @@ class TestCommand implements Runnable {
|
||||
this.msg = msg
|
||||
}
|
||||
void run() {
|
||||
org.springframework.zero.cli.command.ScriptCommandTests.executed = true
|
||||
org.springframework.cli.command.ScriptCommandTests.executed = true
|
||||
println "Hello ${msg}"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,5 +3,5 @@ options {
|
||||
option "bar", "Bar has an argument of type int" withOptionalArg() ofType Integer
|
||||
}
|
||||
|
||||
org.springframework.zero.cli.command.ScriptCommandTests.executed = true
|
||||
org.springframework.cli.command.ScriptCommandTests.executed = true
|
||||
println "Hello ${options.nonOptionArguments()}: ${options.has('foo')} ${options.valueOf('bar')}"
|
||||
|
||||
@@ -4,6 +4,7 @@ log4j.appender.stdout=org.apache.log4j.ConsoleAppender
|
||||
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
|
||||
log4j.appender.stdout.layout.ConversionPattern=%d %p [%c] - <%m>%n
|
||||
|
||||
log4j.category.org.springframework.zero=DEBUG
|
||||
log4j.category.org.springframework.autoconfigure=DEBUG
|
||||
log4j.category.org.springframework.bootstrap=DEBUG
|
||||
#log4j.category.org.springframework.integration.dsl=DEBUG
|
||||
#log4j.category.org.springframework.amqp=DEBUG
|
||||
|
||||
Reference in New Issue
Block a user