Salome HOME
0023299: [CEA] Finalize multi-study removal
authorimn <imn@opencascade.com>
Fri, 23 Sep 2016 13:24:07 +0000 (16:24 +0300)
committermpa <mpa@opencascade.com>
Fri, 14 Oct 2016 06:15:27 +0000 (09:15 +0300)
- remove "study manager" and "study id" in tests

48 files changed:
src/KernelHelpers/KernelHelpersUseCases.cxx
src/KernelHelpers/Test/KernelHelpersUnitTests.cxx
src/KernelHelpers/Test/KernelHelpersUnitTests.hxx
src/SALOMEDS/SALOMEDS_Client.cxx
src/SALOMEDS/Test/CMakeLists.txt
src/SALOMEDS/Test/SALOMEDSTest.cxx
src/SALOMEDS/Test/SALOMEDSTest.hxx
src/SALOMEDS/Test/SALOMEDSTest_AttributeComment.cxx
src/SALOMEDS/Test/SALOMEDSTest_AttributeDrawable.cxx
src/SALOMEDS/Test/SALOMEDSTest_AttributeExpandable.cxx
src/SALOMEDS/Test/SALOMEDSTest_AttributeExternalFileDef.cxx
src/SALOMEDS/Test/SALOMEDSTest_AttributeFileType.cxx
src/SALOMEDS/Test/SALOMEDSTest_AttributeFlags.cxx
src/SALOMEDS/Test/SALOMEDSTest_AttributeGraphic.cxx
src/SALOMEDS/Test/SALOMEDSTest_AttributeIOR.cxx
src/SALOMEDS/Test/SALOMEDSTest_AttributeInteger.cxx
src/SALOMEDS/Test/SALOMEDSTest_AttributeLocalID.cxx
src/SALOMEDS/Test/SALOMEDSTest_AttributeName.cxx
src/SALOMEDS/Test/SALOMEDSTest_AttributeOpened.cxx
src/SALOMEDS/Test/SALOMEDSTest_AttributeParameter.cxx
src/SALOMEDS/Test/SALOMEDSTest_AttributePersistentRef.cxx
src/SALOMEDS/Test/SALOMEDSTest_AttributePixMap.cxx
src/SALOMEDS/Test/SALOMEDSTest_AttributePythonObject.cxx
src/SALOMEDS/Test/SALOMEDSTest_AttributeReal.cxx
src/SALOMEDS/Test/SALOMEDSTest_AttributeSelectable.cxx
src/SALOMEDS/Test/SALOMEDSTest_AttributeSequenceOfInteger.cxx
src/SALOMEDS/Test/SALOMEDSTest_AttributeSequenceOfReal.cxx
src/SALOMEDS/Test/SALOMEDSTest_AttributeStudyProperties.cxx
src/SALOMEDS/Test/SALOMEDSTest_AttributeTableOfInteger.cxx
src/SALOMEDS/Test/SALOMEDSTest_AttributeTableOfReal.cxx
src/SALOMEDS/Test/SALOMEDSTest_AttributeTableOfString.cxx
src/SALOMEDS/Test/SALOMEDSTest_AttributeTarget.cxx
src/SALOMEDS/Test/SALOMEDSTest_AttributeTextColor.cxx
src/SALOMEDS/Test/SALOMEDSTest_AttributeTextHighlightColor.cxx
src/SALOMEDS/Test/SALOMEDSTest_AttributeTreeNode.cxx
src/SALOMEDS/Test/SALOMEDSTest_AttributeUserID.cxx
src/SALOMEDS/Test/SALOMEDSTest_ChildIterator.cxx
src/SALOMEDS/Test/SALOMEDSTest_SComponent.cxx
src/SALOMEDS/Test/SALOMEDSTest_SComponentIterator.cxx
src/SALOMEDS/Test/SALOMEDSTest_SObject.cxx
src/SALOMEDS/Test/SALOMEDSTest_Study.cxx
src/SALOMEDS/Test/SALOMEDSTest_StudyBuilder.cxx
src/SALOMEDS/Test/SALOMEDSTest_StudyManager.cxx [deleted file]
src/SALOMEDS/Test/SALOMEDSTest_UseCase.cxx
src/SALOMEDS/Test/TestSALOMEDS.cxx
src/SALOMEDSImpl/Test/SALOMEDSImplTest.cxx
src/SALOMEDSImpl/testDS.cxx
src/TestContainer/TestContainer.cxx

index 7feaf8a2dafc67d0e137f3052e78fc82852b90e1..f408555f2c6416e924f864ffef45524892447f66 100644 (file)
@@ -60,8 +60,8 @@ bool TEST_getLifeCycleCORBA() {
   return true;
 }
 
-bool TEST_getStudyManager() {
-  SALOMEDS::Study_ptr myTestStudy = KERNEL::getStudyManager()->NewStudy("kerneltest");
+bool TEST_getStudy() {
+  SALOMEDS::Study_ptr myTestStudy = KERNEL::getStudy();
   if ( CORBA::is_nil(myTestStudy) ) {
     return false;
   }
@@ -70,9 +70,8 @@ bool TEST_getStudyManager() {
   myTestStudy->SetString("material","wood");
   myTestStudy->SetReal("volume",3.23);
 
-  // The study is characterized by an ID
-  int myTestStudyId = myTestStudy->StudyId();
-  LOG("TestComponentImpl::testkernel: study id = "<<myTestStudyId);
+  // The study with properties was opened
+  LOG("TestComponentImpl::testkernel: study with properties was opened");
   return true;
 }
 
@@ -114,7 +113,7 @@ bool TEST_getSalomeLauncher() {
 int main (int argc, char * argv[]) {
   TEST_corba();
   TEST_getLifeCycleCORBA();
-  TEST_getStudyManager();
+  TEST_getStudy();
   TEST_getSalomeLauncher();
   return 0;
 }
index a3aa4cbb72b2037b335bad20cdd215861b9788d1..d34ef0332c57727eae2c2d46debd02f0e2fe216f 100644 (file)
@@ -77,30 +77,16 @@ void KernelHelpersUnitTests::TEST_getLifeCycleCORBA() {
   CPPUNIT_ASSERT( strcmp(coucou_res, coucou_ref) == 0 );
 }
 
-void KernelHelpersUnitTests::TEST_getStudyManager() {
-  SALOMEDS::StudyManager_var studyManager = KERNEL::getStudyManager();
-
-  #ifndef ALLOW_MULTI_STUDIES
-  SALOMEDS::ListOfOpenStudies_var _list_open_studies =  studyManager->GetOpenStudies();
-  for (unsigned int ind = 0; ind < _list_open_studies->length();ind++)
-    {
-      LOG("Close study : " << _list_open_studies[ind]);
-      SALOMEDS::Study_var study = studyManager->GetStudyByName(_list_open_studies[0]);
-      if(study)
-        studyManager->Close(study);
-    }
-  #endif
-
-  SALOMEDS::Study_ptr myTestStudy = studyManager->NewStudy("kerneltest");
+void KernelHelpersUnitTests::TEST_getStudy() {
+  SALOMEDS::Study_ptr myTestStudy = KERNEL::getStudy();
   CPPUNIT_ASSERT(!CORBA::is_nil(myTestStudy));
 
   // One can use the study to store some general properties
   myTestStudy->SetString("material","wood");
   myTestStudy->SetReal("volume",3.23);
 
-  // The study is characterized by an ID
-  int myTestStudyId = myTestStudy->StudyId();
-  LOG("TestComponentImpl::testkernel: study id = "<<myTestStudyId);
+  // The study with properties was opened
+  LOG("TestComponentImpl::testkernel: study with properties was opened");
 }
 
 void KernelHelpersUnitTests::TEST_getSalomeLauncher() {
index 1f6e778f52f4d7378e10bbc4144430180ed8d4c3..ebacc674a45147088e639bba43994943cf9a600d 100644 (file)
@@ -40,7 +40,7 @@ class KERNELHELPERSTEST_EXPORT KernelHelpersUnitTests : public CppUnit::TestFixt
   CPPUNIT_TEST_SUITE( KernelHelpersUnitTests );
   CPPUNIT_TEST( TEST_corba );
   CPPUNIT_TEST( TEST_getLifeCycleCORBA );
-  CPPUNIT_TEST( TEST_getStudyManager );
+  CPPUNIT_TEST( TEST_getStudy );
   CPPUNIT_TEST( TEST_getSalomeLauncher );
   CPPUNIT_TEST_SUITE_END();
 
@@ -51,7 +51,7 @@ public:
 
   void TEST_corba();
   void TEST_getLifeCycleCORBA();
-  void TEST_getStudyManager();
+  void TEST_getStudy();
   void TEST_getSalomeLauncher();
 };
 
index 2650e1d0af08cd53a290511af5a62a25f3fc0ada..73f72ab39a0cbc06c9762ba02768b7d77926fbf0 100644 (file)
@@ -28,8 +28,8 @@
 //
 #include <SALOMEconfig.h>
 #include CORBA_SERVER_HEADER(SALOMEDS)
-#include "SALOMEDS_StudyManager_i.hxx"
 #include "SALOMEDS_AttributeName_i.hxx"
+#include "SALOME_NamingService.hxx"
 #include "utilities.h"
 #include "HDFOI.hxx"
 
@@ -85,17 +85,14 @@ static void DumpStudy (SALOMEDS::Study_ptr Study) {
  *  Purpose  : 
  */
 //============================================================================
-static void Test(SALOMEDS::StudyManager_ptr myStudyMgr )
+static void Test(SALOMEDS::Study_ptr myStudy)
 {
   try {
   char* name;
-  MESSAGE("Create New Study Study1");
-  SALOMEDS::Study_var myStudy = myStudyMgr->NewStudy("Study1");
+
   MESSAGE("Create Builder ");
   SALOMEDS::StudyBuilder_var StudyBuild = myStudy->NewBuilder();
 
-
   // Create new components
   SALOMEDS::GenericAttribute_var anAttr;
   SALOMEDS::AttributeName_var Name;
@@ -195,53 +192,34 @@ static void Test(SALOMEDS::StudyManager_ptr myStudyMgr )
   StudyBuild->Undo();
   // Study should have no trace of object mesh_cylinder
   DumpStudy(myStudy);
-
-  //myStudyMgr->Open ((char*)name);
-  //MESSAGE("Name " << name);
-
-  // GetOpenStudies
-  MESSAGE("GetOpenStudies list");
-  SALOMEDS::ListOfOpenStudies_var _list_open_studies =  myStudyMgr->GetOpenStudies();
-
-  for (unsigned int ind = 0; ind < _list_open_studies->length();ind++)
-    {
-      MESSAGE("Open studies list : " << _list_open_studies[ind]);  
-    }
-
-
-  // GetStudyByName
-  SALOMEDS::Study_var myStudy1 =myStudyMgr->GetStudyByName(_list_open_studies[0]);
-  MESSAGE("GetStudyByName done");
   
   // Save as
-  myStudyMgr->SaveAs("/home/edeville/Study1.hdf",myStudy1, false);
+  myStudy->SaveAs("/home/edeville/Study1.hdf", false);
 
   // Get Persistent Reference of the study test
-  name = myStudy1->GetPersistentReference();
+  name = myStudy->GetPersistentReference();
   MESSAGE("Persitent Reference of the study " << name);
 
   // Get Transient Reference of the study test
-  name = myStudy1->GetTransientReference();
+  name = myStudy->GetTransientReference();
   MESSAGE("Transient Reference of the study " << name);
 
   // FindComponent Test
-  SALOMEDS::SComponent_var compo = myStudy1->FindComponent("GEOM");
+  SALOMEDS::SComponent_var compo = myStudy->FindComponent("GEOM");
   // Get ComponentDataType test
   MESSAGE("Find ComponentDataType of compo");
   name = compo->ComponentDataType();
-  MESSAGE("-> ComponentDataType is "<<name);  
+  MESSAGE("-> ComponentDataType is "<<name);
 
-  
   // FindComponentID Test
-  SALOMEDS::SComponent_var compo1 = myStudy1->FindComponentID("0:1:2");
+  SALOMEDS::SComponent_var compo1 = myStudy->FindComponentID("0:1:2");
   // Get ComponentDataType test
   MESSAGE("Find ComponentDataType of compo1");
   name = compo1->ComponentDataType();
-  MESSAGE("-> ComponentDataType is "<<name);  
-
+  MESSAGE("-> ComponentDataType is "<<name);
+  
   // FindObject Test
-  SALOMEDS::SObject_var objn = myStudy1->FindObject("cylinder_0");
+  SALOMEDS::SObject_var objn = myStudy->FindObject("cylinder_0");
  // Test FindAttribute function : get AttributeName attribute
   MESSAGE("Find Name in object objn");
   if (objn->FindAttribute(anAttr, "AttributeName")) {
@@ -254,7 +232,7 @@ static void Test(SALOMEDS::StudyManager_ptr myStudyMgr )
   }
 
   // FindObjectID Test
-  SALOMEDS::SObject_var obj = myStudy1->FindObjectID("0:1:2:1:1");
+  SALOMEDS::SObject_var obj = myStudy->FindObjectID("0:1:2:1:1");
  // Test FindAttribute function : get AttributeName attribute
   MESSAGE("Find Name in object obj");
   if (obj->FindAttribute(anAttr, "AttributeName")) {
@@ -265,7 +243,7 @@ static void Test(SALOMEDS::StudyManager_ptr myStudyMgr )
   else {
     MESSAGE("-> Name is not found");
   }
-  //DumpStudy(myStudy1);
+  //DumpStudy(myStudy);
   }
   catch(HDFexception)
     {
@@ -291,9 +269,9 @@ int main(int argc, char** argv)
 
     SALOME_NamingService * salomens = new SALOME_NamingService(orb);
 
-    MESSAGE("Find StudyManager ");
-    CORBA::Object_ptr obj2 = salomens->Resolve("myStudyManager");
-    SALOMEDS::StudyManager_var myStudyMgr = SALOMEDS::StudyManager::_narrow(obj2);
+    MESSAGE("Create New Study ");
+    CORBA::Object_ptr obj2 = salomens->Resolve("Study");
+    SALOMEDS::Study_var myStudy = SALOMEDS::Study::_narrow(obj2);
 
     // Obtain a POAManager, and tell the POA to start accepting
     // requests on its objects.
@@ -301,7 +279,7 @@ int main(int argc, char** argv)
     pman->activate();
 
     // Test basic services
-    Test(myStudyMgr);
+    Test(myStudy);
 
     orb->run();
     orb->destroy();
index 67615795fb21d0d60915dba8181892d6c0523cd0..d464ab393c9dd70f1cf56c4e1544ae61a07dc409 100755 (executable)
@@ -40,6 +40,7 @@ INCLUDE_DIRECTORIES(
   ${CMAKE_CURRENT_SOURCE_DIR}/../../DF
   ${CMAKE_CURRENT_SOURCE_DIR}/../../SALOMEDSImpl
   ${CMAKE_CURRENT_SOURCE_DIR}/../../SALOMEDSImpl/Test
+  ${CMAKE_CURRENT_SOURCE_DIR}/../../GenericObj
   ${PROJECT_BINARY_DIR}/idl
 )
 
@@ -62,6 +63,7 @@ SET(COMMON_LIBS
  SalomeDSImpl
  SalomeDSClient
  SalomeDS
+ SalomeGenericObj
  SalomeIDLKernel
 )
 
index e9ddc40b6f99875661acec4b0482d7e1588fc165..173ef842547153bb62ab5f3c5a3663fbfbb5a0a5 100644 (file)
@@ -22,8 +22,6 @@
 
 #include "SALOMEDSTest.hxx"
 
-
-#include "SALOMEDS_StudyManager_i.hxx"
 #include "utilities.h"
 #include "Utils_SINGLETON.hxx"
 #include "Utils_ORB_INIT.hxx"
@@ -37,8 +35,7 @@
 #include <cstdlib>
 
 #include "SALOMEDSClient.hxx"
-#include "SALOMEDS_StudyManager_i.hxx"
-#include "SALOMEDS_StudyManager.hxx"
+#include "SALOMEDS_Study.hxx"
 #include "SALOMEDS_SObject.hxx"
 
 
@@ -58,10 +55,10 @@ void SALOMEDSTest::setUp()
   ASSERT(SINGLETON_<ORB_INIT>::IsAlreadyExisting());
   _orb = init(argc , argv ) ;
   SALOME_NamingService NS(_orb);
-  CORBA::Object_var obj = NS.Resolve( "/myStudyManager" );
-  _sm = SALOMEDS::StudyManager::_narrow( obj );
+  CORBA::Object_var obj = NS.Resolve( "/Study" );
+  _study = SALOMEDS::Study::_narrow( obj );
 
-  CPPUNIT_ASSERT( !CORBA::is_nil(_sm) ); 
+  CPPUNIT_ASSERT( !CORBA::is_nil(_study) );
 }
 
 // ============================================================================
@@ -72,13 +69,9 @@ void SALOMEDSTest::setUp()
 
 void SALOMEDSTest::tearDown()
 {
-  _PTR(StudyManager) sm ( new SALOMEDS_StudyManager(_sm) );
-  std::vector<std::string> v = sm->GetOpenStudies();
-  for(int i = 0; i<v.size(); i++) {
-    _PTR(Study) study = sm->GetStudyByName(v[i]);
-    if(study)
-      sm->Close(study);
-  }
+  _PTR(Study) study ( new SALOMEDS_Study(_study) );
+  if(study)
+    study->Clear();
 }
 
 #include "SALOMEDSTest_AttributeComment.cxx"
@@ -116,7 +109,6 @@ void SALOMEDSTest::tearDown()
 #include "SALOMEDSTest_SObject.cxx"
 #include "SALOMEDSTest_Study.cxx"
 #include "SALOMEDSTest_StudyBuilder.cxx"
-#include "SALOMEDSTest_StudyManager.cxx"
 #include "SALOMEDSTest_UseCase.cxx"
 
 
@@ -135,8 +127,8 @@ void SALOMEDSTest_Embedded::setUp()
   ASSERT(SINGLETON_<ORB_INIT>::IsAlreadyExisting());
   _orb = init(argc , argv ) ;
   SALOME_NamingService NS(_orb);
-  CORBA::Object_var obj = NS.Resolve( "/myStudyManager_embedded" );
-  _sm = SALOMEDS::StudyManager::_narrow( obj );
+  CORBA::Object_var obj = NS.Resolve( "/Study_embedded" );
+  _study = SALOMEDS::Study::_narrow( obj );
 
-  CPPUNIT_ASSERT( !CORBA::is_nil(_sm) ); 
+  CPPUNIT_ASSERT( !CORBA::is_nil(_study) );
 }
index c51ecf4e0e295d3e9fbb5631077e974ad9c1edf5..ac6207baf5e5252d53387fc2d9f4145ccd2fbd97 100644 (file)
@@ -79,7 +79,6 @@ class SALOMEDSTEST_EXPORT SALOMEDSTest : public CppUnit::TestFixture
   CPPUNIT_TEST( testSObject );
   CPPUNIT_TEST( testStudy );  
   CPPUNIT_TEST( testStudyBuilder );
-  CPPUNIT_TEST( testStudyManager );
   CPPUNIT_TEST( testUseCase );
 
 
@@ -128,13 +127,12 @@ public:
   void testSObject();
   void testStudy();
   void testStudyBuilder();
-  void testStudyManager();
   void testUseCase();
 
 protected:
 
-SALOMEDS::StudyManager_var _sm;
-CORBA::ORB_var             _orb;
+SALOMEDS::Study_var _study;
+CORBA::ORB_var      _orb;
                 
 };
 
@@ -182,7 +180,6 @@ class SALOMEDSTEST_EXPORT SALOMEDSTest_Embedded : public SALOMEDSTest
   CPPUNIT_TEST( testStudy );
   CPPUNIT_TEST( testStudyBuilder ); 
   CPPUNIT_TEST( testChildIterator );
-  CPPUNIT_TEST( testStudyManager );
   CPPUNIT_TEST( testUseCase );
   
   CPPUNIT_TEST_SUITE_END();
index 6c93cd649dbdcf287a5e8fb53a1ea19f3c72fdae..455bde6b1ff39e48cb77bfc9633208a6c92afd05 100755 (executable)
 
 void SALOMEDSTest::testAttributeComment()
 {
-  //Create or find the Study manager
-  _PTR(StudyManager) sm(new SALOMEDS_StudyManager(_sm));
-
-  CPPUNIT_ASSERT(sm);
-
-  //Create a new study
-  std::vector<std::string> ost(sm->GetOpenStudies());
-  _PTR(Study) study;
-  if(ost.empty())
-    study = sm->NewStudy("Test");
-  else
-    study = sm->GetStudyByName(ost[0]);
+  //Create Study
+  _PTR(Study) study(new SALOMEDS_Study(_study));
 
   CPPUNIT_ASSERT(study);
 
@@ -73,8 +63,7 @@ void SALOMEDSTest::testAttributeComment()
   _attr->SetValue("");
   CPPUNIT_ASSERT(_attr->Value() == "");
 
-
-  sm->Close(study);
+  study->Clear();
 }
 
 
index 0292fec2023801c7f516a04adffd5755ea966c8b..8fd7230f1cdca9df257be0e1f7dce2efb444f8d4 100755 (executable)
 
 void SALOMEDSTest::testAttributeDrawable()
 {
-  //Create or find the Study manager
-  _PTR(StudyManager) sm(new SALOMEDS_StudyManager(_sm));
-
-  CPPUNIT_ASSERT(sm);
-
-  //Create a new study
-  _PTR(Study) study = sm->NewStudy("Test");
+  //Create Study
+  _PTR(Study) study(new SALOMEDS_Study(_study));
 
   CPPUNIT_ASSERT(study);
 
@@ -67,7 +62,7 @@ void SALOMEDSTest::testAttributeDrawable()
 
   CPPUNIT_ASSERT(!_attr->IsDrawable());
 
-  sm->Close(study);
+  study->Clear();
 }
 
 
index a36edbaf648ee8084f497ec1cf679d1d61e77d44..85158e9d87a2fb55a8705a7daded2ee845ab54cd 100755 (executable)
  */
 void SALOMEDSTest::testAttributeExpandable()
 {
-  //Create or find the Study manager
-  _PTR(StudyManager) sm ( new SALOMEDS_StudyManager(_sm) );
-
-  CPPUNIT_ASSERT(sm);
-
-  //Create a new study
-  _PTR(Study) study = sm->NewStudy("Test");
+  //Create Study
+  _PTR(Study) study(new SALOMEDS_Study(_study));
 
   CPPUNIT_ASSERT(study);
 
@@ -66,7 +61,7 @@ void SALOMEDSTest::testAttributeExpandable()
 
   CPPUNIT_ASSERT(_attr->IsExpandable());
 
-  sm->Close(study);
+  study->Clear();
 }
 
 
index 3da5e7e8e7ba301964d05e059ccf3fed6aa42fb0..2800f9a8291977d05ce0cad5f5daa3cfa176528b 100755 (executable)
  */
 void SALOMEDSTest::testAttributeExternalFileDef()
 {
-  //Create or find the Study manager
-  _PTR(StudyManager) sm ( new SALOMEDS_StudyManager(_sm) );
-
-  CPPUNIT_ASSERT(sm);
-
-  //Create a new study
-  _PTR(Study) study = sm->NewStudy("Test");
+  //Create Study
+  _PTR(Study) study(new SALOMEDS_Study(_study));
 
   CPPUNIT_ASSERT(study);
 
@@ -68,8 +63,7 @@ void SALOMEDSTest::testAttributeExternalFileDef()
   _attr->SetValue("");
   CPPUNIT_ASSERT(_attr->Value() == "");
 
-
-  sm->Close(study);
+  study->Clear();
 }
 
 
index 31babb73b7834e68c0e14a7ce9f2257e37befee8..1860a9ceb9558c1f0f7200c59060aadf5c08a257 100755 (executable)
  */
 void SALOMEDSTest::testAttributeFileType()
 {
-  //Create or find the Study manager
-  _PTR(StudyManager) sm ( new SALOMEDS_StudyManager(_sm) );
-
-  CPPUNIT_ASSERT(sm);
-
-  //Create a new study
-  _PTR(Study) study = sm->NewStudy("Test");
+  //Create Study
+  _PTR(Study) study(new SALOMEDS_Study(_study));
 
   CPPUNIT_ASSERT(study);
 
@@ -68,8 +63,7 @@ void SALOMEDSTest::testAttributeFileType()
   _attr->SetValue("");
   CPPUNIT_ASSERT(_attr->Value() == "");
 
-
-  sm->Close(study);
+  study->Clear();
 }
 
 
index 7f05338545ae40469d596e4f405e81e431e8a983..cb20fb1dcd6f6cd0cf757ccb4e1bf25c57746541 100755 (executable)
  */
 void SALOMEDSTest::testAttributeFlags()
 {
-  //Create or find the Study manager
-  _PTR(StudyManager) sm ( new SALOMEDS_StudyManager(_sm) );
-
-  CPPUNIT_ASSERT(sm);
-
-  //Create a new study
-  _PTR(Study) study = sm->NewStudy("Test");
+  //Create Study
+  _PTR(Study) study(new SALOMEDS_Study(_study));
 
   CPPUNIT_ASSERT(study);
 
@@ -71,7 +66,7 @@ void SALOMEDSTest::testAttributeFlags()
 
   CPPUNIT_ASSERT(!_attr->Get(4));
 
-  sm->Close(study);
+  study->Clear();
 }
 
 
index 79c09769f81e988596fa37aaf548838f7a1dbf49..279a9198f3b9e8b8abb06a01a4ada9dadbbd41fd 100755 (executable)
  */
 void SALOMEDSTest::testAttributeGraphic()
 {
-  //Create or find the Study manager
-  _PTR(StudyManager) sm ( new SALOMEDS_StudyManager(_sm) );
-
-  CPPUNIT_ASSERT(sm);
-
-  //Create a new study
-  _PTR(Study) study = sm->NewStudy("Test");
+  //Create Study
+  _PTR(Study) study(new SALOMEDS_Study(_study));
 
   CPPUNIT_ASSERT(study);
 
@@ -68,7 +63,7 @@ void SALOMEDSTest::testAttributeGraphic()
   _attr->SetVisibility(-1, true);
   CPPUNIT_ASSERT(_attr->GetVisibility(-1));
 
-  sm->Close(study);
+  study->Clear();
 }
 
 
index 25660a648113370a74a157ba09a2219e197b558a..101af8f73f4affd8c323fa77f0c6affe613146e5 100755 (executable)
  */
 void SALOMEDSTest::testAttributeIOR()
 {
-  //Create or find the Study manager
-  _PTR(StudyManager) sm ( new SALOMEDS_StudyManager(_sm) );
-
-  CPPUNIT_ASSERT(sm);
-
-  //Create a new study
-  _PTR(Study) study = sm->NewStudy("Test");
+  //Create Study
+  _PTR(Study) study(new SALOMEDS_Study(_study));
 
   CPPUNIT_ASSERT(study);
 
@@ -57,14 +52,14 @@ void SALOMEDSTest::testAttributeIOR()
 
   CPPUNIT_ASSERT(value.empty());
 
-  std::string ior = _orb->object_to_string(_sm);
+  std::string ior = _orb->object_to_string(_study);
 
   //Check method SetValue
   _attr->SetValue(ior);
 
   CPPUNIT_ASSERT(ior == _attr->Value());
 
-  sm->Close(study);
+  study->Clear();
 }
 
 
index b5bb2d72e442b7f0a88dfe9d87c00c88e21432c1..5c79a1586fa3195085bb8eaae743b94e31429b1e 100755 (executable)
  */
 void SALOMEDSTest::testAttributeInteger()
 {
-  //Create or find the Study manager
-  _PTR(StudyManager) sm ( new SALOMEDS_StudyManager(_sm) );
-
-  CPPUNIT_ASSERT(sm);
-
-  //Create a new study
-  _PTR(Study) study = sm->NewStudy("Test");
+  //Create Study
+  _PTR(Study) study(new SALOMEDS_Study(_study));
 
   CPPUNIT_ASSERT(study);
 
@@ -60,7 +55,7 @@ void SALOMEDSTest::testAttributeInteger()
   //Check method Value
   CPPUNIT_ASSERT(_attr->Value() == value);
 
-  sm->Close(study);
+  study->Clear();
 }
 
 
index 44757f2d2cce0468cb90848ba57faba7e7a9826d..aa57ad4d7264732b5be7c429e5fd03e0340ef8f3 100755 (executable)
  */
 void SALOMEDSTest::testAttributeLocalID()
 {
-  //Create or find the Study manager
-  _PTR(StudyManager) sm ( new SALOMEDS_StudyManager(_sm) );
-
-  CPPUNIT_ASSERT(sm);
-
-  //Create a new study
-  _PTR(Study) study = sm->NewStudy("Test");
+  //Create Study
+  _PTR(Study) study(new SALOMEDS_Study(_study));
 
   CPPUNIT_ASSERT(study);
 
@@ -60,7 +55,7 @@ void SALOMEDSTest::testAttributeLocalID()
   //Check method Value
   CPPUNIT_ASSERT(_attr->Value() == value);
 
-  sm->Close(study);
+  study->Clear();
 }
 
 
index 4b1fb4a947b7bf7eb9432654e2792f3e1c19b64e..257d10a95637ce382a9e06c0bdb890b12652b764 100755 (executable)
  */
 void SALOMEDSTest::testAttributeName()
 {
-  //Create or find the Study manager
-  _PTR(StudyManager) sm ( new SALOMEDS_StudyManager(_sm) );
-
-  CPPUNIT_ASSERT(sm);
-
-  //Create a new study
-  _PTR(Study) study = sm->NewStudy("Test");
+ //Create Study
+  _PTR(Study) study(new SALOMEDS_Study(_study));
 
   CPPUNIT_ASSERT(study);
 
@@ -68,7 +63,7 @@ void SALOMEDSTest::testAttributeName()
   _attr->SetValue("");
   CPPUNIT_ASSERT(_attr->Value() == "");
 
-  sm->Close(study);
+  study->Clear();
 }
 
 
index 722ce80d624d6afd00c0d33f1f6f4517981521fe..79f6abe412e3205dab0788458f160af1584b378e 100755 (executable)
  */
 void SALOMEDSTest::testAttributeOpened()
 {
-  //Create or find the Study manager
-  _PTR(StudyManager) sm ( new SALOMEDS_StudyManager(_sm) );
-
-  CPPUNIT_ASSERT(sm);
-
-  //Create a new study
-  _PTR(Study) study = sm->NewStudy("Test");
+  //Create Study
+  _PTR(Study) study(new SALOMEDS_Study(_study));
 
   CPPUNIT_ASSERT(study);
 
@@ -66,7 +61,7 @@ void SALOMEDSTest::testAttributeOpened()
 
   CPPUNIT_ASSERT(!_attr->IsOpened());
 
-  sm->Close(study);
+  study->Clear();
 }
 
 
index b5454725114b8bcb3728e3ddf56191eea20d1be7..5c10a0872f82637ceffd82180b62d6d1cb4b7236 100755 (executable)
  */
 void SALOMEDSTest::testAttributeParameter()
 {
-  //Create or find the Study manager
-  _PTR(StudyManager) sm ( new SALOMEDS_StudyManager(_sm) );
-
-  CPPUNIT_ASSERT(sm);
-
-  //Create a new study
-  _PTR(Study) study = sm->NewStudy("Test");
+  //Create Study
+  _PTR(Study) study(new SALOMEDS_Study(_study));
 
   CPPUNIT_ASSERT(study);
 
@@ -141,7 +136,7 @@ void SALOMEDSTest::testAttributeParameter()
   CPPUNIT_ASSERT(_attr->IsSet("StrArray", PT_STRARRAY) && _attr->GetStrArray("StrArray")[1] == "world");
   */
 
-  sm->Close(study);
+  study->Clear();
 }
 
 
index a915c47132a76c14d51c8dc06c48b61eaaa39cb8..3a8ddd9fd1c38c488c2807d8f0ecc5ccd4a82bf8 100755 (executable)
  */
 void SALOMEDSTest::testAttributePersistentRef()
 {
-  //Create or find the Study manager
-  _PTR(StudyManager) sm ( new SALOMEDS_StudyManager(_sm) );
-
-  CPPUNIT_ASSERT(sm);
-
-  //Create a new study
-  _PTR(Study) study = sm->NewStudy("Test");
+  //Create Study
+  _PTR(Study) study(new SALOMEDS_Study(_study));
 
   CPPUNIT_ASSERT(study);
 
@@ -68,7 +63,7 @@ void SALOMEDSTest::testAttributePersistentRef()
   _attr->SetValue("");
   CPPUNIT_ASSERT(_attr->Value() == "");
 
-  sm->Close(study);
+  study->Clear();
 }
 
 
index abce9ee840c335a0583dbc05e8ecdd9644bdb26e..076bdb70f061fe3c1beb25cb6918e2cc0ca69060 100755 (executable)
  */
 void SALOMEDSTest::testAttributePixMap()
 {
-  //Create or find the Study manager
-  _PTR(StudyManager) sm ( new SALOMEDS_StudyManager(_sm) );
-
-  CPPUNIT_ASSERT(sm);
-
-  //Create a new study
-  _PTR(Study) study = sm->NewStudy("Test");
+  //Create Study
+  _PTR(Study) study(new SALOMEDS_Study(_study));
 
   CPPUNIT_ASSERT(study);
 
@@ -68,8 +63,7 @@ void SALOMEDSTest::testAttributePixMap()
   _attr->SetPixMap("");
   CPPUNIT_ASSERT(_attr->GetPixMap() == "");
 
-
-  sm->Close(study);
+  study->Clear();
 }
 
 
index 774aa09ab167e1173ecfa6228e1b9abf52ccbc30..1e8bbed750bc3f1c097d4a64de8d00337c38a09b 100755 (executable)
  */
 void SALOMEDSTest::testAttributePythonObject()
 {
-  //Create or find the Study manager
-  _PTR(StudyManager) sm ( new SALOMEDS_StudyManager(_sm) );
-
-  CPPUNIT_ASSERT(sm);
-
-  //Create a new study
-  _PTR(Study) study = sm->NewStudy("Test");
+  //Create Study
+  _PTR(Study) study(new SALOMEDS_Study(_study));
 
   CPPUNIT_ASSERT(study);
 
@@ -69,7 +64,7 @@ void SALOMEDSTest::testAttributePythonObject()
   _attr->SetObject("", true);
   CPPUNIT_ASSERT(_attr->GetObject() == "" && _attr->IsScript());
 
-  sm->Close(study);
+  study->Clear();
 }
 
 
index 991f922d13a59672d2f5d098430312c53bcbf213..8061ced5c99f0873e23402e6c98294e1d8befb50 100755 (executable)
  */
 void SALOMEDSTest::testAttributeReal()
 {
-  //Create or find the Study manager
-  _PTR(StudyManager) sm ( new SALOMEDS_StudyManager(_sm) );
-
-  CPPUNIT_ASSERT(sm);
-
-  //Create a new study
-  _PTR(Study) study = sm->NewStudy("Test");
+  //Create Study
+  _PTR(Study) study(new SALOMEDS_Study(_study));
 
   CPPUNIT_ASSERT(study);
 
@@ -60,7 +55,7 @@ void SALOMEDSTest::testAttributeReal()
   //Check method Value
   CPPUNIT_ASSERT(_attr->Value() == value);
 
-  sm->Close(study);
+  study->Clear();
 }
 
 
index adcf52d6fc9c3f4d1055a028dcce079524294f1b..ebf0ec2b1ddcd23cdfcdd0cd090812430920f2a3 100755 (executable)
  */
 void SALOMEDSTest::testAttributeSelectable()
 {
-  //Create or find the Study manager
-  _PTR(StudyManager) sm ( new SALOMEDS_StudyManager(_sm) );
-
-  CPPUNIT_ASSERT(sm);
-
-  //Create a new study
-  _PTR(Study) study = sm->NewStudy("Test");
+  //Create Study
+  _PTR(Study) study(new SALOMEDS_Study(_study));
 
   CPPUNIT_ASSERT(study);
 
@@ -66,7 +61,7 @@ void SALOMEDSTest::testAttributeSelectable()
 
   CPPUNIT_ASSERT(_attr->IsSelectable());
 
-  sm->Close(study);
+  study->Clear();
 }
 
 
index 62f7145150c938cdfd8c0cb776b9d2602006c5a3..e2c3e774449ce39de46def1a6f3856de4c684b90 100755 (executable)
  */
 void SALOMEDSTest::testAttributeSequenceOfInteger()
 {
-  //Create or find the Study manager
-  _PTR(StudyManager) sm ( new SALOMEDS_StudyManager(_sm) );
-
-  CPPUNIT_ASSERT(sm);
-
-  //Create a new study
-  _PTR(Study) study = sm->NewStudy("Test");
+  //Create Study
+  _PTR(Study) study(new SALOMEDS_Study(_study));
 
   CPPUNIT_ASSERT(study);
 
@@ -122,7 +117,7 @@ void SALOMEDSTest::testAttributeSequenceOfInteger()
   }
   CPPUNIT_ASSERT(isRaised);
 
-  sm->Close(study);
+  study->Clear();
 }
 
 
index 2772a71bdba051315ec084f3738adcced4b43628..851e4da2b932988fb43c475d8850919743b59705 100755 (executable)
  */
 void SALOMEDSTest::testAttributeSequenceOfReal()
 {
-  //Create or find the Study manager
-  _PTR(StudyManager) sm ( new SALOMEDS_StudyManager(_sm) );
-
-  CPPUNIT_ASSERT(sm);
-
-  //Create a new study
-  _PTR(Study) study = sm->NewStudy("Test");
+  //Create Study
+  _PTR(Study) study(new SALOMEDS_Study(_study));
 
   CPPUNIT_ASSERT(study);
 
@@ -116,7 +111,7 @@ void SALOMEDSTest::testAttributeSequenceOfReal()
   }
   CPPUNIT_ASSERT(isRaised);
 
-  sm->Close(study);
+  study->Clear();
 }
 
 
index 2f06bd76c8599ed6bfb2143a98a84c30c61dbae0..00dd040db509bc92fe59147cb6cf98e8a91798cb 100755 (executable)
  */
 void SALOMEDSTest::testAttributeStudyProperties()
 {
-  //Create or find the Study manager
-  _PTR(StudyManager) sm ( new SALOMEDS_StudyManager(_sm) );
-
-  CPPUNIT_ASSERT(sm);
-
-  //Create a new study
-  _PTR(Study) study = sm->NewStudy("Test");
+  //Create Study
+  _PTR(Study) study(new SALOMEDS_Study(_study));
 
   CPPUNIT_ASSERT(study);
 
@@ -108,7 +103,7 @@ void SALOMEDSTest::testAttributeStudyProperties()
   _attr->GetModificationsList(vs, vi[0], vi[1], vi[2], vi[3], vi[4], true);
   CPPUNIT_ASSERT(vs[0] == "srn" && vi[0][0] == 1 && vi[1][0] == 2 && vi[2][0] == 3 && vi[3][0] == 4 && vi[4][0] == 5);
 
-  sm->Close(study);
+  study->Clear();
 }
 
 
index e3acb4407f1c0999826173bf67deed9c178e9f2c..c8740823886107955de73ca74ddb62afac7937fa 100755 (executable)
  */
 void SALOMEDSTest::testAttributeTableOfInteger()
 {
-  //Create or find the Study manager
-  _PTR(StudyManager) sm ( new SALOMEDS_StudyManager(_sm) );
-
-  CPPUNIT_ASSERT(sm);
-
-  //Create a new study
-  _PTR(Study) study = sm->NewStudy("Test");
+  //Create Study
+  _PTR(Study) study(new SALOMEDS_Study(_study));
 
   CPPUNIT_ASSERT(study);
 
@@ -185,7 +180,7 @@ void SALOMEDSTest::testAttributeTableOfInteger()
 
   CPPUNIT_ASSERT(data2.size() == 3 && data2[0] == 11 && data2[1] == -22 && data2[2] == -33);
 
-  sm->Close(study);
+  study->Clear();
 }
 
 
index 5a20a4aa1853e537d12c45c942d1992a1f6a111b..6c9905d4794ea8e69de33706d021d96180873ebb 100755 (executable)
  */
 void SALOMEDSTest::testAttributeTableOfReal()
 {
-  //Create or find the Study manager
-  _PTR(StudyManager) sm ( new SALOMEDS_StudyManager(_sm) );
-
-  CPPUNIT_ASSERT(sm);
-
-  //Create a new study
-  _PTR(Study) study = sm->NewStudy("Test");
+  //Create Study
+  _PTR(Study) study(new SALOMEDS_Study(_study));
 
   CPPUNIT_ASSERT(study);
 
@@ -184,7 +179,7 @@ void SALOMEDSTest::testAttributeTableOfReal()
 
   CPPUNIT_ASSERT(data2.size() == 3 && data2[0] == 11.11 && data2[1] == -22.22 && data2[2] == -33.33);
 
-  sm->Close(study);
+  study->Clear();
 }
 
 
index 172323cbca3c1a18b19d9c69227dfd51ab797d9a..5a3baea4f1caf904f9d8bbd38b40f90dd6ab5018 100755 (executable)
  */
 void SALOMEDSTest::testAttributeTableOfString()
 {
-  //Create or find the Study manager
-  _PTR(StudyManager) sm ( new SALOMEDS_StudyManager(_sm) );
-
-  CPPUNIT_ASSERT(sm);
-
-  //Create a new study
-  _PTR(Study) study = sm->NewStudy("Test");
+  //Create Study
+  _PTR(Study) study(new SALOMEDS_Study(_study));
 
   CPPUNIT_ASSERT(study);
 
@@ -185,7 +180,7 @@ void SALOMEDSTest::testAttributeTableOfString()
 
   CPPUNIT_ASSERT(data2.size() == 3 && data2[0] == "11" && data2[1] == "-22" && data2[2] == "-33");
 
-  sm->Close(study);
+  study->Clear();
 }
 
 
index 251e9bacab0d1926381d2629305ff505ca52e319..15cea2b79817337820378274ed3fca2d6dbd153f 100755 (executable)
  */
 void SALOMEDSTest::testAttributeTarget()
 {
-  //Create or find the Study manager
-  _PTR(StudyManager) sm ( new SALOMEDS_StudyManager(_sm) );
-
-  CPPUNIT_ASSERT(sm);
-
-  //Create a new study
-  _PTR(Study) study = sm->NewStudy("Test");
+  //Create Study
+  _PTR(Study) study(new SALOMEDS_Study(_study));
 
   CPPUNIT_ASSERT(study);
 
@@ -84,7 +79,7 @@ void SALOMEDSTest::testAttributeTarget()
 
   CPPUNIT_ASSERT(v[0]->GetID() == "0:1:3");
 
-  sm->Close(study);
+  study->Clear();
 }
 
 
index 3886947fcc3068666f5f7d7c1d532033a120c6a6..a86a6d011190bc759b87fb654d916ea5971d0445 100755 (executable)
  */
 void SALOMEDSTest::testAttributeTextColor()
 {
-  //Create or find the Study manager
-  _PTR(StudyManager) sm ( new SALOMEDS_StudyManager(_sm) );
-
-  CPPUNIT_ASSERT(sm);
-
-  //Create a new study
-  _PTR(Study) study = sm->NewStudy("Test");
+  //Create Study
+  _PTR(Study) study(new SALOMEDS_Study(_study));
 
   CPPUNIT_ASSERT(study);
 
@@ -69,7 +64,7 @@ void SALOMEDSTest::testAttributeTextColor()
 
   CPPUNIT_ASSERT(color.B == color2.B);
 
-  sm->Close(study);  
+  study->Clear();
 }
 
 
index 418a0a3a49dc8f05a2f3f3f650f2dd53129d3644..d7068e542a734b2bd2cc8c6d02079d679d981816 100755 (executable)
  */
 void SALOMEDSTest::testAttributeTextHighlightColor()
 {
-  //Create or find the Study manager
-  _PTR(StudyManager) sm ( new SALOMEDS_StudyManager(_sm) );
-
-  CPPUNIT_ASSERT(sm);
-
-  //Create a new study
-  _PTR(Study) study = sm->NewStudy("Test");
+  //Create Study
+  _PTR(Study) study(new SALOMEDS_Study(_study));
 
   CPPUNIT_ASSERT(study);
 
@@ -69,7 +64,7 @@ void SALOMEDSTest::testAttributeTextHighlightColor()
 
   CPPUNIT_ASSERT(color.B == color2.B);
 
-  sm->Close(study);
+  study->Clear();
 }
 
 
index a2258b8cf2bdff3f1e0ff28d2ba818108aef95d4..d8a8affb7366daef8103514c4b8c56cfb5dd653d 100755 (executable)
 #define SALOMEDS_ALL_TESTS
 void SALOMEDSTest::testAttributeTreeNode()
 {
-  //Create or find the Study manager
-  _PTR(StudyManager) sm ( new SALOMEDS_StudyManager(_sm) );
-
-  CPPUNIT_ASSERT(sm);
-
-  //Create a new study
-  _PTR(Study) study = sm->NewStudy("Test");
+  //Create Study
+  _PTR(Study) study(new SALOMEDS_Study(_study));
 
   CPPUNIT_ASSERT(study);
 
@@ -190,7 +185,7 @@ void SALOMEDSTest::testAttributeTreeNode()
   _PTR(AttributeTreeNode) _attr_guid = studyBuilder->FindOrCreateAttribute(so, "AttributeTreeNodeGUID"+value);
   CPPUNIT_ASSERT(_attr_guid && _attr_guid->GetTreeID() == value);
   
-  sm->Close(study);
+  study->Clear();
 }
 #undef SALOMEDS_ALL_TESTS
 
index cb7e4021446fa84d6299ad2a6896a663053590fc..be68164b0fa5124e23666974d5b1620667158c10 100755 (executable)
  */
 void SALOMEDSTest::testAttributeUserID()
 {
-  //Create or find the Study manager
-  _PTR(StudyManager) sm ( new SALOMEDS_StudyManager(_sm) );
-
-  CPPUNIT_ASSERT(sm);
-
-  //Create a new study
-  _PTR(Study) study = sm->NewStudy("Test");
+  //Create Study
+  _PTR(Study) study(new SALOMEDS_Study(_study));
 
   CPPUNIT_ASSERT(study);
 
@@ -65,7 +60,7 @@ void SALOMEDSTest::testAttributeUserID()
   _PTR(AttributeUserID) _attr2 = studyBuilder->FindOrCreateAttribute(so, "AttributeUserID"+value);
   CPPUNIT_ASSERT(_attr2 && _attr2->Value() == value);
   
-  sm->Close(study);
+  study->Clear();
 }
 
 
index d4c2bdf5d0b655d1ab9fd1e30d39b147c75c9992..55d9a224f760052862308b086c2274d89deadbaa 100755 (executable)
  */
 void SALOMEDSTest::testChildIterator()
 {
-  //Create or find the Study manager
-  _PTR(StudyManager) sm ( new SALOMEDS_StudyManager(_sm) );
-
-  CPPUNIT_ASSERT(sm);
-
-  //Create a new study
-  _PTR(Study) study = sm->NewStudy("Test");
+  //Create Study
+  _PTR(Study) study(new SALOMEDS_Study(_study));
 
   CPPUNIT_ASSERT(study);
 
@@ -74,7 +69,7 @@ void SALOMEDSTest::testChildIterator()
   //Check that there are two SObject under so
   CPPUNIT_ASSERT(count == 2);
   
-  sm->Close(study);
+  study->Clear();
 }
 
 
index 8bd02ae3525f4e1ebbb081212ec758ab6249ecfb..bba4bd906e9c4e37261d17f4d818e2f4bfa6ef80 100755 (executable)
  */
 void SALOMEDSTest::testSComponent()
 {
-  //Create or find the Study manager
-  _PTR(StudyManager) sm ( new SALOMEDS_StudyManager(_sm) );
-
-  CPPUNIT_ASSERT(sm);
-
-  //Create a new study
-  _PTR(Study) study = sm->NewStudy("Test");
+  //Create Study
+  _PTR(Study) study(new SALOMEDS_Study(_study));
 
   CPPUNIT_ASSERT(study);
 
@@ -54,7 +49,7 @@ void SALOMEDSTest::testSComponent()
 
   //Check method ComponentIOR
 
-  std::string ior = _orb->object_to_string(_sm);
+  std::string ior = _orb->object_to_string(_study);
 
   _attr->SetValue(ior);
   std::string new_ior;
@@ -65,7 +60,7 @@ void SALOMEDSTest::testSComponent()
   //Check method ComponentDataType
   CPPUNIT_ASSERT(sco->ComponentDataType() == "Test");
 
-  sm->Close(study);
+  study->Clear();
 }
 
 
index cba69b2f4b7d5492e681679c139c3296200761a2..76224f2115e113e15865365f334e625785dd92f2 100755 (executable)
  */
 void SALOMEDSTest::testSComponentIterator()
 {
-  //Create or find the Study manager
-  _PTR(StudyManager) sm ( new SALOMEDS_StudyManager(_sm) );
-
-  CPPUNIT_ASSERT(sm);
-
-  //Create a new study
-  _PTR(Study) study = sm->NewStudy("Test");
+  //Create Study
+  _PTR(Study) study(new SALOMEDS_Study(_study));
 
   CPPUNIT_ASSERT(study);
 
@@ -60,7 +55,7 @@ void SALOMEDSTest::testSComponentIterator()
     CPPUNIT_ASSERT(ci->Value()->ComponentDataType() == v[i]);
   }
 
-  sm->Close(study);
+  study->Clear();
 }
 
 
index 542a6865d427d8196db794cc5b844c1b7eb512f9..2899ce0380ab83068d1d7e21814efb7efd5dd24b 100755 (executable)
 
 void SALOMEDSTest::testSObject()
 {
-  //Create or find the Study manager
-  _PTR(StudyManager) sm ( new SALOMEDS_StudyManager(_sm) );
-
-  CPPUNIT_ASSERT(sm);
-
-  //Create a new study
-  _PTR(Study) study = sm->NewStudy("TestSObject");
+  //Create Study
+  _PTR(Study) study(new SALOMEDS_Study(_study));
 
   CPPUNIT_ASSERT(study);
 
@@ -71,7 +66,7 @@ void SALOMEDSTest::testSObject()
   _PTR(AttributeName) _attrName = studyBuilder->FindOrCreateAttribute(so, "AttributeName");
   _PTR(AttributeComment) _attrComment = studyBuilder->FindOrCreateAttribute(so, "AttributeComment"); 
 
-   std::string ior = _orb->object_to_string(_sm);
+   std::string ior = _orb->object_to_string(_study);
   _attrIOR->SetValue(ior);
   _attrName->SetValue("SO name");
   _attrComment->SetValue("SO comment");
@@ -93,7 +88,7 @@ void SALOMEDSTest::testSObject()
   CPPUNIT_ASSERT(so2->GetID() == so1->GetID());
 
   //Check method GetStudy
-  CPPUNIT_ASSERT(so->GetStudy()->StudyId() == study->StudyId());
+  CPPUNIT_ASSERT(so->GetStudy() == study);
 
   //Check methods Name
   so->Name("test");
@@ -120,7 +115,7 @@ void SALOMEDSTest::testSObject()
   CORBA::Object_var obj = dynamic_cast<SALOMEDS_SObject*>(so.get())->GetObject();
   CPPUNIT_ASSERT(!CORBA::is_nil(obj));
 
-  sm->Close(study);
+  study->Clear();
 }
 
 
index f7fe1bd721d839b38a312a9a63b4e8aff5d1617f..4089fcc4737f38657c20623841f2865cac80a089 100755 (executable)
 
 void SALOMEDSTest::testStudy()
 {
-  //Create or find the Study manager
-  _PTR(StudyManager) sm ( new SALOMEDS_StudyManager(_sm) );
-
-  CPPUNIT_ASSERT(sm);
-
-  //Create a new study
-  _PTR(Study) study = sm->NewStudy("Test");
+  //Create Study
+  _PTR(Study) study(new SALOMEDS_Study(_study));
 
   //Check the creation of the study
   CPPUNIT_ASSERT(study);
@@ -50,15 +45,6 @@ void SALOMEDSTest::testStudy()
   //Check method GetTransientReference
   CPPUNIT_ASSERT(!study->GetTransientReference().empty());
 
-  //Check method StudyId
-  CPPUNIT_ASSERT(study->StudyId() > 0);
-
-  //Check method Name (get/set)
-  CPPUNIT_ASSERT(study->Name() == "Test");
-  study->Name("New name");
-  CPPUNIT_ASSERT(study->Name() == "New name");
-  study->Name("Test");
-
   //Check method URL (get/set)
   study->URL("");
   CPPUNIT_ASSERT(study->URL() == "");
@@ -122,7 +108,7 @@ void SALOMEDSTest::testStudy()
   _PTR(AttributeIOR) ior_attr_so1 = studyBuilder->FindOrCreateAttribute(so1, "AttributeIOR");
   CPPUNIT_ASSERT(ior_attr_so1);
 
-  std::string ior = _orb->object_to_string(_sm);
+  std::string ior = _orb->object_to_string(_study);
   ior_attr_so1->SetValue(ior);
   
   _PTR(SObject) so2 = studyBuilder->NewObject(so1);
@@ -212,12 +198,6 @@ void SALOMEDSTest::testStudy()
   vs = study->GetFileNames("");
   CPPUNIT_ASSERT(vs.size() == 2 && vs[0] == "filename1" && vs[1] == "filename2");
 
-  //Check method StudyId (get/set)
-  int id = study->StudyId();
-  study->StudyId(-1);
-  CPPUNIT_ASSERT(study->StudyId() == -1);
-  study->StudyId(id);
-
   //Check method FindDependances
   studyBuilder->Addreference(so2, so1);
   studyBuilder->Addreference(sco1, so1);
@@ -337,10 +317,10 @@ void SALOMEDSTest::testStudy()
   system("rm -f SRN.py");
   CPPUNIT_ASSERT(line.substr(0,50) == "### This file is generated automatically by SALOME");
 
-  //Check method Close 
+  //Check method Clear
   bool isException = false;
   try {
-    sm->Close(study);  //Close is called inside StudyManager::Close
+    study->Clear();  //Clear is called inside Study::Clear()
   }
   catch(...) {
     isException = true;
index a116d70a1c5cb23aa7bf496aed7dc17ca8bd3e64..d1c6e903699d6c089645ee7c1cb7b1719190ed16 100755 (executable)
 
 void SALOMEDSTest::testStudyBuilder()
 {
-  //Create or find the Study manager
-  _PTR(StudyManager) sm ( new SALOMEDS_StudyManager(_sm) );
-
-  CPPUNIT_ASSERT(sm);
-
-  //Create a new study
-  _PTR(Study) study = sm->NewStudy("TestStudyBuilder");
+  //Create Study
+  _PTR(Study) study(new SALOMEDS_Study(_study));
 
   CPPUNIT_ASSERT(study);
 
@@ -48,7 +43,7 @@ void SALOMEDSTest::testStudyBuilder()
   CPPUNIT_ASSERT(sco1 && sco1->ComponentDataType() == "Test");
 
   //Check method DefineComponentInstance
-  std::string ior = _orb->object_to_string(_sm);
+  std::string ior = _orb->object_to_string(_study);
   studyBuilder->DefineComponentInstance(sco1, ior);
   std::string newior;
   sco1->ComponentIOR(newior);
@@ -165,10 +160,10 @@ void SALOMEDSTest::testStudyBuilder()
   studyBuilder->SetIOR(so1, ior);
   CPPUNIT_ASSERT(so1->GetIOR() == ior);
 
-  sm->Close(study);
+  study->Clear();
 
   //Check method LoadWith
-  _PTR(Study) study2 = sm->NewStudy("Study2");
+  _PTR(Study) study2(new SALOMEDS_Study(new SALOMEDSImpl_Study()));
   
   SALOME_NamingService NS(_orb);
   CORBA::Object_var obj = SALOME_LifeCycleCORBA(&NS).FindOrLoad_Component("FactoryServer", "SMESH");
@@ -185,10 +180,11 @@ void SALOMEDSTest::testStudyBuilder()
   ior = _orb->object_to_string(drv);
   sb2->DefineComponentInstance(sco, ior);
 
-  sm->SaveAs("srn_SALOMEDS_UnitTests.hdf", study2, false);
-  sm->Close(study2);
+  study2->SaveAs("srn_SALOMEDS_UnitTests.hdf", false);
+  study2->Clear();
 
-  _PTR(Study) study3 = sm->Open("srn_SALOMEDS_UnitTests.hdf");
+  _PTR(Study) study3(new SALOMEDS_Study(new SALOMEDSImpl_Study()));
+  study3->Open("srn_SALOMEDS_UnitTests.hdf");
   _PTR(StudyBuilder) sb3 = study3->NewBuilder();
   _PTR(SComponent) aComp = study3->FindComponent("SMESH");
   CPPUNIT_ASSERT(aComp);
@@ -207,7 +203,6 @@ void SALOMEDSTest::testStudyBuilder()
     isRaised = true;
   }
 
-
   CPPUNIT_ASSERT(!isRaised);
 
   ior = "";
@@ -248,5 +243,5 @@ void SALOMEDSTest::testStudyBuilder()
   }
   CPPUNIT_ASSERT(isRaised);
 
-  sm->Close(study3);  
+  study3->Clear();
 }
diff --git a/src/SALOMEDS/Test/SALOMEDSTest_StudyManager.cxx b/src/SALOMEDS/Test/SALOMEDSTest_StudyManager.cxx
deleted file mode 100755 (executable)
index 1e4ce4e..0000000
+++ /dev/null
@@ -1,148 +0,0 @@
-// Copyright (C) 2007-2016  CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-/*!
- * Check all methods of SALOMEDS_StudyManager
- * Use code of SALOMEDS_StudyManager.cxx
- */
-void SALOMEDSTest::testStudyManager()
-{
-  //Create or find the Study manager
-  _PTR(StudyManager) sm ( new SALOMEDS_StudyManager(_sm) );
-
-  CPPUNIT_ASSERT(sm);
-
-  //Check method NewStudy
-  _PTR(Study) study1 = sm->NewStudy("Study1");
-  CPPUNIT_ASSERT(study1);
-
-  //Check method GetStudyByName
-  _PTR(Study) study3 = sm->GetStudyByName("Study1");
-  CPPUNIT_ASSERT(study3->StudyId() == study1->StudyId());
-  CPPUNIT_ASSERT(study3->Name() == study1->Name());
-
-  //Check method GetOpenStudies
-  std::vector<std::string> v = sm->GetOpenStudies();
-  CPPUNIT_ASSERT(v.size() == 1);
-
-  //Check method GetStudyByID for invalid ID
-  CPPUNIT_ASSERT(!sm->GetStudyByID(-1));
-
-  //Check methods CanPaste, CanCopy, Copy, Paste
-  _PTR(StudyBuilder) sb1 = study1->NewBuilder();
-  _PTR(SComponent) sco1 = sb1->NewComponent("Test");
-  _PTR(SObject) so1 = sb1->NewObject(sco1);
-  _PTR(AttributeName) na1 = sb1->FindOrCreateAttribute(so1, "AttributeName");
-  CPPUNIT_ASSERT(na1);
-  na1->SetValue("Some name");
-
-  CPPUNIT_ASSERT(!sm->CanCopy(so1)); //The father component has no IOR
-  
-  CPPUNIT_ASSERT(sm->Copy(so1));
-
-  CPPUNIT_ASSERT(!sm->CanPaste(so1)); //The father component has no IOR
-
-  _PTR(SObject) so1_2 = sb1->NewObject(sco1);
-  _PTR(SObject) pasted_so = sm->Paste(so1_2);
-  CPPUNIT_ASSERT(pasted_so);
-
-  _PTR(AttributeName) na2 = sb1->FindOrCreateAttribute(pasted_so, "AttributeName");
-  CPPUNIT_ASSERT(na2 && na2->Value() == "Some name");
-
-
-  //Check method SaveAs
-  sm->SaveAs("srn_UnitTest_Save.hdf", study1, false);
-  std::string url = study1->URL();
-  sm->Close(study1);
-
-  //Check method Open
-  _PTR(Study) study1_opened = sm->Open("srn_UnitTest_Save.hdf");  //Contains Test component
-  system("rm -f srn_UnitTest_Save.hdf");
-  url = study1_opened->URL();
-  CPPUNIT_ASSERT(study1_opened);
-  CPPUNIT_ASSERT(url == "srn_UnitTest_Save.hdf");
-
-  //Check method Save
-  _PTR(StudyBuilder) sb3 = study1_opened->NewBuilder();
-  _PTR(SComponent) sco3 = study1_opened->FindComponent("Test");
-  CPPUNIT_ASSERT(sco3);
-  //   Add a new SObject with AttributeName that contains "Saved study" string
-  _PTR(SObject) so3 = sb3->NewObject(sco3);
-  std::string soID = so3->GetID();
-  _PTR(AttributeName) na3 = sb3->FindOrCreateAttribute(so3, "AttributeName");
-  CPPUNIT_ASSERT(na3);
-  na3->SetValue("Saved study");
-
-  //   Save and close the study
-  sm->Save(study1_opened, false);
-
-  sm->Close(study1_opened);
-
-  //  Open saved study and find the created SObject with AttributeName, then compare the stored string
-  _PTR(Study) study2_opened = sm->Open("srn_UnitTest_Save.hdf");
-
-  system("rm -f srn_UnitTest_Save.hdf");
-
-  CPPUNIT_ASSERT(study2_opened);
-
-  _PTR(SObject) so4 = study2_opened->CreateObjectID(soID);
-  _PTR(StudyBuilder) sb4 = study2_opened->NewBuilder();
-  _PTR(AttributeName) na4 = sb4->FindOrCreateAttribute(so4, "AttributeName");
-  CPPUNIT_ASSERT(na4 && na4->Value() == "Saved study"); //Compare the value of restored attribute with string that has to be saved.
-  //Check method SaveAsASCII
-  sm->SaveAsASCII("srn_UnitTest_SaveASCII.hdf", study2_opened, false);
-  url = study2_opened->URL();
-  sm->Close(study2_opened);
-
-  _PTR(Study) study3_opened = sm->Open("srn_UnitTest_SaveASCII.hdf");  //Contains Test component
-  system("rm -f srn_UnitTest_SaveASCII.hdf");
-  CPPUNIT_ASSERT(study3_opened);
-  CPPUNIT_ASSERT(url == "srn_UnitTest_SaveASCII.hdf");
-
-  //Check method SaveASCII
-  _PTR(StudyBuilder) sb5 = study3_opened->NewBuilder();
-  _PTR(SComponent) sco5 = study3_opened->FindComponent("Test");
-  CPPUNIT_ASSERT(sco5);
-  //   Add a new SObject with AttributeName that contains "Saved study" string
-  _PTR(SObject) so5 = sb5->NewObject(sco5);
-  soID = so5->GetID();
-  _PTR(AttributeName) na5 = sb5->FindOrCreateAttribute(so5, "AttributeName");
-  CPPUNIT_ASSERT(na5);
-  na5->SetValue("Saved study ASCII");
-  //   Save and close the study
-  sm->Save(study3_opened, false);
-  sm->Close(study3_opened);
-
-  //  Open saved study and find the created SObject with AttributeName, then compare the stored string
-  _PTR(Study) study4_opened = sm->Open("srn_UnitTest_SaveASCII.hdf");
-  system("rm -f srn_UnitTest_SaveASCII.hdf");
-  CPPUNIT_ASSERT(study4_opened);
-  _PTR(SObject) so6 = study4_opened->CreateObjectID(soID);
-  _PTR(StudyBuilder) sb6 = study4_opened->NewBuilder();
-  _PTR(AttributeName) na6 = sb6->FindOrCreateAttribute(so6, "AttributeName");
-  CPPUNIT_ASSERT(na6 && na6->Value() == "Saved study ASCII"); //Compare the value of restored attribute with string that has to be saved.
-}
-
-
-
index 7db8cd10956483d9a8c9d7f0154fe6454751d846..30455b5caa51b502c9e065d55346b9cc1cc98e63 100755 (executable)
 
 void SALOMEDSTest::testUseCase()
 {
-  //Create or find the Study manager
-  _PTR(StudyManager) sm ( new SALOMEDS_StudyManager(_sm) );
-  CPPUNIT_ASSERT(sm);
+  //Create Study
+  _PTR(Study) study(new SALOMEDS_Study(_study));
 
-  //Create a new study
-  _PTR(Study) study = sm->NewStudy("TestSObject");
   CPPUNIT_ASSERT(study);
 
   //Create Study Builder
@@ -148,7 +145,7 @@ void SALOMEDSTest::testUseCase()
   CPPUNIT_ASSERT(it->More());
   CPPUNIT_ASSERT(it->Value()->GetID() == so1->GetID());
 
-  sm->Close(study);
+  study->Clear();
 }
 #undef SALOMEDS_ALL_TESTS
 
index 759cd63fe56625cf0f6da5663d89ca81e97160cf..0bbe58c1f972f79e16eed1e9b816f78d5e0ee883 100644 (file)
@@ -51,7 +51,7 @@ CPPUNIT_TEST_SUITE_REGISTRATION( SALOMEDSTest_Embedded );
 #include "Basics_Utils.hxx"
 #include "SALOME_NamingService.hxx"
 #include "NamingService_WaitForServerReadiness.hxx"
-#include "SALOMEDS_StudyManager_i.hxx"
+#include "SALOMEDS_Study_i.hxx"
 
 #ifdef WIN32
 #include <winsock2.h>
@@ -75,13 +75,13 @@ int main(int argc, char* argv[])
 
   SALOME_NamingService NS(orb);
   if(host.empty())
-    NamingService_WaitForServerReadiness(&NS, "/myStudyManager");
+    NamingService_WaitForServerReadiness(&NS, "/Study");
   else {
     std::string serverName = "/Containers/"+host+"/SuperVisionContainer";
     NamingService_WaitForServerReadiness(&NS, serverName);
   }
 
-  CORBA::Object_var obj = NS.Resolve( "/myStudyManager" );
+  CORBA::Object_var obj = NS.Resolve( "/Study" );
   if(CORBA::is_nil(obj)) {
      system("killSalome.py");
      return 1;
@@ -96,10 +96,11 @@ int main(int argc, char* argv[])
   if(!CORBA::is_nil(poaObj)) {
                 PortableServer::POA_var poa = PortableServer::POA::_narrow(poaObj);
 
-    SALOMEDS_StudyManager_i * aStudyManager_i = new  SALOMEDS_StudyManager_i(orb, poa);
+    SALOMEDS_Study_i* aStudy_i = new SALOMEDS_Study_i(orb);
     // Activate the objects.  This tells the POA that the objects are ready to accept requests.
-    PortableServer::ObjectId_var aStudyManager_iid =  poa->activate_object(aStudyManager_i);
-    aStudyManager_i->register_name("/myStudyManager_embedded");
+    PortableServer::ObjectId_var aStudy_iid =  poa->activate_object(aStudy_i);
+    SALOMEDS::Study_var Study = aStudy_i->_this();
+    NS.Register(Study.in(), "/Study_embedded");
 
     // Obtain a POAManager, and tell the POA to start accepting
     // requests on its objects.
index 1ae14790cbd5a7ee558db5444f092100a9283ea8..bd943823d3ac9e262bf659cf2400cafd2d394a65 100644 (file)
@@ -30,7 +30,6 @@
 #include "utilities.h"
 
 #include "SALOMEDSImpl_AttributeParameter.hxx"
-#include "SALOMEDSImpl_StudyManager.hxx"
 #include "SALOMEDSImpl_Study.hxx"
 #include "SALOMEDSImpl_StudyBuilder.hxx"
 #include "SALOMEDSImpl_GenericAttribute.hxx"
@@ -64,8 +63,7 @@ SALOMEDSImplTest::tearDown()
 // ============================================================================
 void SALOMEDSImplTest::testAttributeParameter()
 {
-  SALOMEDSImpl_StudyManager* sm = new SALOMEDSImpl_StudyManager();
-  SALOMEDSImpl_Study* study = sm->NewStudy("Test");
+  SALOMEDSImpl_Study* study = new SALOMEDSImpl_Study();
   SALOMEDSImpl_AttributeParameter* _ap = study->GetCommonParameters("TestComp", 0);
 
   CPPUNIT_ASSERT(_ap);
index 64008945736c9f9fea99675d535160adf9cce70a..429da3f01dabe4f80d6f6bf37063da11f97ed5e6 100644 (file)
@@ -34,7 +34,6 @@
 #include "DF_ChildIterator.hxx"
 
 #include "SALOMEDSImpl_Attributes.hxx"
-#include "SALOMEDSImpl_StudyManager.hxx"
 #include "SALOMEDSImpl_Study.hxx"
 #include "SALOMEDSImpl_StudyBuilder.hxx"
 #include "SALOMEDSImpl_SObject.hxx"
@@ -49,10 +48,8 @@ int main (int argc, char * argv[])
 {
   std::cout << "Test started " << std::endl;
 
-  SALOMEDSImpl_StudyManager* aSM = new SALOMEDSImpl_StudyManager();
-  std::cout << "Manager is created " << std::endl;
-  SALOMEDSImpl_Study* aStudy = aSM->NewStudy("SRN");
-  std::cout << "Study with id = " << aStudy->StudyId() << " is created " << std::endl; 
+  SALOMEDSImpl_Study* aStudy = new SALOMEDSImpl_Study();
+  std::cout << "Study is created" << std::endl;
 
   std::cout << "Check the study lock, locking"   << std::endl;
   aStudy->SetStudyLock("SRN");
index 4deb36b376072e9dd7a79ff12b1d201e53844a78..c31f160925dd23baaeea44914644a3202e6035e5 100644 (file)
@@ -72,7 +72,7 @@ Engines::TestComponent_ptr create_instance(Engines::Container_ptr iGenFact,
   iGenFact->load_component_Library(componenttName.c_str(),reason);
 #endif
   CORBA::string_free(reason);
-  CORBA::Object_var obj = iGenFact->create_component_instance(componenttName.c_str(), 0);
+  CORBA::Object_var obj = iGenFact->create_component_instance(componenttName.c_str());
   Engines::TestComponent_var anInstance = Engines::TestComponent::_narrow(obj);
   MESSAGE("create anInstance");
   SCRUTE(anInstance->instanceName());