diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/java/org/apache/shardingsphere/sql/parser/integrate/asserts/SQLStatementAssert.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/java/org/apache/shardingsphere/sql/parser/integrate/asserts/SQLStatementAssert.java index a72e23d913865..d8e750413c211 100644 --- a/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/java/org/apache/shardingsphere/sql/parser/integrate/asserts/SQLStatementAssert.java +++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/java/org/apache/shardingsphere/sql/parser/integrate/asserts/SQLStatementAssert.java @@ -80,7 +80,7 @@ public static void assertIs(final SQLStatementAssertMessage assertMessage, final } private static void assertSelectStatement(final SQLStatementAssertMessage assertMessage, final SelectStatement actual, final ParserResult expected, final SQLCaseType sqlCaseType) { - ProjectionAssert.assertIs(assertMessage, actual.getProjections(), expected.getProjections(), sqlCaseType); + ProjectionAssert.assertIs(assertMessage, actual.getProjections(), expected.getProjections()); Optional groupBySegment = actual.getGroupBy(); if (groupBySegment.isPresent()) { GroupByAssert.assertIs(assertMessage, groupBySegment.get().getGroupByItems(), expected.getGroupByColumns()); diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/java/org/apache/shardingsphere/sql/parser/integrate/asserts/projection/ProjectionAssert.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/java/org/apache/shardingsphere/sql/parser/integrate/asserts/projection/ProjectionAssert.java index f9d296c1b1043..a3937d7739328 100644 --- a/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/java/org/apache/shardingsphere/sql/parser/integrate/asserts/projection/ProjectionAssert.java +++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/java/org/apache/shardingsphere/sql/parser/integrate/asserts/projection/ProjectionAssert.java @@ -40,7 +40,6 @@ import org.apache.shardingsphere.sql.parser.sql.segment.dml.pagination.rownum.ParameterMarkerRowNumberValueSegment; import org.apache.shardingsphere.sql.parser.sql.segment.dml.pagination.top.TopProjectionSegment; import org.apache.shardingsphere.sql.parser.sql.segment.generic.TableSegment; -import org.apache.shardingsphere.test.sql.SQLCaseType; import java.util.List; @@ -63,14 +62,13 @@ public final class ProjectionAssert { * @param assertMessage assert message * @param actual actual projection * @param expected expected projections - * @param sqlCaseType SQL case type */ - public static void assertIs(final SQLStatementAssertMessage assertMessage, final ProjectionsSegment actual, final ExpectedProjections expected, final SQLCaseType sqlCaseType) { + public static void assertIs(final SQLStatementAssertMessage assertMessage, final ProjectionsSegment actual, final ExpectedProjections expected) { assertProjections(assertMessage, actual, expected); List expectedProjections = expected.getExpectedProjections(); int count = 0; for (ProjectionSegment each : actual.getProjections()) { - assertProjection(assertMessage, each, expectedProjections.get(count), sqlCaseType); + assertProjection(assertMessage, each, expectedProjections.get(count)); count++; } } @@ -82,8 +80,7 @@ private static void assertProjections(final SQLStatementAssertMessage assertMess assertThat(assertMessage.getText("Projections stop index assertion error: "), actual.getStopIndex(), is(expected.getStopIndex())); } - private static void assertProjection(final SQLStatementAssertMessage assertMessage, final ProjectionSegment actual, final ExpectedProjection expected, final SQLCaseType sqlCaseType) { - String expectedText = SQLCaseType.Placeholder == sqlCaseType && null != expected.getParameterMarkerText() ? expected.getParameterMarkerText() : expected.getText(); + private static void assertProjection(final SQLStatementAssertMessage assertMessage, final ProjectionSegment actual, final ExpectedProjection expected) { if (actual instanceof ShorthandProjectionSegment) { assertThat(assertMessage.getText("Projection type assertion error: "), expected, instanceOf(ExpectedShorthandProjection.class)); assertShorthandProjection(assertMessage, (ShorthandProjectionSegment) actual, (ExpectedShorthandProjection) expected); diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/java/org/apache/shardingsphere/sql/parser/integrate/jaxb/projection/AbstractExpectedProjection.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/java/org/apache/shardingsphere/sql/parser/integrate/jaxb/projection/AbstractExpectedProjection.java index 3c11170f0241e..86d8faf69d933 100644 --- a/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/java/org/apache/shardingsphere/sql/parser/integrate/jaxb/projection/AbstractExpectedProjection.java +++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/java/org/apache/shardingsphere/sql/parser/integrate/jaxb/projection/AbstractExpectedProjection.java @@ -34,10 +34,4 @@ public abstract class AbstractExpectedProjection implements ExpectedProjection { @XmlAttribute(name = "stop-index") private int stopIndex; - - @XmlAttribute - private String text; - - @XmlAttribute(name = "parameter-marker-text") - private String parameterMarkerText; } diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/java/org/apache/shardingsphere/sql/parser/integrate/jaxb/projection/ExpectedProjection.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/java/org/apache/shardingsphere/sql/parser/integrate/jaxb/projection/ExpectedProjection.java index 42e47af3c80da..50a15c1ca1535 100644 --- a/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/java/org/apache/shardingsphere/sql/parser/integrate/jaxb/projection/ExpectedProjection.java +++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/java/org/apache/shardingsphere/sql/parser/integrate/jaxb/projection/ExpectedProjection.java @@ -32,18 +32,4 @@ public interface ExpectedProjection { * @return stop index */ int getStopIndex(); - - /** - * Get text. - * - * @return text - */ - String getText(); - - /** - * Get parameter marker text. - * - * @return parameter marker text - */ - String getParameterMarkerText(); } diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/resources/sql/dml/select.xml b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/resources/sql/dml/select.xml index f29011730b7ec..0c6a0d1fe945d 100644 --- a/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/resources/sql/dml/select.xml +++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/resources/sql/dml/select.xml @@ -820,7 +820,7 @@ - + @@ -829,7 +829,7 @@
- + diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/resources/sql/dml/select_aggregate.xml b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/resources/sql/dml/select_aggregate.xml index 8a1fcfa8ea95a..bcc7cbabfceb9 100644 --- a/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/resources/sql/dml/select_aggregate.xml +++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/resources/sql/dml/select_aggregate.xml @@ -58,7 +58,7 @@
- + @@ -76,7 +76,7 @@
- + @@ -86,7 +86,7 @@
- + @@ -108,7 +108,7 @@
- + @@ -129,7 +129,7 @@
- + diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/resources/sql/dml/select_group_by.xml b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/resources/sql/dml/select_group_by.xml index 8a64fa0b848e7..4ef6c0e242ba5 100644 --- a/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/resources/sql/dml/select_group_by.xml +++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/resources/sql/dml/select_group_by.xml @@ -102,7 +102,7 @@
- + @@ -119,7 +119,7 @@
- + @@ -160,7 +160,7 @@ - + @@ -194,7 +194,7 @@ - + @@ -214,7 +214,7 @@
- + @@ -227,7 +227,7 @@
- + diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/resources/sql/dml/select_join.xml b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/resources/sql/dml/select_join.xml index 833f54e6ea217..5d6a854ce7f7c 100644 --- a/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/resources/sql/dml/select_join.xml +++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/resources/sql/dml/select_join.xml @@ -30,8 +30,8 @@ - - + + @@ -42,8 +42,8 @@
- - + + @@ -61,8 +61,8 @@
- - + + diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/resources/sql/dml/select_order_by.xml b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/resources/sql/dml/select_order_by.xml index f1ddd09051ad2..fc62a5a0c00e3 100644 --- a/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/resources/sql/dml/select_order_by.xml +++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/resources/sql/dml/select_order_by.xml @@ -201,10 +201,10 @@
- + - + diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/resources/sql/dml/select_sub_query.xml b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/resources/sql/dml/select_sub_query.xml index c39065070d7c8..092de93a2528c 100644 --- a/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/resources/sql/dml/select_sub_query.xml +++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/resources/sql/dml/select_sub_query.xml @@ -38,8 +38,8 @@
- - + + @@ -51,7 +51,7 @@
- +