OracleDB extends BaseDB { @Override public String buildSQL(String template) throws IOException, SQLException { template = replaceTemplate(template); template = reword(template); template = StringUtil.replace( template, new String[] {"\\\\", "\\'", "\\\""}, new String[] {"\\", "''", "\""}); return StringUtil.replace(template, "\\n", "'||CHR(10)||'"); } OracleDB(int majorVersion, int minorVersion); @Override String buildSQL(String template); @Override List<Index> getIndexes(Connection con); @Override String getPopulateSQL(String databaseName, String sqlContent); @Override String getRecreateSQL(String databaseName); @Override boolean isSupportsInlineDistinct();  }
@Test public void testRewordAlterColumnType() throws Exception { Assert.assertEquals( "alter table DLFolder modify userName VARCHAR2(75 CHAR);\n", buildSQL("alter_column_type DLFolder userName VARCHAR(75);")); }
@Test public void testRewordAlterColumnTypeLowerCase() throws Exception { Assert.assertEquals( "alter table DLFolder modify userName VARCHAR2(75 CHAR);\n", buildSQL("alter_column_type DLFolder userName varchar(75);")); }
@Test public void testRewordAlterColumnTypeNoSemicolon() throws Exception { Assert.assertEquals( "alter table DLFolder modify userName VARCHAR2(75 CHAR);\n", buildSQL("alter_column_type DLFolder userName VARCHAR(75)")); }
@Test public void testRewordAlterColumnTypeNotNullWhenNotNull() throws Exception { Assert.assertEquals( "alter table DLFolder modify userName VARCHAR2(75 CHAR);\n", buildSQL( "alter_column_type DLFolder userName VARCHAR(75) not null;")); }
@Test public void testRewordAlterColumnTypeNotNullWhenNull() throws Exception { _nullable = true; Assert.assertEquals( "alter table DLFolder modify userName VARCHAR2(75 CHAR) not " + "null;\n", buildSQL( "alter_column_type DLFolder userName VARCHAR(75) not null;")); }
@Test public void testRewordAlterColumnTypeNullWhenNotNull() throws Exception { Assert.assertEquals( "alter table DLFolder modify userName VARCHAR2(75 CHAR) null;\n", buildSQL("alter_column_type DLFolder userName VARCHAR(75) null;")); }
@Test public void testRewordAlterColumnTypeNullWhenNull() throws Exception { _nullable = true; Assert.assertEquals( "alter table DLFolder modify userName VARCHAR2(75 CHAR);\n", buildSQL("alter_column_type DLFolder userName VARCHAR(75) null;")); }
@Test public void testRewordAlterColumnTypeString() throws Exception { Assert.assertEquals( "alter table BlogsEntry modify description VARCHAR2(4000 CHAR);\n", buildSQL("alter_column_type BlogsEntry description STRING;")); }