Skip to content

chore removing system.out.println lines + minor clean up of unit test scripts #2060

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

Merged
merged 2 commits into from
Aug 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ void testNewLineNotGoIssue() throws JSQLParserException {
void testOracleBlock() throws JSQLParserException {
String sqlStr = "BEGIN\n" + "\n" + "SELECT * FROM TABLE;\n" + "\n" + "END\n" + "/\n";
Statement statement = TestUtils.assertSqlCanBeParsedAndDeparsed(sqlStr, true);
System.out.println(statement);
}

@Test
Expand All @@ -69,14 +68,12 @@ void testSOQLIncludes() throws JSQLParserException {
String sqlStr =
"select name,\ngoods from test_table where option includes ('option1', 'option2')";
Statement statement = TestUtils.assertSqlCanBeParsedAndDeparsed(sqlStr, true);
System.out.println(statement);
}

@Test
void testSOQLExcludes() throws JSQLParserException {
String sqlStr =
"select name,\ngoods from test_table where option excludes ('option1', 'option2')";
Statement statement = TestUtils.assertSqlCanBeParsedAndDeparsed(sqlStr, true);
System.out.println(statement);
}
}
21 changes: 12 additions & 9 deletions src/test/java/net/sf/jsqlparser/statement/alter/AlterTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,14 @@ public void testAlterTableAddColumn_ColumnKeyWordImplicit() throws JSQLParserExc
@Test
public void testAlterTableBackBrackets() throws JSQLParserException {
String sql = "ALTER TABLE tablename add column (field string comment 'aaaaa')";
Statement statement = CCJSqlParserUtil.parse(sql);
Alter alter = (Alter) statement;
System.out.println(alter.toString());
Alter alter = (Alter) assertSqlCanBeParsedAndDeparsed(sql);
assertEquals("tablename", alter.getTable().toString());

String sql2 =
"ALTER TABLE tablename add column (field string comment 'aaaaa', field2 string comment 'bbbbb');";
Statement statement2 = CCJSqlParserUtil.parse(sql2);
Alter alter2 = (Alter) statement2;
System.out.println(alter2.toString());
assertEquals("tablename", alter2.getTable().toString());
}


Expand Down Expand Up @@ -1025,20 +1024,24 @@ public void testIssue1875() throws JSQLParserException {
}

@Test
public void testIssue2027() throws JSQLParserException{
public void testIssue2027() throws JSQLParserException {
String sql = "ALTER TABLE `foo_bar` ADD COLUMN `baz` text";
assertSqlCanBeParsedAndDeparsed(sql);

String sqlText = "ALTER TABLE `foo_bar` ADD COLUMN `baz` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL";
String sqlText =
"ALTER TABLE `foo_bar` ADD COLUMN `baz` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL";
assertSqlCanBeParsedAndDeparsed(sqlText);

String sqlTinyText = "ALTER TABLE `foo_bar` ADD COLUMN `baz` tinytext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL";
String sqlTinyText =
"ALTER TABLE `foo_bar` ADD COLUMN `baz` tinytext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL";
assertSqlCanBeParsedAndDeparsed(sqlTinyText);

String sqlMediumText = "ALTER TABLE `foo_bar` ADD COLUMN `baz` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL";
String sqlMediumText =
"ALTER TABLE `foo_bar` ADD COLUMN `baz` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL";
assertSqlCanBeParsedAndDeparsed(sqlMediumText);

String sqlLongText = "ALTER TABLE `foo_bar` ADD COLUMN `baz` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL";
String sqlLongText =
"ALTER TABLE `foo_bar` ADD COLUMN `baz` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL";
assertSqlCanBeParsedAndDeparsed(sqlLongText);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,6 @@ public void testOracleMergeIntoStatement() throws JSQLParserException {
+ " INSERT (B.employee_id, B.bonus)\n"
+ " VALUES (E.employee_id, E.salary * 0.05) ";

Statement statement = CCJSqlParserUtil.parse(sql);

System.out.println(statement.toString());

assertSqlCanBeParsedAndDeparsed(sql, true);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4539,13 +4539,6 @@ public void testLongQualifiedNamesIssue763() throws JSQLParserException {
"SELECT mongodb.test.test.intField, postgres.test.test.intField, postgres.test.test.datefield FROM mongodb.test.test JOIN postgres.postgres.test.test ON mongodb.test.test.intField = postgres.test.test.intField WHERE mongodb.test.test.intField = 123");
}

@Test
public void testLongQualifiedNamesIssue763_2() throws JSQLParserException {
Statement parse = CCJSqlParserUtil.parse(new StringReader(
"SELECT mongodb.test.test.intField, postgres.test.test.intField, postgres.test.test.datefield FROM mongodb.test.test JOIN postgres.postgres.test.test ON mongodb.test.test.intField = postgres.test.test.intField WHERE mongodb.test.test.intField = 123"));
System.out.println(parse.toString());
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test method is a duplicate of the one above


@Test
public void testSubQueryAliasIssue754() throws JSQLParserException {
assertSqlCanBeParsedAndDeparsed(
Expand Down
Loading