Salome HOME
Kernel evolution for salome gui without neither NS nor other servers.
[modules/kernel.git] / src / KernelHelpers / KernelHelpersUseCases.cxx
index 030fd8ce11c74c7ea93d8cddcd22c24f00173803..6fa36b98ed4190bec3c2fc2c9a0920b4c110611d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2020  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -16,6 +16,7 @@
 //
 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // Author: Guillaume Boulant (EDF/R&D)
 
 #include "SALOME_KernelServices.hxx"
@@ -30,7 +31,7 @@ bool TEST_corba() {
     LOG("TEST_Corba: orb ERROR");
     return false;
   }
-  SALOME_NamingService *  ns  = KERNEL::getNamingService();
+  SALOME_NamingService_Abstract *  ns  = KERNEL::getNamingService();
   if ( ns == NULL ) {
     LOG("TEST_Corba: ns ERROR");
     return false;
@@ -60,8 +61,8 @@ bool TEST_getLifeCycleCORBA() {
   return true;
 }
 
-bool TEST_getStudyManager() {
-  SALOMEDS::Study_ptr myTestStudy = KERNEL::getStudyManager()->NewStudy(L"kerneltest");
+bool TEST_getStudy() {
+  SALOMEDS::Study_ptr myTestStudy = KERNEL::getStudyServant();
   if ( CORBA::is_nil(myTestStudy) ) {
     return false;
   }
@@ -70,9 +71,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;
 }
 
@@ -82,6 +82,7 @@ bool TEST_getSalomeLauncher() {
   for (int i=0; i<10; i++) {
     try {
       int pid = salomeLauncher->getPID();
+      SALOME_UNUSED(pid); // unused in release mode
       LOG("["<<i<<"] SALOME launcher PID = " << pid);
     }
     catch (const SALOME::SALOME_Exception & ex) {
@@ -111,10 +112,10 @@ bool TEST_getSalomeLauncher() {
 
 
 
-int main (int argc, char * argv[]) {
+int main () {
   TEST_corba();
   TEST_getLifeCycleCORBA();
-  TEST_getStudyManager();
+  TEST_getStudy();
   TEST_getSalomeLauncher();
   return 0;
 }