00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
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
00286 virtual void tearDownExecStreamTest();
00287
00288 public:
00289
00290 virtual void testCaseSetUp();
00291 };
00292
00293 FENNEL_END_NAMESPACE
00294 #endif
00295
00296