//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// SALOME LifeCycleCORBA : implementation of containers and engines life cycle both in Python and C++
// File : TestLifeCycleCORBA.cxx
// Author : Paul RASCLE, EDF - MARC TAJCHMAN, CEA
// SALOME LifeCycleCORBA : implementation of containers and engines life cycle both in Python and C++
// File : TestLifeCycleCORBA.cxx
// Author : Paul RASCLE, EDF - MARC TAJCHMAN, CEA
// --- get a local container,
// load an engine, and invoque methods on that engine
// --- get a local container,
// load an engine, and invoque methods on that engine
MESSAGE("FindOrLoadComponent " + containerName + "/" + "SalomeTestComponent" );
Engines::Component_var mycompo =
MESSAGE("FindOrLoadComponent " + containerName + "/" + "SalomeTestComponent" );
Engines::Component_var mycompo =
// --- get another container,
// load an engine, and invoque methods on that engine
// --- get another container,
// load an engine, and invoque methods on that engine
Engines::Component_var mycompo2 =
_LCC.FindOrLoad_Component(containerName2.c_str(),"SALOME_TestComponentPy");
Engines::Component_var mycompo2 =
_LCC.FindOrLoad_Component(containerName2.c_str(),"SALOME_TestComponentPy");
m2 = Engines::TestComponent::_narrow(mycompo2);
ASSERT(!CORBA::is_nil(m2));
SCRUTE(m2->instanceName());
m2 = Engines::TestComponent::_narrow(mycompo2);
ASSERT(!CORBA::is_nil(m2));
SCRUTE(m2->instanceName());
MESSAGE("Coucou " << m2->Coucou(1L));
// --- get a third container,
MESSAGE("Coucou " << m2->Coucou(1L));
// --- get a third container,
ASSERT(!CORBA::is_nil(mycompo3));
Engines::TestComponent_var m3 = Engines::TestComponent::_narrow(mycompo3);
ASSERT(!CORBA::is_nil(m3));
ASSERT(!CORBA::is_nil(mycompo3));
Engines::TestComponent_var m3 = Engines::TestComponent::_narrow(mycompo3);
ASSERT(!CORBA::is_nil(m3));
// --- yet another container, with hostname,
// load an engine, and invoque methods on that engine
// --- yet another container, with hostname,
// load an engine, and invoque methods on that engine
containerName4 += "/titiPy";
Engines::Component_var mycompo4 =
_LCC.FindOrLoad_Component(containerName4.c_str(),"SALOME_TestComponentPy");
ASSERT(!CORBA::is_nil(mycompo4));
Engines::TestComponent_var m4 = Engines::TestComponent::_narrow(mycompo4);
ASSERT(!CORBA::is_nil(m4));
containerName4 += "/titiPy";
Engines::Component_var mycompo4 =
_LCC.FindOrLoad_Component(containerName4.c_str(),"SALOME_TestComponentPy");
ASSERT(!CORBA::is_nil(mycompo4));
Engines::TestComponent_var m4 = Engines::TestComponent::_narrow(mycompo4);
ASSERT(!CORBA::is_nil(m4));