diff --git a/src/main/java/io/github/mbarre/schemacrawler/tool/linter/LinterTimeStampWithOutTimeZoneColumn.java b/src/main/java/io/github/mbarre/schemacrawler/tool/linter/LinterTimeStampWithOutTimeZoneColumn.java new file mode 100644 index 00000000..5b379dd6 --- /dev/null +++ b/src/main/java/io/github/mbarre/schemacrawler/tool/linter/LinterTimeStampWithOutTimeZoneColumn.java @@ -0,0 +1,95 @@ +package io.github.mbarre.schemacrawler.tool.linter; + +import java.sql.Connection; +import java.util.List; +import java.util.logging.Level; +import java.util.logging.Logger; + +import io.github.mbarre.schemacrawler.utils.LintUtils; + +/* + * #%L + * Additional SchemaCrawler Lints + * %% + * Copyright (C) 2015 - 2016 github + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * . + * #L% + */ + +import schemacrawler.schema.Column; +import schemacrawler.schema.Table; +import schemacrawler.tools.lint.BaseLinter; +import schemacrawler.tools.lint.LintSeverity; + +/** + * Linter to check if the column has any TimeStamp data type columns if so suggest to use TimeStamp with TimeZones - PostgreSQL reserved + * lint + * + * @author Bheem + * @since 1.0.0 + */ +public class LinterTimeStampWithOutTimeZoneColumn extends BaseLinter { + private static final Logger LOGGER = Logger.getLogger(LinterTimeStampWithOutTimeZoneColumn.class.getName()); + + /** + * The lint that test if column with TimeStamp data type alone used without TimeZone + * + */ + public LinterTimeStampWithOutTimeZoneColumn() { + super(); + setSeverity(LintSeverity.critical); + } + + /** + * Get the description + * + * @return the description + */ + + public String getDescription() { + return "Timestamp without time zone (timestamp) is not a permitted data type. Use timestamp with time zone (timestamptz)"; + } + + /** + * Get the summary + * + * @return the summary + */ + @Override + public String getSummary() { + return "Use timeStamptz instead of just TimeStamp"; + } + + /** + * The lint that does the job + * + * @param table + * table + * @param connection + * connection + */ + @Override + protected void lint(final Table table, final Connection connection) { + List columns = getColumns(table); + for (Column column : columns) { + LOGGER.log(Level.INFO, "Checking {0}...", column.getFullName()); + if (LintUtils.isSqlTypeTimeStampBased(column.getColumnDataType().getJavaSqlType().getVendorTypeNumber())) { + addLint(table, getDescription(), column.getFullName()); + } + } + } + +} diff --git a/src/main/java/io/github/mbarre/schemacrawler/utils/LintUtils.java b/src/main/java/io/github/mbarre/schemacrawler/utils/LintUtils.java index a8df4a2c..22fa62bf 100644 --- a/src/main/java/io/github/mbarre/schemacrawler/utils/LintUtils.java +++ b/src/main/java/io/github/mbarre/schemacrawler/utils/LintUtils.java @@ -124,6 +124,16 @@ public static final boolean isSqlTypeDateBased(int javaSqlType) { || javaSqlType == Types.TIMESTAMP || javaSqlType == Types.TIMESTAMP_WITH_TIMEZONE; } + + /** + * Tells whether a column is TimeStamp like type or not. + * @param javaSqlType the dataType + * @return is the sqlType is TimeStamp based or not + */ + public static final boolean isSqlTypeTimeStampBased(int javaSqlType) { + return javaSqlType == Types.TIMESTAMP; + } + public static Set generateSample(int sampleSize, Long totalRows){ Set sampleIndex = new HashSet<>(); diff --git a/src/main/resources/META-INF/services/schemacrawler.tools.lint.Linter b/src/main/resources/META-INF/services/schemacrawler.tools.lint.Linter index 948dd5e5..288c07a2 100644 --- a/src/main/resources/META-INF/services/schemacrawler.tools.lint.Linter +++ b/src/main/resources/META-INF/services/schemacrawler.tools.lint.Linter @@ -16,4 +16,5 @@ io.github.mbarre.schemacrawler.tool.linter.LinterForbiddenPrimaryKeyType io.github.mbarre.schemacrawler.tool.linter.LinterNoSpaceInNames io.github.mbarre.schemacrawler.tool.linter.LinterPluralTableName io.github.mbarre.schemacrawler.tool.linter.LinterLeftSpacePadding -io.github.mbarre.schemacrawler.tool.linter.LinterRightSpacePadding \ No newline at end of file +io.github.mbarre.schemacrawler.tool.linter.LinterRightSpacePadding +io.github.mbarre.schemacrawler.tool.linter.LinterTimeStampWithOutTimeZoneColumn \ No newline at end of file diff --git a/src/main/resources/schemacrawler-linter-config.xml b/src/main/resources/schemacrawler-linter-config.xml index 86cd56c2..2dbba11d 100644 --- a/src/main/resources/schemacrawler-linter-config.xml +++ b/src/main/resources/schemacrawler-linter-config.xml @@ -204,6 +204,7 @@ true + high @@ -221,5 +222,11 @@ high + + true + critical + + diff --git a/src/test/db/liquibase/LinterTimeStampWithOutTimeZoneColumn/db.changelog.xml b/src/test/db/liquibase/LinterTimeStampWithOutTimeZoneColumn/db.changelog.xml new file mode 100644 index 00000000..d2ee3131 --- /dev/null +++ b/src/test/db/liquibase/LinterTimeStampWithOutTimeZoneColumn/db.changelog.xml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + insert into test_timetsamp_type(id, content, created_at) values (1, 'timestamp_lint', current_timestamp) + + + + diff --git a/src/test/java/TestLintPlugin.java b/src/test/java/TestLintPlugin.java index 4c623e78..863f3357 100644 --- a/src/test/java/TestLintPlugin.java +++ b/src/test/java/TestLintPlugin.java @@ -45,6 +45,7 @@ public void testLintPlugin() throws Exception assertTrue(registry.hasLinter("io.github.mbarre.schemacrawler.tool.linter.LinterPluralTableName")); assertTrue(registry.hasLinter("io.github.mbarre.schemacrawler.tool.linter.LinterLeftSpacePadding")); assertTrue(registry.hasLinter("io.github.mbarre.schemacrawler.tool.linter.LinterRightSpacePadding")); + assertTrue(registry.hasLinter("io.github.mbarre.schemacrawler.tool.linter.LinterTimeStampWithOutTimeZoneColumn")); } } diff --git a/src/test/java/io/github/mbarre/schemacrawler/tool/linter/LinterTimeStampWithOutTimeZoneColumnTest.java b/src/test/java/io/github/mbarre/schemacrawler/tool/linter/LinterTimeStampWithOutTimeZoneColumnTest.java new file mode 100644 index 00000000..3d84d1cf --- /dev/null +++ b/src/test/java/io/github/mbarre/schemacrawler/tool/linter/LinterTimeStampWithOutTimeZoneColumnTest.java @@ -0,0 +1,72 @@ +package io.github.mbarre.schemacrawler.tool.linter; + +/*- + * #%L + * Additional SchemaCrawler Lints + * %% + * Copyright (C) 2015 - 2019 github + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * . + * #L% + */ + +import java.sql.Connection; +import java.sql.DriverManager; +import java.util.List; + +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +import io.github.mbarre.schemacrawler.test.utils.LintWrapper; +import io.github.mbarre.schemacrawler.test.utils.PostgreSqlDatabase; +import schemacrawler.schemacrawler.SchemaCrawlerOptions; +import schemacrawler.schemacrawler.SchemaCrawlerOptionsBuilder; +import schemacrawler.schemacrawler.SchemaInfoLevelBuilder; +import schemacrawler.tools.lint.LinterRegistry; + +public class LinterTimeStampWithOutTimeZoneColumnTest extends BaseLintTest { + + private static final String CHANGE_LOG_TIMESTAMP_CHECK = "src/test/db/liquibase/LinterTimeStampWithOutTimeZoneColumn/db.changelog.xml"; + private static PostgreSqlDatabase database; + + @BeforeClass + public static void init(){ + database = new PostgreSqlDatabase(); + database.setUp(CHANGE_LOG_TIMESTAMP_CHECK); + } + + @Test + public void testLint() throws Exception{ + + final LinterRegistry registry = new LinterRegistry(); + Assert.assertTrue(registry.hasLinter(LinterTimeStampWithOutTimeZoneColumn.class.getName())); + + final SchemaCrawlerOptions options = SchemaCrawlerOptionsBuilder.builder().withSchemaInfoLevel(SchemaInfoLevelBuilder.standard()).toOptions(); + + Connection connection = DriverManager.getConnection(PostgreSqlDatabase.CONNECTION_STRING, + PostgreSqlDatabase.USER_NAME, database.getPostgresPassword()); + + List lints = executeToJsonAndConvertToLintList(LinterTimeStampWithOutTimeZoneColumn.class.getSimpleName(), options, connection); + Assert.assertEquals(1,lints.size()); + int index = 0; + Assert.assertEquals(LinterTimeStampWithOutTimeZoneColumn.class.getName(), lints.get(index).getId()); + Assert.assertEquals("public.test_timetsamp_type.created_at", lints.get(index).getValue()); + Assert.assertEquals("Timestamp without time zone (timestamp) is not a permitted data type. Use timestamp with time zone (timestamptz)", lints.get(index).getDescription()); + Assert.assertEquals("critical", lints.get(index).getSeverity()); + + } + +} diff --git a/src/test/java/io/github/mbarre/schemacrawler/utils/LintUtilsTest.java b/src/test/java/io/github/mbarre/schemacrawler/utils/LintUtilsTest.java index e751dd5f..9ae45c01 100644 --- a/src/test/java/io/github/mbarre/schemacrawler/utils/LintUtilsTest.java +++ b/src/test/java/io/github/mbarre/schemacrawler/utils/LintUtilsTest.java @@ -1,5 +1,7 @@ package io.github.mbarre.schemacrawler.utils; +import java.sql.Types; + /* * #%L * Additional SchemaCrawler Lints @@ -25,235 +27,277 @@ import org.junit.Assert; import org.junit.Test; -import java.lang.reflect.Type; -import java.sql.Types; - /** * * @author salad74 */ public class LintUtilsTest { - - public LintUtilsTest() { - Assert.assertTrue(true); - } - + public LintUtilsTest() { + Assert.assertTrue(true); + } + + /** + * Test of isSqlTypeTextBased method, of class LintUtils. + */ + @Test + public void testIsSqlTypeTextBased() { + Assert.assertTrue(LintUtils.isSqlTypeTextBased(Types.NVARCHAR)); + Assert.assertTrue(LintUtils.isSqlTypeTextBased(Types.LONGNVARCHAR)); + Assert.assertTrue(LintUtils.isSqlTypeTextBased(Types.LONGVARCHAR)); + Assert.assertTrue(LintUtils.isSqlTypeTextBased(Types.CHAR)); + Assert.assertTrue(LintUtils.isSqlTypeTextBased(Types.NCHAR)); + Assert.assertTrue(LintUtils.isSqlTypeTextBased(Types.VARCHAR)); + + Assert.assertFalse(LintUtils.isSqlTypeTextBased(Types.BIGINT)); + Assert.assertFalse(LintUtils.isSqlTypeTextBased(Types.BINARY)); + Assert.assertFalse(LintUtils.isSqlTypeTextBased(Types.BIT)); + Assert.assertFalse(LintUtils.isSqlTypeTextBased(Types.ARRAY)); + Assert.assertFalse(LintUtils.isSqlTypeTextBased(Types.BLOB)); + Assert.assertFalse(LintUtils.isSqlTypeTextBased(Types.BOOLEAN)); + Assert.assertFalse(LintUtils.isSqlTypeTextBased(Types.CLOB)); + Assert.assertFalse(LintUtils.isSqlTypeTextBased(Types.DATALINK)); + Assert.assertFalse(LintUtils.isSqlTypeTextBased(Types.DATE)); + Assert.assertFalse(LintUtils.isSqlTypeTextBased(Types.DECIMAL)); + Assert.assertFalse(LintUtils.isSqlTypeTextBased(Types.DISTINCT)); + Assert.assertFalse(LintUtils.isSqlTypeTextBased(Types.DOUBLE)); + Assert.assertFalse(LintUtils.isSqlTypeTextBased(Types.FLOAT)); + Assert.assertFalse(LintUtils.isSqlTypeTextBased(Types.INTEGER)); + Assert.assertFalse(LintUtils.isSqlTypeTextBased(Types.JAVA_OBJECT)); + Assert.assertFalse(LintUtils.isSqlTypeTextBased(Types.LONGVARBINARY)); + Assert.assertFalse(LintUtils.isSqlTypeTextBased(Types.NCLOB)); + Assert.assertFalse(LintUtils.isSqlTypeTextBased(Types.NULL)); + Assert.assertFalse(LintUtils.isSqlTypeTextBased(Types.NUMERIC)); + Assert.assertFalse(LintUtils.isSqlTypeTextBased(Types.OTHER)); + Assert.assertFalse(LintUtils.isSqlTypeTextBased(Types.REAL)); + Assert.assertFalse(LintUtils.isSqlTypeTextBased(Types.SMALLINT)); + Assert.assertFalse(LintUtils.isSqlTypeTextBased(Types.SQLXML)); + Assert.assertFalse(LintUtils.isSqlTypeTextBased(Types.TIME)); + Assert.assertFalse(LintUtils.isSqlTypeTextBased(Types.TIMESTAMP)); + Assert.assertFalse(LintUtils.isSqlTypeTextBased(Types.TIMESTAMP_WITH_TIMEZONE)); + Assert.assertFalse(LintUtils.isSqlTypeTextBased(Types.TINYINT)); + Assert.assertFalse(LintUtils.isSqlTypeTextBased(Types.VARBINARY)); + Assert.assertFalse(LintUtils.isSqlTypeTimeStampBased(Types.TIME)); + } + + /** + * Test of testIsSqlTypeNumericBased method, of class LintUtils. + */ + @Test + public void testIsSqlTypeNumericBased() { + + Assert.assertTrue(LintUtils.isSqlTypeNumericBased(Types.BIGINT)); + Assert.assertTrue(LintUtils.isSqlTypeNumericBased(Types.DECIMAL)); + Assert.assertTrue(LintUtils.isSqlTypeNumericBased(Types.NUMERIC)); + Assert.assertTrue(LintUtils.isSqlTypeNumericBased(Types.REAL)); + Assert.assertTrue(LintUtils.isSqlTypeNumericBased(Types.SMALLINT)); + Assert.assertTrue(LintUtils.isSqlTypeNumericBased(Types.TINYINT)); + Assert.assertTrue(LintUtils.isSqlTypeNumericBased(Types.DOUBLE)); + Assert.assertTrue(LintUtils.isSqlTypeNumericBased(Types.FLOAT)); + Assert.assertTrue(LintUtils.isSqlTypeNumericBased(Types.INTEGER)); + + Assert.assertFalse(LintUtils.isSqlTypeNumericBased(Types.NVARCHAR)); + Assert.assertFalse(LintUtils.isSqlTypeNumericBased(Types.LONGNVARCHAR)); + Assert.assertFalse(LintUtils.isSqlTypeNumericBased(Types.LONGVARCHAR)); + Assert.assertFalse(LintUtils.isSqlTypeNumericBased(Types.CHAR)); + Assert.assertFalse(LintUtils.isSqlTypeNumericBased(Types.NCHAR)); + Assert.assertFalse(LintUtils.isSqlTypeNumericBased(Types.VARCHAR)); + Assert.assertFalse(LintUtils.isSqlTypeNumericBased(Types.BINARY)); + Assert.assertFalse(LintUtils.isSqlTypeNumericBased(Types.BIT)); + Assert.assertFalse(LintUtils.isSqlTypeNumericBased(Types.ARRAY)); + Assert.assertFalse(LintUtils.isSqlTypeNumericBased(Types.BLOB)); + Assert.assertFalse(LintUtils.isSqlTypeNumericBased(Types.BOOLEAN)); + Assert.assertFalse(LintUtils.isSqlTypeNumericBased(Types.CLOB)); + Assert.assertFalse(LintUtils.isSqlTypeNumericBased(Types.DATALINK)); + Assert.assertFalse(LintUtils.isSqlTypeNumericBased(Types.DATE)); + Assert.assertFalse(LintUtils.isSqlTypeNumericBased(Types.DISTINCT)); + Assert.assertFalse(LintUtils.isSqlTypeNumericBased(Types.JAVA_OBJECT)); + Assert.assertFalse(LintUtils.isSqlTypeNumericBased(Types.LONGVARBINARY)); + Assert.assertFalse(LintUtils.isSqlTypeNumericBased(Types.NCLOB)); + Assert.assertFalse(LintUtils.isSqlTypeNumericBased(Types.NULL)); + Assert.assertFalse(LintUtils.isSqlTypeNumericBased(Types.OTHER)); + Assert.assertFalse(LintUtils.isSqlTypeNumericBased(Types.SQLXML)); + Assert.assertFalse(LintUtils.isSqlTypeNumericBased(Types.TIME)); + Assert.assertFalse(LintUtils.isSqlTypeNumericBased(Types.TIMESTAMP)); + Assert.assertFalse(LintUtils.isSqlTypeNumericBased(Types.TIMESTAMP_WITH_TIMEZONE)); + Assert.assertFalse(LintUtils.isSqlTypeNumericBased(Types.VARBINARY)); + } + + /** + * Test of testIsSqlTypeNumericBased method, of class LintUtils. + */ + @Test + public void testIsSqlTypeIntegerBased() { + + Assert.assertTrue(LintUtils.isSqlTypeIntegerBased(Types.BIGINT)); + Assert.assertTrue(LintUtils.isSqlTypeIntegerBased(Types.INTEGER)); + Assert.assertTrue(LintUtils.isSqlTypeIntegerBased(Types.SMALLINT)); + Assert.assertTrue(LintUtils.isSqlTypeIntegerBased(Types.TINYINT)); + + Assert.assertFalse(LintUtils.isSqlTypeIntegerBased(Types.BINARY)); + Assert.assertFalse(LintUtils.isSqlTypeIntegerBased(Types.NVARCHAR)); + Assert.assertFalse(LintUtils.isSqlTypeIntegerBased(Types.LONGNVARCHAR)); + Assert.assertFalse(LintUtils.isSqlTypeIntegerBased(Types.LONGVARCHAR)); + Assert.assertFalse(LintUtils.isSqlTypeIntegerBased(Types.CHAR)); + Assert.assertFalse(LintUtils.isSqlTypeIntegerBased(Types.NCHAR)); + Assert.assertFalse(LintUtils.isSqlTypeIntegerBased(Types.VARCHAR)); + Assert.assertFalse(LintUtils.isSqlTypeIntegerBased(Types.BIT)); + Assert.assertFalse(LintUtils.isSqlTypeIntegerBased(Types.ARRAY)); + Assert.assertFalse(LintUtils.isSqlTypeIntegerBased(Types.BLOB)); + Assert.assertFalse(LintUtils.isSqlTypeIntegerBased(Types.BOOLEAN)); + Assert.assertFalse(LintUtils.isSqlTypeIntegerBased(Types.CLOB)); + Assert.assertFalse(LintUtils.isSqlTypeIntegerBased(Types.DATALINK)); + Assert.assertFalse(LintUtils.isSqlTypeIntegerBased(Types.DATE)); + Assert.assertFalse(LintUtils.isSqlTypeIntegerBased(Types.DECIMAL)); + Assert.assertFalse(LintUtils.isSqlTypeIntegerBased(Types.DISTINCT)); + Assert.assertFalse(LintUtils.isSqlTypeIntegerBased(Types.DOUBLE)); + Assert.assertFalse(LintUtils.isSqlTypeIntegerBased(Types.FLOAT)); + Assert.assertFalse(LintUtils.isSqlTypeIntegerBased(Types.JAVA_OBJECT)); + Assert.assertFalse(LintUtils.isSqlTypeIntegerBased(Types.LONGVARBINARY)); + Assert.assertFalse(LintUtils.isSqlTypeIntegerBased(Types.NCLOB)); + Assert.assertFalse(LintUtils.isSqlTypeIntegerBased(Types.NULL)); + Assert.assertFalse(LintUtils.isSqlTypeIntegerBased(Types.NUMERIC)); + Assert.assertFalse(LintUtils.isSqlTypeIntegerBased(Types.OTHER)); + Assert.assertFalse(LintUtils.isSqlTypeIntegerBased(Types.REAL)); + Assert.assertFalse(LintUtils.isSqlTypeIntegerBased(Types.SQLXML)); + Assert.assertFalse(LintUtils.isSqlTypeIntegerBased(Types.TIME)); + Assert.assertFalse(LintUtils.isSqlTypeIntegerBased(Types.TIMESTAMP)); + Assert.assertFalse(LintUtils.isSqlTypeIntegerBased(Types.TIMESTAMP_WITH_TIMEZONE)); + Assert.assertFalse(LintUtils.isSqlTypeIntegerBased(Types.VARBINARY)); + } + + /** + * Test of testIsSqlTypeNumericBased method, of class LintUtils. + */ + @Test + public void testIsSqlTypeBinaryBased() { + + Assert.assertTrue(LintUtils.isSqlTypeBinayBased(Types.BINARY)); + Assert.assertTrue(LintUtils.isSqlTypeBinayBased(Types.BLOB)); + Assert.assertTrue(LintUtils.isSqlTypeBinayBased(Types.LONGVARBINARY)); + Assert.assertTrue(LintUtils.isSqlTypeBinayBased(Types.VARBINARY)); + + Assert.assertFalse(LintUtils.isSqlTypeBinayBased(Types.BIGINT)); + Assert.assertFalse(LintUtils.isSqlTypeBinayBased(Types.DECIMAL)); + Assert.assertFalse(LintUtils.isSqlTypeBinayBased(Types.NUMERIC)); + Assert.assertFalse(LintUtils.isSqlTypeBinayBased(Types.REAL)); + Assert.assertFalse(LintUtils.isSqlTypeBinayBased(Types.SMALLINT)); + Assert.assertFalse(LintUtils.isSqlTypeBinayBased(Types.TINYINT)); + Assert.assertFalse(LintUtils.isSqlTypeBinayBased(Types.DOUBLE)); + Assert.assertFalse(LintUtils.isSqlTypeBinayBased(Types.FLOAT)); + Assert.assertFalse(LintUtils.isSqlTypeBinayBased(Types.INTEGER)); + Assert.assertFalse(LintUtils.isSqlTypeBinayBased(Types.NVARCHAR)); + Assert.assertFalse(LintUtils.isSqlTypeBinayBased(Types.LONGNVARCHAR)); + Assert.assertFalse(LintUtils.isSqlTypeBinayBased(Types.LONGVARCHAR)); + Assert.assertFalse(LintUtils.isSqlTypeBinayBased(Types.CHAR)); + Assert.assertFalse(LintUtils.isSqlTypeBinayBased(Types.NCHAR)); + Assert.assertFalse(LintUtils.isSqlTypeBinayBased(Types.VARCHAR)); + Assert.assertFalse(LintUtils.isSqlTypeBinayBased(Types.BIT)); + Assert.assertFalse(LintUtils.isSqlTypeBinayBased(Types.ARRAY)); + Assert.assertFalse(LintUtils.isSqlTypeBinayBased(Types.BOOLEAN)); + Assert.assertFalse(LintUtils.isSqlTypeBinayBased(Types.CLOB)); + Assert.assertFalse(LintUtils.isSqlTypeBinayBased(Types.DATALINK)); + Assert.assertFalse(LintUtils.isSqlTypeBinayBased(Types.DATE)); + Assert.assertFalse(LintUtils.isSqlTypeBinayBased(Types.DISTINCT)); + Assert.assertFalse(LintUtils.isSqlTypeBinayBased(Types.JAVA_OBJECT)); + Assert.assertFalse(LintUtils.isSqlTypeBinayBased(Types.NCLOB)); + Assert.assertFalse(LintUtils.isSqlTypeBinayBased(Types.NULL)); + Assert.assertFalse(LintUtils.isSqlTypeBinayBased(Types.OTHER)); + Assert.assertFalse(LintUtils.isSqlTypeBinayBased(Types.SQLXML)); + Assert.assertFalse(LintUtils.isSqlTypeBinayBased(Types.TIME)); + Assert.assertFalse(LintUtils.isSqlTypeBinayBased(Types.TIMESTAMP)); + Assert.assertFalse(LintUtils.isSqlTypeBinayBased(Types.TIMESTAMP_WITH_TIMEZONE)); + + } + + /** + * Test of testIsSqlTypeNumericBased method, of class LintUtils. + */ + @Test + public void testIsSqlTypeDateBased() { + Assert.assertTrue(LintUtils.isSqlTypeDateBased(Types.DATE)); + Assert.assertTrue(LintUtils.isSqlTypeDateBased(Types.TIME)); + Assert.assertTrue(LintUtils.isSqlTypeDateBased(Types.TIME_WITH_TIMEZONE)); + Assert.assertTrue(LintUtils.isSqlTypeDateBased(Types.TIMESTAMP)); + Assert.assertTrue(LintUtils.isSqlTypeDateBased(Types.TIMESTAMP_WITH_TIMEZONE)); + + Assert.assertFalse(LintUtils.isSqlTypeDateBased(Types.BINARY)); + Assert.assertFalse(LintUtils.isSqlTypeDateBased(Types.BLOB)); + Assert.assertFalse(LintUtils.isSqlTypeDateBased(Types.LONGVARBINARY)); + Assert.assertFalse(LintUtils.isSqlTypeDateBased(Types.VARBINARY)); + Assert.assertFalse(LintUtils.isSqlTypeDateBased(Types.BIGINT)); + Assert.assertFalse(LintUtils.isSqlTypeDateBased(Types.DECIMAL)); + Assert.assertFalse(LintUtils.isSqlTypeDateBased(Types.NUMERIC)); + Assert.assertFalse(LintUtils.isSqlTypeDateBased(Types.REAL)); + Assert.assertFalse(LintUtils.isSqlTypeDateBased(Types.SMALLINT)); + Assert.assertFalse(LintUtils.isSqlTypeDateBased(Types.TINYINT)); + Assert.assertFalse(LintUtils.isSqlTypeDateBased(Types.DOUBLE)); + Assert.assertFalse(LintUtils.isSqlTypeDateBased(Types.FLOAT)); + Assert.assertFalse(LintUtils.isSqlTypeDateBased(Types.INTEGER)); + Assert.assertFalse(LintUtils.isSqlTypeDateBased(Types.NVARCHAR)); + Assert.assertFalse(LintUtils.isSqlTypeDateBased(Types.LONGNVARCHAR)); + Assert.assertFalse(LintUtils.isSqlTypeDateBased(Types.LONGVARCHAR)); + Assert.assertFalse(LintUtils.isSqlTypeDateBased(Types.CHAR)); + Assert.assertFalse(LintUtils.isSqlTypeDateBased(Types.NCHAR)); + Assert.assertFalse(LintUtils.isSqlTypeDateBased(Types.VARCHAR)); + Assert.assertFalse(LintUtils.isSqlTypeDateBased(Types.BIT)); + Assert.assertFalse(LintUtils.isSqlTypeDateBased(Types.ARRAY)); + Assert.assertFalse(LintUtils.isSqlTypeDateBased(Types.BOOLEAN)); + Assert.assertFalse(LintUtils.isSqlTypeDateBased(Types.CLOB)); + Assert.assertFalse(LintUtils.isSqlTypeDateBased(Types.DATALINK)); + Assert.assertFalse(LintUtils.isSqlTypeDateBased(Types.DISTINCT)); + Assert.assertFalse(LintUtils.isSqlTypeDateBased(Types.JAVA_OBJECT)); + Assert.assertFalse(LintUtils.isSqlTypeDateBased(Types.NCLOB)); + Assert.assertFalse(LintUtils.isSqlTypeDateBased(Types.NULL)); + Assert.assertFalse(LintUtils.isSqlTypeDateBased(Types.OTHER)); + Assert.assertFalse(LintUtils.isSqlTypeDateBased(Types.SQLXML)); + } + + /** + * Test of testIsSqlTypeTimeStampBased method, of class LintUtils. + */ + @Test + public void testIsSqlTypeTimeStampBased() { + Assert.assertTrue(LintUtils.isSqlTypeTimeStampBased(Types.TIMESTAMP)); + + Assert.assertFalse(LintUtils.isSqlTypeTimeStampBased(Types.BINARY)); + Assert.assertFalse(LintUtils.isSqlTypeTimeStampBased(Types.BLOB)); + Assert.assertFalse(LintUtils.isSqlTypeTimeStampBased(Types.LONGVARBINARY)); + Assert.assertFalse(LintUtils.isSqlTypeTimeStampBased(Types.VARBINARY)); + Assert.assertFalse(LintUtils.isSqlTypeTimeStampBased(Types.BIGINT)); + Assert.assertFalse(LintUtils.isSqlTypeTimeStampBased(Types.DECIMAL)); + Assert.assertFalse(LintUtils.isSqlTypeTimeStampBased(Types.NUMERIC)); + Assert.assertFalse(LintUtils.isSqlTypeTimeStampBased(Types.REAL)); + Assert.assertFalse(LintUtils.isSqlTypeTimeStampBased(Types.SMALLINT)); + Assert.assertFalse(LintUtils.isSqlTypeTimeStampBased(Types.TINYINT)); + Assert.assertFalse(LintUtils.isSqlTypeTimeStampBased(Types.DOUBLE)); + Assert.assertFalse(LintUtils.isSqlTypeTimeStampBased(Types.FLOAT)); + Assert.assertFalse(LintUtils.isSqlTypeTimeStampBased(Types.INTEGER)); + Assert.assertFalse(LintUtils.isSqlTypeTimeStampBased(Types.NVARCHAR)); + Assert.assertFalse(LintUtils.isSqlTypeTimeStampBased(Types.LONGNVARCHAR)); + Assert.assertFalse(LintUtils.isSqlTypeTimeStampBased(Types.LONGVARCHAR)); + Assert.assertFalse(LintUtils.isSqlTypeTimeStampBased(Types.CHAR)); + Assert.assertFalse(LintUtils.isSqlTypeTimeStampBased(Types.NCHAR)); + Assert.assertFalse(LintUtils.isSqlTypeTimeStampBased(Types.VARCHAR)); + Assert.assertFalse(LintUtils.isSqlTypeTimeStampBased(Types.BIT)); + Assert.assertFalse(LintUtils.isSqlTypeTimeStampBased(Types.ARRAY)); + Assert.assertFalse(LintUtils.isSqlTypeTimeStampBased(Types.BOOLEAN)); + Assert.assertFalse(LintUtils.isSqlTypeTimeStampBased(Types.CLOB)); + Assert.assertFalse(LintUtils.isSqlTypeTimeStampBased(Types.DATALINK)); + Assert.assertFalse(LintUtils.isSqlTypeTimeStampBased(Types.DISTINCT)); + Assert.assertFalse(LintUtils.isSqlTypeTimeStampBased(Types.JAVA_OBJECT)); + Assert.assertFalse(LintUtils.isSqlTypeTimeStampBased(Types.NCLOB)); + Assert.assertFalse(LintUtils.isSqlTypeTimeStampBased(Types.NULL)); + Assert.assertFalse(LintUtils.isSqlTypeTimeStampBased(Types.OTHER)); + Assert.assertFalse(LintUtils.isSqlTypeTimeStampBased(Types.SQLXML)); + Assert.assertFalse(LintUtils.isSqlTypeTimeStampBased(Types.DATE)); + Assert.assertFalse(LintUtils.isSqlTypeTimeStampBased(Types.TIME)); + Assert.assertFalse(LintUtils.isSqlTypeTimeStampBased(Types.TIME_WITH_TIMEZONE)); + Assert.assertFalse(LintUtils.isSqlTypeTimeStampBased(Types.TIMESTAMP_WITH_TIMEZONE)); - /** - * Test of isSqlTypeTextBased method, of class LintUtils. - */ - @Test - public void testIsSqlTypeTextBased() { - Assert.assertTrue(LintUtils.isSqlTypeTextBased(Types.NVARCHAR)); - Assert.assertTrue(LintUtils.isSqlTypeTextBased(Types.LONGNVARCHAR)); - Assert.assertTrue(LintUtils.isSqlTypeTextBased(Types.LONGVARCHAR)); - Assert.assertTrue(LintUtils.isSqlTypeTextBased(Types.CHAR)); - Assert.assertTrue(LintUtils.isSqlTypeTextBased(Types.NCHAR)); - Assert.assertTrue(LintUtils.isSqlTypeTextBased(Types.VARCHAR)); - Assert.assertFalse(LintUtils.isSqlTypeTextBased(Types.BIGINT)); - Assert.assertFalse(LintUtils.isSqlTypeTextBased(Types.BINARY)); - Assert.assertFalse(LintUtils.isSqlTypeTextBased(Types.BIT)); - Assert.assertFalse(LintUtils.isSqlTypeTextBased(Types.ARRAY)); - Assert.assertFalse(LintUtils.isSqlTypeTextBased(Types.BLOB)); - Assert.assertFalse(LintUtils.isSqlTypeTextBased(Types.BOOLEAN)); - Assert.assertFalse(LintUtils.isSqlTypeTextBased(Types.CLOB)); - Assert.assertFalse(LintUtils.isSqlTypeTextBased(Types.DATALINK)); - Assert.assertFalse(LintUtils.isSqlTypeTextBased(Types.DATE)); - Assert.assertFalse(LintUtils.isSqlTypeTextBased(Types.DECIMAL)); - Assert.assertFalse(LintUtils.isSqlTypeTextBased(Types.DISTINCT)); - Assert.assertFalse(LintUtils.isSqlTypeTextBased(Types.DOUBLE)); - Assert.assertFalse(LintUtils.isSqlTypeTextBased(Types.FLOAT)); - Assert.assertFalse(LintUtils.isSqlTypeTextBased(Types.INTEGER)); - Assert.assertFalse(LintUtils.isSqlTypeTextBased(Types.JAVA_OBJECT)); - Assert.assertFalse(LintUtils.isSqlTypeTextBased(Types.LONGVARBINARY)); - Assert.assertFalse(LintUtils.isSqlTypeTextBased(Types.NCLOB)); - Assert.assertFalse(LintUtils.isSqlTypeTextBased(Types.NULL)); - Assert.assertFalse(LintUtils.isSqlTypeTextBased(Types.NUMERIC)); - Assert.assertFalse(LintUtils.isSqlTypeTextBased(Types.OTHER)); - Assert.assertFalse(LintUtils.isSqlTypeTextBased(Types.REAL)); - Assert.assertFalse(LintUtils.isSqlTypeTextBased(Types.SMALLINT)); - Assert.assertFalse(LintUtils.isSqlTypeTextBased(Types.SQLXML)); - Assert.assertFalse(LintUtils.isSqlTypeTextBased(Types.TIME)); - Assert.assertFalse(LintUtils.isSqlTypeTextBased(Types.TIMESTAMP)); - Assert.assertFalse(LintUtils.isSqlTypeTextBased(Types.TIMESTAMP_WITH_TIMEZONE)); - Assert.assertFalse(LintUtils.isSqlTypeTextBased(Types.TINYINT)); - Assert.assertFalse(LintUtils.isSqlTypeTextBased(Types.VARBINARY)); - } - - - /** - * Test of testIsSqlTypeNumericBased method, of class LintUtils. - */ - @Test - public void testIsSqlTypeNumericBased() { - - Assert.assertTrue(LintUtils.isSqlTypeNumericBased(Types.BIGINT)); - Assert.assertTrue(LintUtils.isSqlTypeNumericBased(Types.DECIMAL)); - Assert.assertTrue(LintUtils.isSqlTypeNumericBased(Types.NUMERIC)); - Assert.assertTrue(LintUtils.isSqlTypeNumericBased(Types.REAL)); - Assert.assertTrue(LintUtils.isSqlTypeNumericBased(Types.SMALLINT)); - Assert.assertTrue(LintUtils.isSqlTypeNumericBased(Types.TINYINT)); - Assert.assertTrue(LintUtils.isSqlTypeNumericBased(Types.DOUBLE)); - Assert.assertTrue(LintUtils.isSqlTypeNumericBased(Types.FLOAT)); - Assert.assertTrue(LintUtils.isSqlTypeNumericBased(Types.INTEGER)); - - Assert.assertFalse(LintUtils.isSqlTypeNumericBased(Types.NVARCHAR)); - Assert.assertFalse(LintUtils.isSqlTypeNumericBased(Types.LONGNVARCHAR)); - Assert.assertFalse(LintUtils.isSqlTypeNumericBased(Types.LONGVARCHAR)); - Assert.assertFalse(LintUtils.isSqlTypeNumericBased(Types.CHAR)); - Assert.assertFalse(LintUtils.isSqlTypeNumericBased(Types.NCHAR)); - Assert.assertFalse(LintUtils.isSqlTypeNumericBased(Types.VARCHAR)); - Assert.assertFalse(LintUtils.isSqlTypeNumericBased(Types.BINARY)); - Assert.assertFalse(LintUtils.isSqlTypeNumericBased(Types.BIT)); - Assert.assertFalse(LintUtils.isSqlTypeNumericBased(Types.ARRAY)); - Assert.assertFalse(LintUtils.isSqlTypeNumericBased(Types.BLOB)); - Assert.assertFalse(LintUtils.isSqlTypeNumericBased(Types.BOOLEAN)); - Assert.assertFalse(LintUtils.isSqlTypeNumericBased(Types.CLOB)); - Assert.assertFalse(LintUtils.isSqlTypeNumericBased(Types.DATALINK)); - Assert.assertFalse(LintUtils.isSqlTypeNumericBased(Types.DATE)); - Assert.assertFalse(LintUtils.isSqlTypeNumericBased(Types.DISTINCT)); - Assert.assertFalse(LintUtils.isSqlTypeNumericBased(Types.JAVA_OBJECT)); - Assert.assertFalse(LintUtils.isSqlTypeNumericBased(Types.LONGVARBINARY)); - Assert.assertFalse(LintUtils.isSqlTypeNumericBased(Types.NCLOB)); - Assert.assertFalse(LintUtils.isSqlTypeNumericBased(Types.NULL)); - Assert.assertFalse(LintUtils.isSqlTypeNumericBased(Types.OTHER)); - Assert.assertFalse(LintUtils.isSqlTypeNumericBased(Types.SQLXML)); - Assert.assertFalse(LintUtils.isSqlTypeNumericBased(Types.TIME)); - Assert.assertFalse(LintUtils.isSqlTypeNumericBased(Types.TIMESTAMP)); - Assert.assertFalse(LintUtils.isSqlTypeNumericBased(Types.TIMESTAMP_WITH_TIMEZONE)); - Assert.assertFalse(LintUtils.isSqlTypeNumericBased(Types.VARBINARY)); - } - - /** - * Test of testIsSqlTypeNumericBased method, of class LintUtils. - */ - @Test - public void testIsSqlTypeIntegerBased() { - - Assert.assertTrue(LintUtils.isSqlTypeIntegerBased(Types.BIGINT)); - Assert.assertTrue(LintUtils.isSqlTypeIntegerBased(Types.INTEGER)); - Assert.assertTrue(LintUtils.isSqlTypeIntegerBased(Types.SMALLINT)); - Assert.assertTrue(LintUtils.isSqlTypeIntegerBased(Types.TINYINT)); - Assert.assertFalse(LintUtils.isSqlTypeIntegerBased(Types.BINARY)); - Assert.assertFalse(LintUtils.isSqlTypeIntegerBased(Types.NVARCHAR)); - Assert.assertFalse(LintUtils.isSqlTypeIntegerBased(Types.LONGNVARCHAR)); - Assert.assertFalse(LintUtils.isSqlTypeIntegerBased(Types.LONGVARCHAR)); - Assert.assertFalse(LintUtils.isSqlTypeIntegerBased(Types.CHAR)); - Assert.assertFalse(LintUtils.isSqlTypeIntegerBased(Types.NCHAR)); - Assert.assertFalse(LintUtils.isSqlTypeIntegerBased(Types.VARCHAR)); - Assert.assertFalse(LintUtils.isSqlTypeIntegerBased(Types.BIT)); - Assert.assertFalse(LintUtils.isSqlTypeIntegerBased(Types.ARRAY)); - Assert.assertFalse(LintUtils.isSqlTypeIntegerBased(Types.BLOB)); - Assert.assertFalse(LintUtils.isSqlTypeIntegerBased(Types.BOOLEAN)); - Assert.assertFalse(LintUtils.isSqlTypeIntegerBased(Types.CLOB)); - Assert.assertFalse(LintUtils.isSqlTypeIntegerBased(Types.DATALINK)); - Assert.assertFalse(LintUtils.isSqlTypeIntegerBased(Types.DATE)); - Assert.assertFalse(LintUtils.isSqlTypeIntegerBased(Types.DECIMAL)); - Assert.assertFalse(LintUtils.isSqlTypeIntegerBased(Types.DISTINCT)); - Assert.assertFalse(LintUtils.isSqlTypeIntegerBased(Types.DOUBLE)); - Assert.assertFalse(LintUtils.isSqlTypeIntegerBased(Types.FLOAT)); - Assert.assertFalse(LintUtils.isSqlTypeIntegerBased(Types.JAVA_OBJECT)); - Assert.assertFalse(LintUtils.isSqlTypeIntegerBased(Types.LONGVARBINARY)); - Assert.assertFalse(LintUtils.isSqlTypeIntegerBased(Types.NCLOB)); - Assert.assertFalse(LintUtils.isSqlTypeIntegerBased(Types.NULL)); - Assert.assertFalse(LintUtils.isSqlTypeIntegerBased(Types.NUMERIC)); - Assert.assertFalse(LintUtils.isSqlTypeIntegerBased(Types.OTHER)); - Assert.assertFalse(LintUtils.isSqlTypeIntegerBased(Types.REAL)); - Assert.assertFalse(LintUtils.isSqlTypeIntegerBased(Types.SQLXML)); - Assert.assertFalse(LintUtils.isSqlTypeIntegerBased(Types.TIME)); - Assert.assertFalse(LintUtils.isSqlTypeIntegerBased(Types.TIMESTAMP)); - Assert.assertFalse(LintUtils.isSqlTypeIntegerBased(Types.TIMESTAMP_WITH_TIMEZONE)); - Assert.assertFalse(LintUtils.isSqlTypeIntegerBased(Types.VARBINARY)); - } - - /** - * Test of testIsSqlTypeNumericBased method, of class LintUtils. - */ - @Test - public void testIsSqlTypeBinaryBased() { - - Assert.assertTrue(LintUtils.isSqlTypeBinayBased(Types.BINARY)); - Assert.assertTrue(LintUtils.isSqlTypeBinayBased(Types.BLOB)); - Assert.assertTrue(LintUtils.isSqlTypeBinayBased(Types.LONGVARBINARY)); - Assert.assertTrue(LintUtils.isSqlTypeBinayBased(Types.VARBINARY)); - - Assert.assertFalse(LintUtils.isSqlTypeBinayBased(Types.BIGINT)); - Assert.assertFalse(LintUtils.isSqlTypeBinayBased(Types.DECIMAL)); - Assert.assertFalse(LintUtils.isSqlTypeBinayBased(Types.NUMERIC)); - Assert.assertFalse(LintUtils.isSqlTypeBinayBased(Types.REAL)); - Assert.assertFalse(LintUtils.isSqlTypeBinayBased(Types.SMALLINT)); - Assert.assertFalse(LintUtils.isSqlTypeBinayBased(Types.TINYINT)); - Assert.assertFalse(LintUtils.isSqlTypeBinayBased(Types.DOUBLE)); - Assert.assertFalse(LintUtils.isSqlTypeBinayBased(Types.FLOAT)); - Assert.assertFalse(LintUtils.isSqlTypeBinayBased(Types.INTEGER)); - Assert.assertFalse(LintUtils.isSqlTypeBinayBased(Types.NVARCHAR)); - Assert.assertFalse(LintUtils.isSqlTypeBinayBased(Types.LONGNVARCHAR)); - Assert.assertFalse(LintUtils.isSqlTypeBinayBased(Types.LONGVARCHAR)); - Assert.assertFalse(LintUtils.isSqlTypeBinayBased(Types.CHAR)); - Assert.assertFalse(LintUtils.isSqlTypeBinayBased(Types.NCHAR)); - Assert.assertFalse(LintUtils.isSqlTypeBinayBased(Types.VARCHAR)); - Assert.assertFalse(LintUtils.isSqlTypeBinayBased(Types.BIT)); - Assert.assertFalse(LintUtils.isSqlTypeBinayBased(Types.ARRAY)); - Assert.assertFalse(LintUtils.isSqlTypeBinayBased(Types.BOOLEAN)); - Assert.assertFalse(LintUtils.isSqlTypeBinayBased(Types.CLOB)); - Assert.assertFalse(LintUtils.isSqlTypeBinayBased(Types.DATALINK)); - Assert.assertFalse(LintUtils.isSqlTypeBinayBased(Types.DATE)); - Assert.assertFalse(LintUtils.isSqlTypeBinayBased(Types.DISTINCT)); - Assert.assertFalse(LintUtils.isSqlTypeBinayBased(Types.JAVA_OBJECT)); - Assert.assertFalse(LintUtils.isSqlTypeBinayBased(Types.NCLOB)); - Assert.assertFalse(LintUtils.isSqlTypeBinayBased(Types.NULL)); - Assert.assertFalse(LintUtils.isSqlTypeBinayBased(Types.OTHER)); - Assert.assertFalse(LintUtils.isSqlTypeBinayBased(Types.SQLXML)); - Assert.assertFalse(LintUtils.isSqlTypeBinayBased(Types.TIME)); - Assert.assertFalse(LintUtils.isSqlTypeBinayBased(Types.TIMESTAMP)); - Assert.assertFalse(LintUtils.isSqlTypeBinayBased(Types.TIMESTAMP_WITH_TIMEZONE)); - - } - /** - * Test of testIsSqlTypeNumericBased method, of class LintUtils. - */ - @Test - public void testIsSqlTypeDateBased() { - Assert.assertTrue(LintUtils.isSqlTypeDateBased(Types.DATE)); - Assert.assertTrue(LintUtils.isSqlTypeDateBased(Types.TIME)); - Assert.assertTrue(LintUtils.isSqlTypeDateBased(Types.TIME_WITH_TIMEZONE)); - Assert.assertTrue(LintUtils.isSqlTypeDateBased(Types.TIMESTAMP)); - Assert.assertTrue(LintUtils.isSqlTypeDateBased(Types.TIMESTAMP_WITH_TIMEZONE)); + } - Assert.assertFalse(LintUtils.isSqlTypeDateBased(Types.BINARY)); - Assert.assertFalse(LintUtils.isSqlTypeDateBased(Types.BLOB)); - Assert.assertFalse(LintUtils.isSqlTypeDateBased(Types.LONGVARBINARY)); - Assert.assertFalse(LintUtils.isSqlTypeDateBased(Types.VARBINARY)); - Assert.assertFalse(LintUtils.isSqlTypeDateBased(Types.BIGINT)); - Assert.assertFalse(LintUtils.isSqlTypeDateBased(Types.DECIMAL)); - Assert.assertFalse(LintUtils.isSqlTypeDateBased(Types.NUMERIC)); - Assert.assertFalse(LintUtils.isSqlTypeDateBased(Types.REAL)); - Assert.assertFalse(LintUtils.isSqlTypeDateBased(Types.SMALLINT)); - Assert.assertFalse(LintUtils.isSqlTypeDateBased(Types.TINYINT)); - Assert.assertFalse(LintUtils.isSqlTypeDateBased(Types.DOUBLE)); - Assert.assertFalse(LintUtils.isSqlTypeDateBased(Types.FLOAT)); - Assert.assertFalse(LintUtils.isSqlTypeDateBased(Types.INTEGER)); - Assert.assertFalse(LintUtils.isSqlTypeDateBased(Types.NVARCHAR)); - Assert.assertFalse(LintUtils.isSqlTypeDateBased(Types.LONGNVARCHAR)); - Assert.assertFalse(LintUtils.isSqlTypeDateBased(Types.LONGVARCHAR)); - Assert.assertFalse(LintUtils.isSqlTypeDateBased(Types.CHAR)); - Assert.assertFalse(LintUtils.isSqlTypeDateBased(Types.NCHAR)); - Assert.assertFalse(LintUtils.isSqlTypeDateBased(Types.VARCHAR)); - Assert.assertFalse(LintUtils.isSqlTypeDateBased(Types.BIT)); - Assert.assertFalse(LintUtils.isSqlTypeDateBased(Types.ARRAY)); - Assert.assertFalse(LintUtils.isSqlTypeDateBased(Types.BOOLEAN)); - Assert.assertFalse(LintUtils.isSqlTypeDateBased(Types.CLOB)); - Assert.assertFalse(LintUtils.isSqlTypeDateBased(Types.DATALINK)); - Assert.assertFalse(LintUtils.isSqlTypeDateBased(Types.DISTINCT)); - Assert.assertFalse(LintUtils.isSqlTypeDateBased(Types.JAVA_OBJECT)); - Assert.assertFalse(LintUtils.isSqlTypeDateBased(Types.NCLOB)); - Assert.assertFalse(LintUtils.isSqlTypeDateBased(Types.NULL)); - Assert.assertFalse(LintUtils.isSqlTypeDateBased(Types.OTHER)); - Assert.assertFalse(LintUtils.isSqlTypeDateBased(Types.SQLXML)); - } - } diff --git a/src/test/resources/LinterBlobTypeColumn/schemacrawler-linter-configs-test.xml b/src/test/resources/LinterBlobTypeColumn/schemacrawler-linter-configs-test.xml index c0dca0ce..13915b92 100644 --- a/src/test/resources/LinterBlobTypeColumn/schemacrawler-linter-configs-test.xml +++ b/src/test/resources/LinterBlobTypeColumn/schemacrawler-linter-configs-test.xml @@ -220,4 +220,10 @@ false + + false + critical + + \ No newline at end of file diff --git a/src/test/resources/LinterBooleanContent/schemacrawler-linter-configs-test.xml b/src/test/resources/LinterBooleanContent/schemacrawler-linter-configs-test.xml index fd815052..da74317d 100644 --- a/src/test/resources/LinterBooleanContent/schemacrawler-linter-configs-test.xml +++ b/src/test/resources/LinterBooleanContent/schemacrawler-linter-configs-test.xml @@ -220,4 +220,10 @@ false + + false + critical + + \ No newline at end of file diff --git a/src/test/resources/LinterByteaTypeColumn/schemacrawler-linter-configs-test.xml b/src/test/resources/LinterByteaTypeColumn/schemacrawler-linter-configs-test.xml index 1083eb76..e52df47c 100644 --- a/src/test/resources/LinterByteaTypeColumn/schemacrawler-linter-configs-test.xml +++ b/src/test/resources/LinterByteaTypeColumn/schemacrawler-linter-configs-test.xml @@ -220,4 +220,10 @@ false + + false + critical + + \ No newline at end of file diff --git a/src/test/resources/LinterColumnContentNotNormalized/schemacrawler-linter-configs-test.xml b/src/test/resources/LinterColumnContentNotNormalized/schemacrawler-linter-configs-test.xml index 2bb1a25b..753e1046 100644 --- a/src/test/resources/LinterColumnContentNotNormalized/schemacrawler-linter-configs-test.xml +++ b/src/test/resources/LinterColumnContentNotNormalized/schemacrawler-linter-configs-test.xml @@ -220,4 +220,10 @@ false + + false + critical + + \ No newline at end of file diff --git a/src/test/resources/LinterColumnSize/schemacrawler-linter-configs-test.xml b/src/test/resources/LinterColumnSize/schemacrawler-linter-configs-test.xml index db07dc48..84fea496 100644 --- a/src/test/resources/LinterColumnSize/schemacrawler-linter-configs-test.xml +++ b/src/test/resources/LinterColumnSize/schemacrawler-linter-configs-test.xml @@ -219,4 +219,10 @@ false + + false + critical + + \ No newline at end of file diff --git a/src/test/resources/LinterCompressBlob/schemacrawler-linter-configs-test.xml b/src/test/resources/LinterCompressBlob/schemacrawler-linter-configs-test.xml index bb7b53a3..36d75451 100644 --- a/src/test/resources/LinterCompressBlob/schemacrawler-linter-configs-test.xml +++ b/src/test/resources/LinterCompressBlob/schemacrawler-linter-configs-test.xml @@ -215,4 +215,10 @@ false + + false + critical + + \ No newline at end of file diff --git a/src/test/resources/LinterForeignKeyMismatchLazy/schemacrawler-linter-configs-test.xml b/src/test/resources/LinterForeignKeyMismatchLazy/schemacrawler-linter-configs-test.xml index c2c05044..d54932d3 100644 --- a/src/test/resources/LinterForeignKeyMismatchLazy/schemacrawler-linter-configs-test.xml +++ b/src/test/resources/LinterForeignKeyMismatchLazy/schemacrawler-linter-configs-test.xml @@ -219,4 +219,10 @@ false + + false + critical + + \ No newline at end of file diff --git a/src/test/resources/LinterForeignKeyName/schemacrawler-linter-configs-test.xml b/src/test/resources/LinterForeignKeyName/schemacrawler-linter-configs-test.xml index cca35c6f..389e041b 100644 --- a/src/test/resources/LinterForeignKeyName/schemacrawler-linter-configs-test.xml +++ b/src/test/resources/LinterForeignKeyName/schemacrawler-linter-configs-test.xml @@ -220,4 +220,10 @@ false + + false + critical + + \ No newline at end of file diff --git a/src/test/resources/LinterJsonContent/schemacrawler-linter-configs-test.xml b/src/test/resources/LinterJsonContent/schemacrawler-linter-configs-test.xml index 93da0e5f..b993c543 100644 --- a/src/test/resources/LinterJsonContent/schemacrawler-linter-configs-test.xml +++ b/src/test/resources/LinterJsonContent/schemacrawler-linter-configs-test.xml @@ -220,4 +220,10 @@ false + + false + critical + + \ No newline at end of file diff --git a/src/test/resources/LinterJsonTypeColumn/schemacrawler-linter-configs-test.xml b/src/test/resources/LinterJsonTypeColumn/schemacrawler-linter-configs-test.xml index d4fc506a..ba0062c4 100644 --- a/src/test/resources/LinterJsonTypeColumn/schemacrawler-linter-configs-test.xml +++ b/src/test/resources/LinterJsonTypeColumn/schemacrawler-linter-configs-test.xml @@ -220,4 +220,10 @@ false + + false + critical + + \ No newline at end of file diff --git a/src/test/resources/LinterLeftSpacePadding/schemacrawler-linter-configs-test.xml b/src/test/resources/LinterLeftSpacePadding/schemacrawler-linter-configs-test.xml index 5a6f028b..135b8c46 100644 --- a/src/test/resources/LinterLeftSpacePadding/schemacrawler-linter-configs-test.xml +++ b/src/test/resources/LinterLeftSpacePadding/schemacrawler-linter-configs-test.xml @@ -229,4 +229,10 @@ false + + false + critical + + \ No newline at end of file diff --git a/src/test/resources/LinterNoSpaceInNames/schemacrawler-linter-configs-test.xml b/src/test/resources/LinterNoSpaceInNames/schemacrawler-linter-configs-test.xml index f0c45b7d..c6eb4375 100644 --- a/src/test/resources/LinterNoSpaceInNames/schemacrawler-linter-configs-test.xml +++ b/src/test/resources/LinterNoSpaceInNames/schemacrawler-linter-configs-test.xml @@ -220,4 +220,10 @@ false + + false + critical + + \ No newline at end of file diff --git a/src/test/resources/LinterOrphanTable/schemacrawler-linter-configs-test.xml b/src/test/resources/LinterOrphanTable/schemacrawler-linter-configs-test.xml index 7b62efca..6122d25a 100644 --- a/src/test/resources/LinterOrphanTable/schemacrawler-linter-configs-test.xml +++ b/src/test/resources/LinterOrphanTable/schemacrawler-linter-configs-test.xml @@ -220,4 +220,10 @@ false + + false + critical + + \ No newline at end of file diff --git a/src/test/resources/LinterPluralTableName/schemacrawler-linter-configs-test.xml b/src/test/resources/LinterPluralTableName/schemacrawler-linter-configs-test.xml index c783b1ba..251a8006 100644 --- a/src/test/resources/LinterPluralTableName/schemacrawler-linter-configs-test.xml +++ b/src/test/resources/LinterPluralTableName/schemacrawler-linter-configs-test.xml @@ -220,4 +220,10 @@ false + + false + critical + + \ No newline at end of file diff --git a/src/test/resources/LinterPrimaryKeyNotIntegerLikeType/schemacrawler-linter-configs-test.xml b/src/test/resources/LinterPrimaryKeyNotIntegerLikeType/schemacrawler-linter-configs-test.xml index be5e147c..d467e180 100644 --- a/src/test/resources/LinterPrimaryKeyNotIntegerLikeType/schemacrawler-linter-configs-test.xml +++ b/src/test/resources/LinterPrimaryKeyNotIntegerLikeType/schemacrawler-linter-configs-test.xml @@ -220,4 +220,10 @@ false + + false + critical + + \ No newline at end of file diff --git a/src/test/resources/LinterRightSpacePadding/schemacrawler-linter-configs-test.xml b/src/test/resources/LinterRightSpacePadding/schemacrawler-linter-configs-test.xml index bdc8c9a8..9fb99d10 100644 --- a/src/test/resources/LinterRightSpacePadding/schemacrawler-linter-configs-test.xml +++ b/src/test/resources/LinterRightSpacePadding/schemacrawler-linter-configs-test.xml @@ -228,4 +228,10 @@ false + + false + critical + + \ No newline at end of file diff --git a/src/test/resources/LinterTableNameNotInLowerCase/schemacrawler-linter-configs-test.xml b/src/test/resources/LinterTableNameNotInLowerCase/schemacrawler-linter-configs-test.xml index 8f07bd0b..c0056c1c 100644 --- a/src/test/resources/LinterTableNameNotInLowerCase/schemacrawler-linter-configs-test.xml +++ b/src/test/resources/LinterTableNameNotInLowerCase/schemacrawler-linter-configs-test.xml @@ -220,4 +220,10 @@ false + + false + critical + + \ No newline at end of file diff --git a/src/test/resources/LinterTimeStampWithOutTimeZoneColumn/schemacrawler-linter-configs-test.xml b/src/test/resources/LinterTimeStampWithOutTimeZoneColumn/schemacrawler-linter-configs-test.xml new file mode 100644 index 00000000..567bcc28 --- /dev/null +++ b/src/test/resources/LinterTimeStampWithOutTimeZoneColumn/schemacrawler-linter-configs-test.xml @@ -0,0 +1,246 @@ + + + + true + critical + + + + false + high + + + + false + + + message for SQL catalog lint + + + + + false + + + + false + + + + false + medium + + + + false + + + + false + + + + false + + + + false + high + + + + false + + + + false + high + + + + false + + + message for custom SQL lint + + + + + false + + + + false + + + + false + + + + false + critical + + 1 + + + false + + + + false + + + + false + + + + + + + false + + + + false + + + + false + + + + false + high + + + 2 + 2 + + + + false + + + + false + + + 1000 + + + + false + + + 1000 + + + + false + high + + + + false + + + + false + high + + + + false + high + + + + 20 + + + + false + critical + + 1 + + + false + medium + + + _id + + + + false + medium + + + + false + medium + + + + false + high + + + 30 + + + + false + high + + + + false + + + + false + + + \ No newline at end of file diff --git a/src/test/resources/LinterXmlContent/schemacrawler-linter-configs-test.xml b/src/test/resources/LinterXmlContent/schemacrawler-linter-configs-test.xml index 865ccfcc..a31ce86a 100644 --- a/src/test/resources/LinterXmlContent/schemacrawler-linter-configs-test.xml +++ b/src/test/resources/LinterXmlContent/schemacrawler-linter-configs-test.xml @@ -220,4 +220,10 @@ false + + false + critical + + \ No newline at end of file