Package com.codahale.shore

Examples of com.codahale.shore.SchemaCommand


    @Test
    public void itReturnsAFullSchemaCommand() throws Exception {
      final Runnable runnable = parse("schema", "-c", "src/test/resources/hsql-memory.properties");
      assertThat(runnable, is(SchemaCommand.class));
     
      final SchemaCommand cmd = (SchemaCommand) runnable;
      assertThat(cmd.getOutputStream(), is(sameInstance((OutputStream) System.out)));
      assertThat(cmd.getConfiguration(), is(sameInstance(config)));
      assertThat(cmd.isMigration(), is(false));
      assertThat(cmd.getProperties().getProperty(Environment.URL), is("jdbc:hsqldb:mem:ShoreTest"));
    }
View Full Code Here


    @Test
    public void itReturnsAMigrationSchemaCommand() throws Exception {
      final Runnable runnable = parse("schema", "-c", "src/test/resources/hsql-memory.properties", "--migration");
      assertThat(runnable, is(SchemaCommand.class));
     
      final SchemaCommand cmd = (SchemaCommand) runnable;
      assertThat(cmd.getOutputStream(), is(sameInstance((OutputStream) System.out)));
      assertThat(cmd.getConfiguration(), is(sameInstance(config)));
      assertThat(cmd.isMigration(), is(true));
      assertThat(cmd.getProperties().getProperty(Environment.URL), is("jdbc:hsqldb:mem:ShoreTest"));
    }
View Full Code Here

    @Before
    public void setup() throws Exception {
      this.properties = new Properties();
      this.output = mock(OutputStream.class);
      this.configuration = new IntegrationTestConfig();
      this.cmd = new SchemaCommand(configuration, properties, true, output);
    }
View Full Code Here

      this.properties = new Properties();
      properties.load(new FileReader("src/test/resources/hsql-memory.properties"));
      properties.setProperty(Environment.URL, "jdbc:hsqldb:mem:ShoreSchemaTest");
      this.output = new ByteArrayOutputStream();
      this.configuration = new IntegrationTestConfig();
      this.cmd = new SchemaCommand(configuration, properties, false, output);
    }
View Full Code Here

      this.properties = new Properties();
      properties.load(new FileReader("src/test/resources/hsql-memory.properties"));
      properties.setProperty(Environment.URL, "jdbc:hsqldb:mem:ShoreMigrationTest");
      this.output = new ByteArrayOutputStream();
      this.configuration = new IntegrationTestConfig();
      this.cmd = new SchemaCommand(configuration, properties, true, output);
    }
View Full Code Here

      this.properties = new Properties();
      properties.load(new FileReader("src/test/resources/hsql-memory.properties"));
      properties.setProperty(Environment.DRIVER, "org.hsqldbFAKE.jdbcDriver");
      this.output = new ByteArrayOutputStream();
      this.configuration = new IntegrationTestConfig();
      this.cmd = new SchemaCommand(configuration, properties, true, output);
    }
View Full Code Here

TOP

Related Classes of com.codahale.shore.SchemaCommand

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.