コード例 #1
0
ファイル: DropTest.java プロジェクト: Stefanic/Achilles
  @Test
  public void should_fail_if_table_name_is_a_reserved_keyword() throws Exception {
    exception.expect(IllegalArgumentException.class);
    exception.expectMessage("The table name 'add' is not allowed because it is a reserved keyword");

    SchemaBuilder.dropTable("add").build();
  }
コード例 #2
0
ファイル: DropTest.java プロジェクト: Stefanic/Achilles
  @Test
  public void should_drop_table_with_keyspace_if_exists() throws Exception {
    // When
    final String built = SchemaBuilder.dropTable("ks", "test").ifExists(true).build();

    // Then
    assertThat(built).isEqualTo("DROP TABLE IF EXISTS ks.test");
  }
コード例 #3
0
ファイル: DropTest.java プロジェクト: Stefanic/Achilles
  @Test
  public void should_drop_table() throws Exception {
    // When
    final String built = SchemaBuilder.dropTable("test").build();

    // Then
    assertThat(built).isEqualTo("DROP TABLE test");
  }