kikocis/java-driver public
Changesets · Branches · Tags · Compare
| Changeset | b3c17058c9fde9c2bfc9c8cb334ede0ef1c661e13ad90e096f7f017f9c45b41d |
|---|---|
| Author | olim7t <omichallat+github@gmail.com> · 2015-03-06 17:41 -08:00 |
| Committer | olim7t <omichallat+github@gmail.com> · 2015-03-06 17:44 -08:00 |
| Parents | 6d11ee2041a6 |
1 file changed
added driver-core/src/test/java/com/datastax/driver/core/TableMetadataTest.java +25 −0
| @@ -0,0 +1,25 @@ | ||
| 1 | +package com.datastax.driver.core; | |
| 2 | + | |
| 3 | +import java.util.Collection; | |
| 4 | + | |
| 5 | +import com.google.common.collect.Lists; | |
| 6 | +import org.testng.annotations.Test; | |
| 7 | + | |
| 8 | +import static org.assertj.core.api.Assertions.assertThat; | |
| 9 | + | |
| 10 | +public class TableMetadataTest extends CCMBridge.PerClassSingleNodeCluster { | |
| 11 | + @Override | |
| 12 | + protected Collection<String> getTableDefinitions() { | |
| 13 | + return Lists.newArrayList( | |
| 14 | + "CREATE TABLE single_quote (\n" | |
| 15 | + + " c1 int PRIMARY KEY\n" | |
| 16 | + + ") WITH comment = 'comment with single quote '' should work'" | |
| 17 | + ); | |
| 18 | + } | |
| 19 | + | |
| 20 | + @Test(groups = "short") | |
| 21 | + public void should_escape_single_quote_table_comment() { | |
| 22 | + TableMetadata table = cluster.getMetadata().getKeyspace("ks").getTable("single_quote"); | |
| 23 | + assertThat(table.asCQLQuery()).contains("comment with single quote '' should work"); | |
| 24 | + } | |
| 25 | +} | |
| No newline at the end of the file |