Back to index

salome-kernel  6.5.0
Public Member Functions | Private Member Functions
KernelHelpersUnitTests Class Reference

#include <KernelHelpersUnitTests.hxx>

List of all members.

Public Member Functions

void setUp ()
 Set up the environment.
void tearDown ()
void TEST_corba ()
 Check SalomeApp functionality.
void TEST_getLifeCycleCORBA ()
void TEST_getStudyManager ()
void TEST_getSalomeLauncher ()

Private Member Functions

 CPPUNIT_TEST_SUITE (KernelHelpersUnitTests)
 CPPUNIT_TEST (TEST_corba)
 CPPUNIT_TEST (TEST_getLifeCycleCORBA)
 CPPUNIT_TEST (TEST_getStudyManager)
 CPPUNIT_TEST (TEST_getSalomeLauncher)
 CPPUNIT_TEST_SUITE_END ()

Detailed Description

Definition at line 28 of file KernelHelpersUnitTests.hxx.


Member Function Documentation

Set up the environment.

Definition at line 37 of file KernelHelpersUnitTests.cxx.

{
}
  • delete

Definition at line 47 of file KernelHelpersUnitTests.cxx.

{
}

Check SalomeApp functionality.

Definition at line 56 of file KernelHelpersUnitTests.cxx.

{
  CORBA::ORB_var orb = KERNEL::getORB();
  CPPUNIT_ASSERT(!CORBA::is_nil(orb));

  
  SALOME_NamingService *  ns  = KERNEL::getNamingService();
  CPPUNIT_ASSERT(ns!=NULL);

  SALOME_LifeCycleCORBA * lcc = KERNEL::getLifeCycleCORBA();
  CPPUNIT_ASSERT(lcc!=NULL);
}

Here is the call graph for this function:

Definition at line 69 of file KernelHelpersUnitTests.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 = "TestComponent_i : L = 123";
  LOG(coucou_res);
  CPPUNIT_ASSERT( strcmp(coucou_res, coucou_ref) == 0 );
}

Here is the call graph for this function:

Definition at line 93 of file KernelHelpersUnitTests.cxx.

                                                    {
  Engines::SalomeLauncher_var salomeLauncher = KERNEL::getSalomeLauncher();
  try {
    int pid = salomeLauncher->getPID();
    LOG("SALOME launcher PID = " << pid);
  }
  catch (const SALOME::SALOME_Exception & ex) {
    LOG("SALOME Exception in createJob !" <<ex.details.text.in());
    CPPUNIT_ASSERT(false);
  }
  catch (const CORBA::SystemException& ex) {
    LOG("Receive SALOME System Exception: "<<ex);
    LOG("Check SALOME servers...");
    CPPUNIT_ASSERT(false);
  }
  catch (const std::exception& ex) {
    LOG("Receive undefined exception : "<<ex.what());
    CPPUNIT_ASSERT(false);
  }
}

Here is the call graph for this function:

Definition at line 80 of file KernelHelpersUnitTests.cxx.

                                                  {
  SALOMEDS::Study_ptr myTestStudy = KERNEL::getStudyManager()->NewStudy("kerneltest");
  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);
}

Here is the call graph for this function:


The documentation for this class was generated from the following files: