/// <exception cref="System.Exception"/>
        public virtual int TestFormat(Configuration conf, int tupleSize, bool firstTuple,
                                      bool secondTuple, TestJoinProperties.TestType ttype)
        {
            Job job = Job.GetInstance(conf);
            CompositeInputFormat format = new CompositeInputFormat();
            int count = 0;

            foreach (InputSplit split in (IList <InputSplit>)format.GetSplits(job))
            {
                TaskAttemptContext context = MapReduceTestUtil.CreateDummyMapTaskAttemptContext(conf
                                                                                                );
                RecordReader reader   = format.CreateRecordReader(split, context);
                MapContext   mcontext = new MapContextImpl(conf, context.GetTaskAttemptID(), reader
                                                           , null, null, MapReduceTestUtil.CreateDummyReporter(), split);
                reader.Initialize(split, mcontext);
                WritableComparable key   = null;
                Writable           value = null;
                while (reader.NextKeyValue())
                {
                    key   = (WritableComparable)reader.GetCurrentKey();
                    value = (Writable)reader.GetCurrentValue();
                    ValidateKeyValue(key, value, tupleSize, firstTuple, secondTuple, ttype);
                    count++;
                }
            }
            return(count);
        }
        /// <exception cref="System.Exception"/>
        private void TestExpr3(Configuration conf, string op, TestJoinProperties.TestType
                               ttype, int expectedCount)
        {
            string joinExpr = ConstructExpr3(op);

            conf.Set(CompositeInputFormat.JoinExpr, joinExpr);
            int count = TestFormat(conf, 3, false, false, ttype);

            NUnit.Framework.Assert.IsTrue("not all keys present", count == expectedCount);
        }
 /// <exception cref="System.IO.IOException"/>
 private void ValidateKeyValue <_T0>(WritableComparable <_T0> k, Writable v, int tupleSize
                                     , bool firstTuple, bool secondTuple, TestJoinProperties.TestType ttype)
 {
     System.Console.Out.WriteLine("out k:" + k + " v:" + v);
     if (ttype.Equals(TestJoinProperties.TestType.OuterAssociativity))
     {
         ValidateOuterKeyValue((IntWritable)k, (TupleWritable)v, tupleSize, firstTuple, secondTuple
                               );
     }
     else
     {
         if (ttype.Equals(TestJoinProperties.TestType.InnerAssociativity))
         {
             ValidateInnerKeyValue((IntWritable)k, (TupleWritable)v, tupleSize, firstTuple, secondTuple
                                   );
         }
     }
     if (ttype.Equals(TestJoinProperties.TestType.InnerIdentity))
     {
         ValidateKeyValue_INNER_IDENTITY((IntWritable)k, (IntWritable)v);
     }
 }