1 21 package org.dbunit.ext.oracle; 22 23 import org.dbunit.dataset.datatype.AbstractDataTypeFactoryTest; 24 import org.dbunit.dataset.datatype.DataType; 25 import org.dbunit.dataset.datatype.IDataTypeFactory; 26 27 import java.sql.Types ; 28 29 34 public class OracleDataTypeFactoryTest extends AbstractDataTypeFactoryTest 35 { 36 public OracleDataTypeFactoryTest(String s) 37 { 38 super(s); 39 } 40 41 public IDataTypeFactory createFactory() throws Exception 42 { 43 return new OracleDataTypeFactory(); 44 } 45 46 public void testCreateBlobDataType() throws Exception 47 { 48 int sqlType = Types.OTHER; 49 String sqlTypeName = "BLOB"; 50 51 DataType expected = OracleDataTypeFactory.ORACLE_BLOB; 52 DataType actual = createFactory().createDataType(sqlType, sqlTypeName); 53 assertSame("type", expected, actual); 54 } 55 56 public void testCreateClobDataType() throws Exception 57 { 58 int sqlType = Types.OTHER; 59 String sqlTypeName = "CLOB"; 60 61 DataType expected = OracleDataTypeFactory.ORACLE_CLOB; 62 DataType actual = createFactory().createDataType(sqlType, sqlTypeName); 63 assertSame("type", expected, actual); 64 } 65 66 public void testCreateNClobDataType() throws Exception 67 { 68 int sqlType = Types.OTHER; 69 String sqlTypeName = "NCLOB"; 70 71 DataType expected = OracleDataTypeFactory.ORACLE_CLOB; 72 DataType actual = createFactory().createDataType(sqlType, sqlTypeName); 73 assertSame("type", expected, actual); 74 } 75 76 public void testCreateLongRawDataType() throws Exception 77 { 78 int sqlType = Types.LONGVARBINARY; 79 String sqlTypeName = "LONG RAW"; 80 81 DataType expected = OracleDataTypeFactory.LONG_RAW; 82 DataType actual = createFactory().createDataType(sqlType, sqlTypeName); 83 assertSame("type", expected, actual); 84 } 85 86 public void testCreateTimestampDataType() throws Exception 87 { 88 int sqlType = Types.OTHER; 89 String sqlTypeName = "TIMESTAMP(6)"; 90 91 DataType expected = DataType.TIMESTAMP; 92 DataType actual = createFactory().createDataType(sqlType, sqlTypeName); 93 assertSame("type", expected, actual); 94 } 95 96 public void testCreateDateDataType() throws Exception 97 { 98 int sqlType = Types.DATE; 99 String sqlTypeName = "DATE"; 100 101 DataType expected = DataType.TIMESTAMP; 102 DataType actual = createFactory().createDataType(sqlType, sqlTypeName); 103 assertSame("type", expected, actual); 104 } 105 106 public void testCreateNChar2DataType() throws Exception 107 { 108 int sqlType = Types.OTHER; 109 String sqlTypeName = "NCHAR2"; 110 111 DataType expected = DataType.CHAR; 112 DataType actual = createFactory().createDataType(sqlType, sqlTypeName); 113 assertSame("type", expected, actual); 114 } 115 116 public void testCreateNVarChar2DataType() throws Exception 117 { 118 int sqlType = Types.OTHER; 119 String sqlTypeName = "NVARCHAR2"; 120 121 DataType expected = DataType.VARCHAR; 122 DataType actual = createFactory().createDataType(sqlType, sqlTypeName); 123 assertSame("type", expected, actual); 124 } 125 126 public void testCreateFloatDataType() throws Exception 127 { 128 int sqlType = Types.OTHER; 129 String sqlTypeName = "FLOAT"; 130 131 DataType expected = DataType.FLOAT; 132 DataType actual = createFactory().createDataType(sqlType, sqlTypeName); 133 assertSame("type", expected, actual); 134 } 135 136 } 137 | Popular Tags |