-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
statement.split(";") cannot be used with strings which contains symbo… #24
Merged
Merged
Changes from 12 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
a07944d
Fix the fork me on github link
djarnis73 0eebc51
Add section in usage about how to override the cassandra version
djarnis73 ef04baf
Fix some typos and broken links in the documentation
djarnis73 812f591
Add config parameter cqlEncoding that will be used when reading the c…
djarnis73 f621d71
Ooops, comitted stuf that is completely broken. Use String instead of…
djarnis73 20bb23f
Merge remote-tracking branch 'upstream/master'
djarnis73 26da8de
Merge remote-tracking branch 'upstream/master'
djarnis73 f82e291
Merge branch 'master' into feature/parse_using_cql_lexer
djarnis73 45bf3c4
statement.split(";") cannot be used with strings which contains symbo…
urvanov-ru 0ed68b2
Add useCqlLexer option
djarnis73 967e5d6
useCqlLexer fix use of comments
urvanov-ru 65a45da
Merge branch 'feature/parse_using_cql_lexer' into cql-split-fix
urvanov-ru 631d355
removed unnecessary stars log warn.
urvanov-ru 9e2687e
useCqlLexer since 3.7 not 3.6
urvanov-ru File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
src/test/java/org/codehaus/mojo/cassandra/AbstractCqlExecMojoTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package org.codehaus.mojo.cassandra; | ||
|
||
import org.junit.Test; | ||
|
||
import static org.junit.Assert.*; | ||
|
||
public class AbstractCqlExecMojoTest { | ||
|
||
@Test | ||
public void splitStatementsUsingCqlLexerWithSemicolonTest() { | ||
splitStatementsUsingCqlLexerTest("SELECT * FROM tbl1 WHERE col1 = 'abc1;def1';SELECT * FROM tbl2 WHERE col2 = 'abc2;def2';", "SELECT * FROM tbl1 WHERE col1 = 'abc1;def1';", "SELECT * FROM tbl2 WHERE col2 = 'abc2;def2';"); | ||
} | ||
|
||
@Test | ||
public void splitStatementsUsingCqlLexerWithCommentTest() { | ||
splitStatementsUsingCqlLexerTest("--\nSELECT * FROM tbl1 WHERE col1 = '--';", "SELECT * FROM tbl1 WHERE col1 = '--';"); | ||
} | ||
|
||
@Test | ||
public void splitStatementsUsingCqlLexerWithEmptyInput() { | ||
splitStatementsUsingCqlLexerTest(""); | ||
splitStatementsUsingCqlLexerTest(";;;", ";", ";", ";"); | ||
} | ||
|
||
public void splitStatementsUsingCqlLexerTest(String input, String...expected) { | ||
String[] split = AbstractCqlExecMojo.splitStatementsUsingCqlLexer(input); | ||
assertEquals("Split does not match expected number of statements", expected.length, split.length); | ||
for (int i = 0; i < expected.length; i++) { | ||
assertEquals(expected[i], split[i]); | ||
} | ||
} | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since should be bumped to 3.7, since 3.6 is already released.