Skip to content

Commit

Permalink
Fix random test failure
Browse files Browse the repository at this point in the history
  • Loading branch information
doanduyhai committed Jan 14, 2016
1 parent a2d831b commit 36e3bdb
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 4 deletions.
1 change: 0 additions & 1 deletion cassandra/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@
</dependency>
</dependencies>


<build>
<plugins>
<!-- Plugin to compile Scala code -->
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.datastax.driver.core

case class TableMetadataWrapper(val meta: TableMetadata) {
def exportTableOnlyAsString(): String = {
meta.asCQLQuery(true)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ object DisplaySystem {
val indicesAsCQL = indicesDetails.map(_.asCQL).mkString("\n")

engine.layout(TABLE_DETAILS_TEMPLATE,
Map[String, Any]("tableDetails" -> TableDetails(tableName, columnsDetails, indicesDetails, meta.exportAsString(), indicesAsCQL), "withCaption" -> withCaption))
Map[String, Any]("tableDetails" -> TableDetails(tableName, columnsDetails, indicesDetails, TableMetadataWrapper(meta).exportTableOnlyAsString(), indicesAsCQL), "withCaption" -> withCaption))
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -599,6 +599,27 @@ public void should_describe_aggregate() throws Exception {
assertThat(actual.code()).isEqualTo(Code.SUCCESS);

}

@Test
@Ignore
//TODO activate test when using Java 8 and C* 3.x
public void should_describe_materialized_view() throws Exception {
//Given
Properties properties = new Properties();
properties.setProperty(CASSANDRA_HOSTS, "127.0.0.1");
properties.setProperty(CASSANDRA_PORT, "9042");
Interpreter interpreter = new CassandraInterpreter(properties);
interpreter.open();

final String query = "DESCRIBE MATERIALIZED VIEWS;";

//When
final InterpreterResult actual = interpreter.interpret(query, intrContext);

//Then
assertThat(actual.code()).isEqualTo(Code.SUCCESS);
}

@Test
public void should_describe_table() throws Exception {
//Given
Expand Down

0 comments on commit 36e3bdb

Please sign in to comment.