Salome HOME
mergefrom branch BR_V511_PR tag mergeto_trunk_03feb09
[modules/yacs.git] / src / engine / Test / engineTest.hxx
1 //  Copyright (C) 2006-2008  CEA/DEN, EDF R&D
2 //
3 //  This library is free software; you can redistribute it and/or
4 //  modify it under the terms of the GNU Lesser General Public
5 //  License as published by the Free Software Foundation; either
6 //  version 2.1 of the License.
7 //
8 //  This library is distributed in the hope that it will be useful,
9 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
10 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 //  Lesser General Public License for more details.
12 //
13 //  You should have received a copy of the GNU Lesser General Public
14 //  License along with this library; if not, write to the Free Software
15 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19 #ifndef _ENGINETEST_HXX_
20 #define _ENGINETEST_HXX_
21
22 #include "ComposedNode.hxx"
23 #include "TypeCode.hxx"
24
25 #include <cppunit/extensions/HelperMacros.h>
26 #include <string>
27 #include <map>
28
29 namespace YACS
30 {
31   class EngineTest: public CppUnit::TestFixture
32   {
33     CPPUNIT_TEST_SUITE( EngineTest );
34     CPPUNIT_TEST(checkGetRuntime );
35     CPPUNIT_TEST(checkAny1);
36     CPPUNIT_TEST(checkSharedPtr);
37     CPPUNIT_TEST(checkAny2);
38     CPPUNIT_TEST(checkAny3);
39     CPPUNIT_TEST(checkAny4);
40     CPPUNIT_TEST(checkAny5);
41     CPPUNIT_TEST(checkAny6);
42     CPPUNIT_TEST(checkAny7);
43     CPPUNIT_TEST(checkAny8);
44     CPPUNIT_TEST(checkInGateOutGate );
45     CPPUNIT_TEST(checkNodePortNumber );
46     CPPUNIT_TEST(checkPortTypeName );
47     CPPUNIT_TEST(checkDuplicatePortName );
48     CPPUNIT_TEST(checkRemovePort );
49     CPPUNIT_TEST(checkAddNodesToBloc );
50     CPPUNIT_TEST(checkAddingTwiceSameNodeInSameBloc );
51     CPPUNIT_TEST(checkAddingTwiceSameNodeInTwoBlocs );
52     CPPUNIT_TEST(checkRecursiveBlocs_NumberOfNodes );
53     CPPUNIT_TEST(checkRecursiveBlocs_NumberOfPorts );
54     CPPUNIT_TEST(checkPortNameInBloc );
55     CPPUNIT_TEST(checkGetNameOfPortNotInBloc );
56     CPPUNIT_TEST(checkRemoveNode );
57     CPPUNIT_TEST(RecursiveBlocs_multipleRecursion );
58     CPPUNIT_TEST(RecursiveBlocs_removeNodes );
59     CPPUNIT_TEST(cleanUp);
60     CPPUNIT_TEST(checkLogger);
61     CPPUNIT_TEST_SUITE_END();
62       
63   public:
64       
65     void setUp();
66     void tearDown();
67     void cleanUp();
68
69     void checkGetRuntime();
70     void checkAny1();
71     void checkSharedPtr();
72     void checkAny2();
73     void checkAny3();
74     void checkAny4();
75     void checkAny5();
76     void checkAny6();
77     void checkAny7();
78     void checkAny8();
79     void checkInGateOutGate();
80     void checkNodePortNumber();
81     void checkPortTypeName();
82     void checkDuplicatePortName();
83     void checkRemovePort();
84     void checkAddNodesToBloc();
85     void checkAddingTwiceSameNodeInSameBloc();
86     void checkAddingTwiceSameNodeInTwoBlocs();
87     void checkRecursiveBlocs_NumberOfNodes();
88     void checkRecursiveBlocs_NumberOfPorts();
89     void checkPortNameInBloc();
90     void checkGetNameOfPortNotInBloc();
91     void checkRemoveNode();
92     void RecursiveBlocs_multipleRecursion();
93     void RecursiveBlocs_removeNodes();
94     void checkLogger();
95       
96   protected:
97     static std::map<std::string, YACS::ENGINE::Node*> _nodeMap; 
98     static std::map<std::string, YACS::ENGINE::ComposedNode*> _compoMap;
99
100     static  YACS::ENGINE::TypeCode *_tc_bool;
101     static  YACS::ENGINE::TypeCode *_tc_int;
102     static  YACS::ENGINE::TypeCode *_tc_double;
103   private:
104
105   };
106
107 }
108
109 #endif