Exemple #1
0
        /// <summary>test splitters from DataDrivenDBInputFormat.</summary>
        /// <remarks>
        /// test splitters from DataDrivenDBInputFormat. For different data types may
        /// be different splitter
        /// </remarks>
        public virtual void TestDataDrivenDBInputFormatSplitter()
        {
            DataDrivenDBInputFormat <DBInputFormat.NullDBWritable> format = new DataDrivenDBInputFormat
                                                                            <DBInputFormat.NullDBWritable>();

            TestCommonSplitterTypes(format);
            NUnit.Framework.Assert.AreEqual(typeof(DateSplitter), format.GetSplitter(Types.Timestamp
                                                                                     ).GetType());
            NUnit.Framework.Assert.AreEqual(typeof(DateSplitter), format.GetSplitter(Types.Date
                                                                                     ).GetType());
            NUnit.Framework.Assert.AreEqual(typeof(DateSplitter), format.GetSplitter(Types.Time
                                                                                     ).GetType());
        }
Exemple #2
0
 private void TestCommonSplitterTypes(DataDrivenDBInputFormat <DBInputFormat.NullDBWritable
                                                               > format)
 {
     NUnit.Framework.Assert.AreEqual(typeof(BigDecimalSplitter), format.GetSplitter(Types
                                                                                    .Decimal).GetType());
     NUnit.Framework.Assert.AreEqual(typeof(BigDecimalSplitter), format.GetSplitter(Types
                                                                                    .Numeric).GetType());
     NUnit.Framework.Assert.AreEqual(typeof(BooleanSplitter), format.GetSplitter(Types
                                                                                 .Boolean).GetType());
     NUnit.Framework.Assert.AreEqual(typeof(BooleanSplitter), format.GetSplitter(Types
                                                                                 .Bit).GetType());
     NUnit.Framework.Assert.AreEqual(typeof(IntegerSplitter), format.GetSplitter(Types
                                                                                 .Bigint).GetType());
     NUnit.Framework.Assert.AreEqual(typeof(IntegerSplitter), format.GetSplitter(Types
                                                                                 .Tinyint).GetType());
     NUnit.Framework.Assert.AreEqual(typeof(IntegerSplitter), format.GetSplitter(Types
                                                                                 .Smallint).GetType());
     NUnit.Framework.Assert.AreEqual(typeof(IntegerSplitter), format.GetSplitter(Types
                                                                                 .Integer).GetType());
     NUnit.Framework.Assert.AreEqual(typeof(FloatSplitter), format.GetSplitter(Types.Double
                                                                               ).GetType());
     NUnit.Framework.Assert.AreEqual(typeof(FloatSplitter), format.GetSplitter(Types.Real
                                                                               ).GetType());
     NUnit.Framework.Assert.AreEqual(typeof(FloatSplitter), format.GetSplitter(Types.Float
                                                                               ).GetType());
     NUnit.Framework.Assert.AreEqual(typeof(TextSplitter), format.GetSplitter(Types.Longvarchar
                                                                              ).GetType());
     NUnit.Framework.Assert.AreEqual(typeof(TextSplitter), format.GetSplitter(Types.Char
                                                                              ).GetType());
     NUnit.Framework.Assert.AreEqual(typeof(TextSplitter), format.GetSplitter(Types.Varchar
                                                                              ).GetType());
     // if unknown data type splitter is null
     NUnit.Framework.Assert.IsNull(format.GetSplitter(Types.Binary));
 }