]> SALOME platform Git repositories - modules/yacs.git/blob - src/runtime/Test/runtimeTest.hxx
Salome HOME
04660b3d4b2b5f12cc3798c126747d5f7cb2713b
[modules/yacs.git] / src / runtime / Test / runtimeTest.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 _RUNTIMETEST_HXX_
20 #define _RUNTIMETEST_HXX_
21
22 #include "RuntimeSALOME.hxx"
23 #include "TypeCode.hxx"
24
25 #ifdef USE_CPPUNIT
26 #include <cppunit/extensions/HelperMacros.h>
27 #else
28 #define CPPUNIT_TEST_SUITE(x)
29 #define CPPUNIT_TEST(x)
30 #define CPPUNIT_TEST_SUITE_END(x)
31 #define CPPUNIT_ASSERT(x) std::cerr << #x << " : " << (x) << std::endl
32 #define CPPUNIT_ASSERT_EQUAL(x,y) std::cerr << "Test " << #x << " == " << #y << " : " << ((x) == (y)) << std::endl;
33 #define CPPUNIT_ASSERT_DOUBLES_EQUAL(x,y,z)
34 #define CPPUNIT_ASSERT_THROW(x,y) \
35         try { x; } \
36         catch (y &e) { cerr << e.what() << endl; }
37 #endif
38
39 #include <string>
40 #include <map>
41
42 namespace YACS
43 {
44   class RuntimeTest
45 #ifdef USE_CPPUNIT
46                      : public CppUnit::TestFixture
47 #endif
48   {
49     CPPUNIT_TEST_SUITE( RuntimeTest );
50     CPPUNIT_TEST(initRuntimeTypeCode );
51     CPPUNIT_TEST(createPythonNodes );
52     CPPUNIT_TEST(createCORBANodes );
53     CPPUNIT_TEST(createBloc );
54     CPPUNIT_TEST(createRecursiveBlocs );
55     CPPUNIT_TEST(createDataLinks );
56     CPPUNIT_TEST(createPythonNodesWithScript );
57     CPPUNIT_TEST(createCORBANodesWithMethod );
58     CPPUNIT_TEST(createXMLNodes );
59     CPPUNIT_TEST(createBloc2 );
60     CPPUNIT_TEST(createDataLinksPythonPython );
61     CPPUNIT_TEST(createDataLinksPythonCORBA );
62     CPPUNIT_TEST(createDataLinksCORBACORBA );
63     CPPUNIT_TEST(createDataLinksCORBAPython );
64     CPPUNIT_TEST(createDataLinksXML );
65     CPPUNIT_TEST(manualInitInputPort );
66     CPPUNIT_TEST(manualExecuteNoThread );
67     CPPUNIT_TEST(manualGetOutputs );
68     CPPUNIT_TEST(createCppNodes );
69     CPPUNIT_TEST(convertPorts );
70     CPPUNIT_TEST(executeCppNode );
71     CPPUNIT_TEST(createGraphWithCppNodes );
72     CPPUNIT_TEST_SUITE_END();
73     
74   public:
75       
76     void setUp();
77     void tearDown();
78       
79     void initRuntimeTypeCode();
80     void createPythonNodes();
81     void createCORBANodes();
82     void createBloc();
83     void createRecursiveBlocs();
84     void createDataLinks();
85     void createPythonNodesWithScript();
86     void createCORBANodesWithMethod();
87     void createXMLNodes();
88     void createBloc2();
89     void createDataLinksPythonPython();
90     void createDataLinksPythonCORBA();
91     void createDataLinksCORBACORBA();
92     void createDataLinksCORBAPython();
93     void createDataLinksXML();
94     void manualInitInputPort();
95     void manualExecuteNoThread();
96     void manualGetOutputs();
97     void createCppNodes();
98     void executeCppNode();
99     void createGraphWithCppNodes();
100     void convertPorts();
101      
102     void classTeardown();
103     
104   protected:
105     static std::map<std::string, YACS::ENGINE::Node*> _nodeMap;
106     static std::map<std::string, YACS::ENGINE::Bloc*> _blocMap;
107     static std::list<YACS::ENGINE::TypeCodeObjref *> _ltc;
108     static int _inode;
109     static int _ibloc;
110     static YACS::ENGINE::Runtime *_myRuntime;
111
112     static  YACS::ENGINE::TypeCode *_tc_double;
113     static  YACS::ENGINE::TypeCode *_tc_int;
114     static  YACS::ENGINE::TypeCode *_tc_string;
115     static  YACS::ENGINE::TypeCode *_tc;
116     static  YACS::ENGINE::TypeCode *_tc_obj;
117     static  YACS::ENGINE::TypeCode *_tc_seqdble;
118     static  YACS::ENGINE::TypeCode *_tc_seqstr;
119     static  YACS::ENGINE::TypeCode *_tc_seqlong;
120     static  YACS::ENGINE::TypeCode *_tc_seqobj;
121     static  YACS::ENGINE::TypeCode *_tc_seqseqdble;
122     static  YACS::ENGINE::TypeCode *_tc_seqseqobj;
123     static  YACS::ENGINE::TypeCode *_tc_C;
124     static  YACS::ENGINE::TypeCode *_tc_seqC;
125     
126     static bool endTests;
127       
128   private:
129
130   };
131
132 }
133
134 #endif