ExecStreamUnitTestBase.h

Go to the documentation of this file.
00001 /*
00002 // $Id: //open/dev/fennel/test/ExecStreamUnitTestBase.h#21 $
00003 // Fennel is a library of data storage and processing components.
00004 // Copyright (C) 2005-2009 The Eigenbase Project
00005 // Copyright (C) 2005-2009 SQLstream, Inc.
00006 // Copyright (C) 2005-2009 LucidEra, Inc.
00007 // Portions Copyright (C) 2004-2009 John V. Sichi
00008 //
00009 // This program is free software; you can redistribute it and/or modify it
00010 // under the terms of the GNU General Public License as published by the Free
00011 // Software Foundation; either version 2 of the License, or (at your option)
00012 // any later version approved by The Eigenbase Project.
00013 //
00014 // This program is distributed in the hope that it will be useful,
00015 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00016 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017 // GNU General Public License for more details.
00018 //
00019 // You should have received a copy of the GNU General Public License
00020 // along with this program; if not, write to the Free Software
00021 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00022 */
00023 
00024 #ifndef Fennel_ExecStreamUnitTestBase_Included
00025 #define Fennel_ExecStreamUnitTestBase_Included
00026 
00027 #include "fennel/test/ExecStreamTestBase.h"
00028 #include "fennel/exec/MockProducerExecStream.h"
00029 #include "fennel/test/ExecStreamGenerator.h"
00030 
00031 FENNEL_BEGIN_NAMESPACE
00032 
00042 class FENNEL_TEST_EXPORT ExecStreamUnitTestBase
00043     : public ExecStreamTestBase
00044 {
00045 protected:
00046     SharedExecStreamGraph pGraph;
00047     SharedExecStreamGraphEmbryo pGraphEmbryo;
00048 
00049 
00057     SharedExecStream prepareSourceGraph(
00058         ExecStreamEmbryo &sourceStreamEmbryo);
00059 
00071     SharedExecStream prepareTransformGraph(
00072         ExecStreamEmbryo &sourceStreamEmbryo,
00073         ExecStreamEmbryo &transformStreamEmbryo);
00074 
00086     SharedExecStream prepareTransformGraph(
00087         ExecStreamEmbryo &sourceStreamEmbryo,
00088         std::vector<ExecStreamEmbryo> &transforms);
00089 
00103     SharedExecStream prepareConfluenceGraph(
00104         ExecStreamEmbryo &sourceStreamEmbryo1,
00105         ExecStreamEmbryo &sourceStreamEmbryo2,
00106         ExecStreamEmbryo &confluenceStreamEmbryo);
00107 
00124     SharedExecStream prepareConfluenceTransformGraph(
00125         ExecStreamEmbryo &sourceStreamEmbryo1,
00126         ExecStreamEmbryo &sourceStreamEmbryo2,
00127         ExecStreamEmbryo &confluenceStreamEmbryo,
00128         ExecStreamEmbryo &transformStreamEmbryo);
00129 
00142     SharedExecStream prepareConfluenceGraph(
00143         std::vector<ExecStreamEmbryo> &sourceStreamEmbryos,
00144         ExecStreamEmbryo &confluenceStreamEmbryo);
00145 
00158     SharedExecStream prepareConfluenceGraph(
00159         std::vector<std::vector<ExecStreamEmbryo> > &sourceStreamEmbryosList,
00160         ExecStreamEmbryo &confluenceStreamEmbryo);
00161 
00186     SharedExecStream prepareDAG(
00187         ExecStreamEmbryo &srcStreamEmbryo,
00188         ExecStreamEmbryo &splitterStreamEmbryo,
00189         std::vector<ExecStreamEmbryo> &interStreamEmbryos,
00190         ExecStreamEmbryo &destStreamEmbryo,
00191         bool createSink = true,
00192         bool saveSrc = true);
00193 
00218     SharedExecStream prepareDAG(
00219         ExecStreamEmbryo &srcStreamEmbryo,
00220         ExecStreamEmbryo &splitterStreamEmbryo,
00221         std::vector<std::vector<ExecStreamEmbryo> > &interStreamEmbryosList,
00222         ExecStreamEmbryo &destStreamEmbryo,
00223         bool createSink = true,
00224         bool saveSrc = true);
00225 
00240     void verifyOutput(
00241         ExecStream &stream,
00242         uint nRowsExpected,
00243         MockProducerExecStreamGenerator &verifier,
00244         bool stopEarly = false);
00245 
00256     void verifyConstantOutput(
00257         ExecStream &stream,
00258         const TupleData  &expectedTuple,
00259         uint nRowsExpected);
00260 
00273     void verifyBufferedOutput(
00274         ExecStream &stream,
00275         TupleDescriptor outputTupleDesc,
00276         uint nRowsExpected,
00277         PBuffer expectedBuffer);
00278 
00283     void resetExecStreamTest();
00284 
00285     // refine ExecStreamTestBase
00286     virtual void tearDownExecStreamTest();
00287 
00288 public:
00289     // refine ExecStreamTestBase
00290     virtual void testCaseSetUp();
00291 };
00292 
00293 FENNEL_END_NAMESPACE
00294 #endif
00295 
00296 // End ExecStreamUnitTestBase.h

Generated on Mon Jun 22 04:00:20 2009 for Fennel by  doxygen 1.5.1