Back to index

salome-kernel  6.5.0
Functions
KernelHelpersUseCases.cxx File Reference
#include "SALOME_KernelServices.hxx"
#include "Basics_Utils.hxx"
#include <SALOMEconfig.h>
#include <string.h>

Go to the source code of this file.

Functions

bool TEST_corba ()
bool TEST_getLifeCycleCORBA ()
bool TEST_getStudyManager ()
bool TEST_getSalomeLauncher ()
int main (int argc, char *argv[])

Function Documentation

int main ( int  argc,
char *  argv[] 
)

Definition at line 114 of file KernelHelpersUseCases.cxx.

Here is the call graph for this function:

Definition at line 27 of file KernelHelpersUseCases.cxx.

                  {
  CORBA::ORB_var orb = KERNEL::getORB();
  if ( CORBA::is_nil(orb) ) {
    LOG("TEST_Corba: orb ERROR");
    return false;
  }
  SALOME_NamingService *  ns  = KERNEL::getNamingService();
  if ( ns == NULL ) {
    LOG("TEST_Corba: ns ERROR");
    return false;
    
  }
  SALOME_LifeCycleCORBA * lcc = KERNEL::getLifeCycleCORBA();
  if ( lcc == NULL ) {
    LOG("TEST_Corba: lcc ERROR");
    return false;
  }
  LOG("TEST_Corba: OK");
  return true;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 49 of file KernelHelpersUseCases.cxx.

                              {
  Engines::EngineComponent_var component =
    KERNEL::getLifeCycleCORBA()->FindOrLoad_Component( "FactoryServer","SalomeTestComponent" );
  
  Engines::TestComponent_var engine = Engines::TestComponent::_narrow(component);
  char * coucou_res = engine->Coucou(123.);
  const char * coucou_ref = "L = 123";
  LOG(coucou_res);
  if ( strcmp(coucou_res, coucou_ref) == 0 ) {
    return false;
  }
  return true;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 80 of file KernelHelpersUseCases.cxx.

                              {
  Engines::SalomeLauncher_var salomeLauncher = KERNEL::getSalomeLauncher();
  for (int i=0; i<10; i++) {
    try {
      int pid = salomeLauncher->getPID();
      LOG("["<<i<<"] SALOME launcher PID = " << pid);
    }
    catch (const SALOME::SALOME_Exception & ex) {
      LOG("SALOME Exception in createJob !" <<ex.details.text.in());
      return false;
    }
    catch (const CORBA::SystemException& ex) {
      LOG("Receive SALOME System Exception: "<<ex);
      LOG("Check SALOME servers...");
      return false;
    }
    catch (const std::exception& ex) {
      LOG("Receive undefined exception : "<<ex.what());
    }
#ifndef WIN32
      sleep(2);
#else
      Sleep(2000);
#endif
  }
  return true;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 63 of file KernelHelpersUseCases.cxx.

                            {
  SALOMEDS::Study_ptr myTestStudy = KERNEL::getStudyManager()->NewStudy("kerneltest");
  if ( CORBA::is_nil(myTestStudy) ) {
    return false;
  }

  // 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);
  return true;
}

Here is the call graph for this function:

Here is the caller graph for this function: