Salome HOME
- Deleted Study as an input parameter and class field.
[modules/kernel.git] / src / SALOMEDS / Test / SALOMEDSTest.cxx
1 // Copyright (C) 2007-2016  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License, or (at your option) any later version.
10 //
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 // Lesser General Public License for more details.
15 //
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22
23 #include "SALOMEDSTest.hxx"
24
25 #include "utilities.h"
26 #include "Utils_SINGLETON.hxx"
27 #include "Utils_ORB_INIT.hxx"
28 #include "SALOME_NamingService.hxx"
29 #include "SALOME_LifeCycleCORBA.hxx"
30
31 #include <iostream>
32 #include <fstream>
33 #include <string>
34 #include <vector>
35 #include <cstdlib>
36
37 #include "SALOMEDSClient.hxx"
38 #include "SALOMEDS_Study.hxx"
39 #include "SALOMEDS_SObject.hxx"
40
41
42
43 // ============================================================================
44 /*!
45  * Set up the environment
46  */
47 // ============================================================================
48  
49 void SALOMEDSTest::setUp()
50 {  
51   int argc = 1;
52   char* argv[] = {(char*)""};
53
54   ORB_INIT &init = *SINGLETON_<ORB_INIT>::Instance() ;
55   ASSERT(SINGLETON_<ORB_INIT>::IsAlreadyExisting());
56   _orb = init(argc , argv ) ;
57   SALOME_NamingService NS(_orb);
58   CORBA::Object_var obj = NS.Resolve( "/Study" );
59   _study = SALOMEDS::Study::_narrow( obj );
60
61   CPPUNIT_ASSERT( !CORBA::is_nil(_study) );
62 }
63
64 // ============================================================================
65 /*!
66  *  - delete trace classes
67  */
68 // ============================================================================
69
70 void SALOMEDSTest::tearDown()
71 {
72   _PTR(Study) study ( new SALOMEDS_Study(_study) );
73   if(study)
74     study->Clear();
75 }
76
77 #include "SALOMEDSTest_AttributeComment.cxx"
78 #include "SALOMEDSTest_AttributeDrawable.cxx"
79 #include "SALOMEDSTest_AttributeExpandable.cxx"
80 #include "SALOMEDSTest_AttributeExternalFileDef.cxx"
81 #include "SALOMEDSTest_AttributeFileType.cxx"
82 #include "SALOMEDSTest_AttributeFlags.cxx"
83 #include "SALOMEDSTest_AttributeGraphic.cxx"
84 #include "SALOMEDSTest_AttributeIOR.cxx"
85 #include "SALOMEDSTest_AttributeInteger.cxx"
86 #include "SALOMEDSTest_AttributeLocalID.cxx"
87 #include "SALOMEDSTest_AttributeName.cxx"
88 #include "SALOMEDSTest_AttributeOpened.cxx"
89 #include "SALOMEDSTest_AttributeParameter.cxx"
90 #include "SALOMEDSTest_AttributePersistentRef.cxx"
91 #include "SALOMEDSTest_AttributePixMap.cxx"
92 #include "SALOMEDSTest_AttributePythonObject.cxx"
93 #include "SALOMEDSTest_AttributeReal.cxx"
94 #include "SALOMEDSTest_AttributeSelectable.cxx"
95 #include "SALOMEDSTest_AttributeSequenceOfInteger.cxx"
96 #include "SALOMEDSTest_AttributeSequenceOfReal.cxx"
97 #include "SALOMEDSTest_AttributeStudyProperties.cxx"
98 #include "SALOMEDSTest_AttributeTableOfInteger.cxx"
99 #include "SALOMEDSTest_AttributeTableOfReal.cxx"
100 #include "SALOMEDSTest_AttributeTableOfString.cxx"
101 #include "SALOMEDSTest_AttributeTarget.cxx"
102 #include "SALOMEDSTest_AttributeTextColor.cxx"
103 #include "SALOMEDSTest_AttributeTextHighlightColor.cxx"
104 #include "SALOMEDSTest_AttributeTreeNode.cxx"
105 #include "SALOMEDSTest_AttributeUserID.cxx"
106 #include "SALOMEDSTest_ChildIterator.cxx"
107 #include "SALOMEDSTest_SComponent.cxx"
108 #include "SALOMEDSTest_SComponentIterator.cxx"
109 #include "SALOMEDSTest_SObject.cxx"
110 #include "SALOMEDSTest_Study.cxx"
111 #include "SALOMEDSTest_StudyBuilder.cxx"
112 #include "SALOMEDSTest_UseCase.cxx"
113
114
115 // ============================================================================
116 /*!
117  * Set up the environment
118  */
119 // ============================================================================
120  
121 void SALOMEDSTest_Embedded::setUp()
122 {  
123   int argc = 1;
124   char* argv[] = {(char*)""};
125
126   ORB_INIT &init = *SINGLETON_<ORB_INIT>::Instance() ;
127   ASSERT(SINGLETON_<ORB_INIT>::IsAlreadyExisting());
128   _orb = init(argc , argv ) ;
129   SALOME_NamingService NS(_orb);
130   CORBA::Object_var obj = NS.Resolve( "/Study_embedded" );
131   _study = SALOMEDS::Study::_narrow( obj );
132
133   CPPUNIT_ASSERT( !CORBA::is_nil(_study) );
134 }