Package com.codahale.shore

Examples of com.codahale.shore.HelpCommand


    @Test
    public void itReturnsAHelpCommandWithServerOptions() throws Exception {
      final Runnable runnable = parse("server", "--ffffuuuuu");
      assertThat(runnable, is(HelpCommand.class));

      final HelpCommand cmd = (HelpCommand) runnable;
      assertThat(cmd.getOutputStream(), is(sameInstance((OutputStream) System.out)));
      assertThat(cmd.getText(), is(
        "Error: Unrecognized option: --ffffuuuuu\n" +
        "\n" +
        "usage: shoretest server -c <file> -p <port>\n" +
        "   -c, --config=FILE    Which Hibernate config file to use\n" +
        "   -h, --host=HOST      Which hostname to listen on\n" +
View Full Code Here


    @Test
    public void itReturnsAHelpCommandWithServerOptions() throws Exception {
      final Runnable runnable = parse("server", "--config=src/test/resources/hsql-memory.properties", "--port=808f0");
      assertThat(runnable, is(HelpCommand.class));

      final HelpCommand cmd = (HelpCommand) runnable;
      assertThat(cmd.getOutputStream(), is(sameInstance((OutputStream) System.out)));
      assertThat(cmd.getText(), is(
        "Error: Invalid port number\n" +
        "\n" +
        "usage: shoretest server -c <file> -p <port>\n" +
        "   -c, --config=FILE    Which Hibernate config file to use\n" +
        "   -h, --host=HOST      Which hostname to listen on\n" +
View Full Code Here

    @Test
    public void itReturnsAHelpCommandWithSchemaOptions() throws Exception {
      final Runnable runnable = parse("schema");
      assertThat(runnable, is(HelpCommand.class));

      final HelpCommand cmd = (HelpCommand) runnable;
      assertThat(cmd.getOutputStream(), is(sameInstance((OutputStream) System.out)));
      assertThat(cmd.getText(), is(
        "usage: shoretest schema -c <file> [--migration]\n" +
        "   -c, --config=FILE    Which Hibernate config file to use\n" +
        "   --migration          Generate a migration script"
      ));
    }
View Full Code Here

    @Test
    public void itReturnsAHelpCommandWithSchemaOptions() throws Exception {
      final Runnable runnable = parse("schema", "-h");
      assertThat(runnable, is(HelpCommand.class));

      final HelpCommand cmd = (HelpCommand) runnable;
      assertThat(cmd.getOutputStream(), is(sameInstance((OutputStream) System.out)));
      assertThat(cmd.getText(), is(
        "usage: shoretest schema -c <file> [--migration]\n" +
        "   -c, --config=FILE    Which Hibernate config file to use\n" +
        "   --migration          Generate a migration script"
      ));
    }
View Full Code Here

    @Test
    public void itReturnsAHelpCommandWithSchemaOptions() throws Exception {
      final Runnable runnable = parse("schema", "--help");
      assertThat(runnable, is(HelpCommand.class));

      final HelpCommand cmd = (HelpCommand) runnable;
      assertThat(cmd.getOutputStream(), is(sameInstance((OutputStream) System.out)));
      assertThat(cmd.getText(), is(
        "usage: shoretest schema -c <file> [--migration]\n" +
        "   -c, --config=FILE    Which Hibernate config file to use\n" +
        "   --migration          Generate a migration script"
      ));
    }
View Full Code Here

    @Test
    public void itReturnsAHelpCommandWithSchemaOptions() throws Exception {
      final Runnable runnable = parse("schema", "--config=src/test/resources/not-here.properties");
      assertThat(runnable, is(HelpCommand.class));

      final HelpCommand cmd = (HelpCommand) runnable;
      assertThat(cmd.getOutputStream(), is(sameInstance((OutputStream) System.out)));
      assertThat(cmd.getText(), is(
        "Error: Config file does not exist\n" +
        "\n" +
        "usage: shoretest schema -c <file> [--migration]\n" +
        "   -c, --config=FILE    Which Hibernate config file to use\n" +
        "   --migration          Generate a migration script"
View Full Code Here

    @Test
    public void itReturnsAHelpCommandWithSchemaOptions() throws Exception {
      final Runnable runnable = parse("schema", "--ffffuuuuu");
      assertThat(runnable, is(HelpCommand.class));

      final HelpCommand cmd = (HelpCommand) runnable;
      assertThat(cmd.getOutputStream(), is(sameInstance((OutputStream) System.out)));
      assertThat(cmd.getText(), is(
        "Error: Unrecognized option: --ffffuuuuu\n" +
        "\n" +
        "usage: shoretest schema -c <file> [--migration]\n" +
        "   -c, --config=FILE    Which Hibernate config file to use\n" +
        "   --migration          Generate a migration script"
View Full Code Here

TOP

Related Classes of com.codahale.shore.HelpCommand

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.