You can subscribe to this list here.
| 2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(86) |
Dec
(163) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2004 |
Jan
(114) |
Feb
(254) |
Mar
(166) |
Apr
(122) |
May
(131) |
Jun
(59) |
Jul
(201) |
Aug
(85) |
Sep
(80) |
Oct
(64) |
Nov
(103) |
Dec
(36) |
| 2005 |
Jan
(231) |
Feb
(204) |
Mar
(71) |
Apr
(54) |
May
(50) |
Jun
(120) |
Jul
(17) |
Aug
(124) |
Sep
(75) |
Oct
(154) |
Nov
(37) |
Dec
(143) |
| 2006 |
Jan
(346) |
Feb
(170) |
Mar
|
Apr
|
May
(273) |
Jun
(113) |
Jul
(427) |
Aug
(570) |
Sep
(212) |
Oct
(550) |
Nov
(348) |
Dec
(314) |
| 2007 |
Jan
(709) |
Feb
(223) |
Mar
(104) |
Apr
(24) |
May
(11) |
Jun
(3) |
Jul
(5) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <tei...@us...> - 2003-11-28 17:56:38
|
Update of /cvsroot/ccmtools/ccmtools/test/CppRemoteGenerator/facet_exception/CCM_Test
In directory sc8-pr-cvs1:/tmp/cvs-serv28444/CCM_Test
Added Files:
_check_CCM_Local_CCM_Session_Hello.cc
Log Message:
+ Some tests needed for remote generator development.
--- NEW FILE: _check_CCM_Local_CCM_Session_Hello.cc ---
#include <localComponents/CCM.h>
#include <CCM_Local/HomeFinder.h>
#include <CCM_Utils/Debug.h>
#include <CCM_Utils/SmartPointer.h>
#ifdef CCM_TEST_PYTHON
#include <Python.h>
#endif
#include <CCM_Local/CCM_Session_Hello_mirror/Hello_mirror_gen.h>
#include <CCM_Local/CCM_Session_Hello_mirror/HelloHome_mirror_gen.h>
#include <CCM_Local/CCM_Session_Hello/Hello_gen.h>
#include <CCM_Local/CCM_Session_Hello/HelloHome_gen.h>
using namespace std;
using namespace CCM_Utils;
using namespace CCM_Local;
using namespace CCM_Session_Hello;
using namespace CCM_Session_Hello_mirror;
//==============================================================================
// implementation of local client test
//==============================================================================
int main ( int argc, char *argv[] )
{
int result = 0;
Debug::set_global ( true );
DEBUGNL ( "test_client_Hello_component_main ( )" );
// Get in instance of the local HomeFinder and register component homes
localComponents::HomeFinder* homeFinder = HomeFinder::Instance();
try {
homeFinder->register_home( create_HelloHomeAdapter(), "HelloHome" );
homeFinder->register_home( create_HelloHome_mirrorAdapter(), "HelloHome_mirror" );
} catch ( ... ) {
cout << "Aut'sch: there is something wrong while register homes!" << endl;
return -1;
}
try {
/*
* SET UP / DEPLOYMENT
*/
// Find component and mirror component homes
SmartPtr<HelloHome> myHelloHome ( dynamic_cast<HelloHome*>
( homeFinder->find_home_by_name ( "HelloHome" ).ptr ( ) ) );
SmartPtr<HelloHome_mirror> myHelloHomeMirror ( dynamic_cast<HelloHome_mirror*>
( homeFinder->find_home_by_name ( "HelloHome_mirror" ).ptr ( ) ) );
// Create component and mirror component instances
SmartPtr<Hello> myHello =
myHelloHome.ptr ( )->create ( );
SmartPtr<Hello_mirror> myHelloMirror =
myHelloHomeMirror.ptr()->create();
// Create provided and used (mirror) facets
SmartPtr<CCM_Console::CCM_Console> ConsoleconsoleProvides =
myHello.ptr()->provide_console();
// Connect components
myHelloMirror.ptr()->connect_console_mirror(ConsoleconsoleProvides);
// End of deployment phase
myHello.ptr()->configuration_complete();
myHelloMirror.ptr()->configuration_complete();
// Use Hello component standard functionality
cout << "> getComponentVersion() = "
<< myHello.ptr()->getComponentVersion () << endl;
cout << "> getComponentDate() = "
<< myHello.ptr()->getComponentDate() << endl;
/*
* TESTING
*/
DEBUGNL("==== Begin Test Case =============================================" );
string s = "Salomon.Automation";
long len = ConsoleconsoleProvides.ptr()->println(s);
assert(len == s.length());
try {
string s = "error";
ConsoleconsoleProvides.ptr()->println(s);
assert(0);
}
catch(CCM_Local::error& e) {
cout << "OK: error exception catched!" << endl;
}
try {
string s = "super_error";
ConsoleconsoleProvides.ptr()->println(s);
assert(0);
}
catch(CCM_Local::super_error& e) {
cout << "OK: super_error exception catched!" << endl;
}
try {
string s = "fatal_error";
ConsoleconsoleProvides.ptr()->println(s);
assert(0);
}
catch(CCM_Local::fatal_error& e) {
cout << "OK: fatal_error exception catched!" << endl;
}
DEBUGNL("==== End Test Case ===============================================" );
/*
* TEAR DOWN
*/
// Disconnect components
myHelloMirror.ptr()->disconnect_console_mirror();
// Destroy component instances
myHello.ptr ( )->remove ( );
myHelloMirror.ptr()->remove();
// Unregister component homes
homeFinder->unregister_home ( "HelloHome" );
homeFinder->unregister_home ( "HelloHome_mirror" );
DEBUGNL ( "exit test_client_Hello_component_main ( )" );
} catch ( localComponents::HomeNotFound ) {
cout << "Aut'sch: can't find a home!" << endl;
result = -1;
} catch ( localComponents::NotImplemented& e ) {
cout << "Aut'sch: " << e.what ( ) << endl;
result = -1;
} catch ( ... ) {
cout << "Aut'sch: there is something wrong!" << endl;
result = -1;
}
#ifdef CCM_TEST_PYTHON
Py_Finalize();
#endif
return result;
}
|
|
From: <tei...@us...> - 2003-11-28 17:56:38
|
Update of /cvsroot/ccmtools/ccmtools/test/CppRemoteGenerator/facet_exception In directory sc8-pr-cvs1:/tmp/cvs-serv28444 Removed Files: _check_CCM_Remote_CCM_Session_Hello_remote.cc Log Message: + Some tests needed for remote generator development. --- _check_CCM_Remote_CCM_Session_Hello_remote.cc DELETED --- |
|
From: <tei...@us...> - 2003-11-28 17:56:27
|
Update of /cvsroot/ccmtools/ccmtools/test/CppRemoteGenerator/facet_exception/src In directory sc8-pr-cvs1:/tmp/cvs-serv28409/src Log Message: Directory /cvsroot/ccmtools/ccmtools/test/CppRemoteGenerator/facet_exception/src added to the repository |
|
From: <tei...@us...> - 2003-11-28 17:55:32
|
Update of /cvsroot/ccmtools/ccmtools/test/CppRemoteGenerator/facet_basic_types/src
In directory sc8-pr-cvs1:/tmp/cvs-serv28176/src
Added Files:
Hello_app.cc Hello_mirror_app.cc
Log Message:
+ Some tests needed for remote generator development.
--- NEW FILE: Hello_app.cc ---
//==============================================================================
// Hello - business logic implementation
//==============================================================================
#include <iostream>
#include <CCM_Utils/Debug.h>
#include "Hello_app.h"
using namespace std;
using namespace CCM_Utils;
namespace CCM_Local {
namespace CCM_Session_Hello {
//==============================================================================
// business logic functionality
//==============================================================================
CCM_Console*
CCM_Hello_impl::get_console ( )
{
DEBUGNL ( " CCM_Hello_impl->get_console ( )" );
console_impl* facet = new console_impl ( this );
return dynamic_cast<CCM_Console*> ( facet );
}
//==============================================================================
// console - facet implementation
//==============================================================================
console_impl::console_impl( CCM_Hello_impl* c )
: component(c)
{
DEBUGNL ( "+console_impl->console_impl ( )" );
}
console_impl::~console_impl ( )
{
DEBUGNL ( "-console_impl->~console_impl ( )" );
}
short
console_impl::println1 ( const short p1, short& p2, short& p3 )
{
DEBUGNL ( " console_impl->println1 ( p1, p2, p3 )" );
// TODO : IMPLEMENT ME HERE !
p3=p2;
p2=p1;
return p3+p1;
}
long
console_impl::println2 ( const long p1, long& p2, long& p3 )
{
DEBUGNL ( " console_impl->println2 ( p1, p2, p3 )" );
// TODO : IMPLEMENT ME HERE !
p3=p2;
p2=p1;
return p3+p1;
}
unsigned short
console_impl::println3 ( const unsigned short p1, unsigned short& p2, unsigned short& p3 )
{
DEBUGNL ( " console_impl->println3 ( p1, p2, p3 )" );
// TODO : IMPLEMENT ME HERE !
p3=p2;
p2=p1;
return p3+p1;
}
unsigned long
console_impl::println4 ( const unsigned long p1, unsigned long& p2, unsigned long& p3 )
{
DEBUGNL ( " console_impl->println4 ( p1, p2, p3 )" );
// TODO : IMPLEMENT ME HERE !
p3=p2;
p2=p1;
return p3+p1;
}
float
console_impl::println5 ( const float p1, float& p2, float& p3 )
{
DEBUGNL ( " console_impl->println5 ( p1, p2, p3 )" );
// TODO : IMPLEMENT ME HERE !
p3=p2;
p2=p1;
return p3+p1;
}
double
console_impl::println6 ( const double p1, double& p2, double& p3 )
{
DEBUGNL ( " console_impl->println6 ( p1, p2, p3 )" );
// TODO : IMPLEMENT ME HERE !
p3=p2;
p2=p1;
return p3+p1;
}
char
console_impl::println7 ( const char p1, char& p2, char& p3 )
{
DEBUGNL ( " console_impl->println7 ( p1, p2, p3 )" );
// TODO : IMPLEMENT ME HERE !
p3=p2;
p2=p1;
return p3+p1;
}
std::string
console_impl::println8 ( const std::string& p1, std::string& p2, std::string& p3 )
{
DEBUGNL ( " console_impl->println8 ( p1, p2, p3 )" );
// TODO : IMPLEMENT ME HERE !
cout << p1 << endl;
cout << p2 << endl;
cout << p3 << endl;
p3=p2;
p2=p1;
return p3+p1;
}
bool
console_impl::println9 ( const bool p1, bool& p2, bool& p3 )
{
DEBUGNL ( " console_impl->println9 ( p1, p2, p3 )" );
// TODO : IMPLEMENT ME HERE !
p3=p2;
p2=p1;
return p3 && p1;
}
unsigned char
console_impl::println10 ( const unsigned char p1, unsigned char& p2, unsigned char& p3 )
{
DEBUGNL ( " console_impl->println10 ( p1, p2, p3 )" );
// TODO : IMPLEMENT ME HERE !
p3=p2;
p2=p1;
return p3+p1;
}
//==============================================================================
// class implementation
//==============================================================================
CCM_Hello_impl::CCM_Hello_impl ( )
{
DEBUGNL ( "+CCM_Hello_impl->CCM_Hello_impl ( )" );
}
CCM_Hello_impl::~CCM_Hello_impl ( )
{
DEBUGNL ( "-CCM_Hello_impl->~CCM_Hello_impl ( )" );
}
void
CCM_Hello_impl::set_session_context ( localComponents::SessionContext* context )
throw ( localComponents::CCMException )
{
DEBUGNL ( " CCM_Hello_impl->set_session_context ( )" );
ctx = (CCM_Hello_Context*) context;
}
void
CCM_Hello_impl::ccm_activate ( )
throw ( localComponents::CCMException )
{
DEBUGNL ( " CCM_Hello_impl->ccm_activate ( )" );
}
void
CCM_Hello_impl::ccm_passivate ( )
throw ( localComponents::CCMException )
{
DEBUGNL ( " CCM_Hello_impl->ccm_passivate ( )" );
}
void
CCM_Hello_impl::ccm_remove ( )
throw ( localComponents::CCMException )
{
DEBUGNL ( " CCM_Hello_impl->ccm_remove ( )" );
}
} // /namespace CCM_Session_Hello
} // /namespace CCM_Local
--- NEW FILE: Hello_mirror_app.cc ---
//==============================================================================
// Hello_mirror - business logic implementation
//==============================================================================
#include <iostream>
#include <CCM_Utils/Debug.h>
#include "Hello_mirror_app.h"
using namespace std;
using namespace CCM_Utils;
namespace CCM_Local {
namespace CCM_Session_Hello_mirror {
//==============================================================================
// business logic functionality
//==============================================================================
//==============================================================================
// class implementation
//==============================================================================
CCM_Hello_mirror_impl::CCM_Hello_mirror_impl ( )
{
DEBUGNL ( "+CCM_Hello_mirror_impl->CCM_Hello_mirror_impl ( )" );
}
CCM_Hello_mirror_impl::~CCM_Hello_mirror_impl ( )
{
DEBUGNL ( "-CCM_Hello_mirror_impl->~CCM_Hello_mirror_impl ( )" );
}
void
CCM_Hello_mirror_impl::set_session_context ( localComponents::SessionContext* context )
throw ( localComponents::CCMException )
{
DEBUGNL ( " CCM_Hello_mirror_impl->set_session_context ( )" );
ctx = (CCM_Hello_mirror_Context*) context;
}
void
CCM_Hello_mirror_impl::ccm_activate ( )
throw ( localComponents::CCMException )
{
DEBUGNL ( " CCM_Hello_mirror_impl->ccm_activate ( )" );
cout << "==== Begin of Test Case =========================" << endl;
CCM_Utils::SmartPtr<CCM_Console> console = ctx->get_connection_console_mirror();
short short_2=3, short_3, short_r;
short_r = console.ptr()->println1(7,short_2, short_3);
assert(short_2 == 7);
assert(short_3 == 3);
assert(short_r == 3+7);
long long_2=3, long_3, long_r;
long_r = console.ptr()->println2(7,long_2, long_3);
assert(long_2 == 7);
assert(long_3 == 3);
assert(long_r == 3+7);
unsigned short ushort_2=3, ushort_3, ushort_r;
ushort_r = console.ptr()->println3(7,ushort_2, ushort_3);
assert(ushort_2 == 7);
assert(ushort_3 == 3);
assert(ushort_r == 3+7);
unsigned long ulong_2=3, ulong_3, ulong_r;
ulong_r = console.ptr()->println4(7,ulong_2, ulong_3);
assert(ulong_2 == 7);
assert(ulong_3 == 3);
assert(ulong_r == 3+7);
float float_2=3.0, float_3, float_r;
float_r = console.ptr()->println5(7.0,float_2, float_3);
assert(float_2 == 7.0);
assert(float_3 == 3.0);
assert(float_r == 3.0+7.0);
double double_2=3.0, double_3, double_r;
double_r = console.ptr()->println6(7.0,double_2, double_3);
assert(double_2 == 7.0);
assert(double_3 == 3.0);
assert(double_r == 3.0+7.0);
char char_2=3, char_3, char_r;
char_r = console.ptr()->println7(7,char_2, char_3);
assert(char_2 == 7);
assert(char_3 == 3);
assert(char_r == 3+7);
string string_2="drei", string_3, string_r;
string_r = console.ptr()->println8("sieben",string_2, string_3);
cout << string_2 << endl;
cout << string_3 << endl;
cout << string_r << endl;
assert(string_2 == "sieben");
assert(string_3 == "drei");
assert(string_r == "dreisieben");
bool bool_2=false, bool_3, bool_r;
bool_r = console.ptr()->println9(true, bool_2, bool_3);
assert(bool_2 == true);
assert(bool_3 == false);
assert(bool_r == false && true);
unsigned char uchar_2=3, uchar_3, uchar_r;
uchar_r = console.ptr()->println10(7,uchar_2, uchar_3);
assert(uchar_2 == 7);
assert(uchar_3 == 3);
assert(uchar_r == 3+7);
cout << "==== End of Test Case ===========================" << endl;
}
void
CCM_Hello_mirror_impl::ccm_passivate ( )
throw ( localComponents::CCMException )
{
DEBUGNL ( " CCM_Hello_mirror_impl->ccm_passivate ( )" );
}
void
CCM_Hello_mirror_impl::ccm_remove ( )
throw ( localComponents::CCMException )
{
DEBUGNL ( " CCM_Hello_mirror_impl->ccm_remove ( )" );
}
} // /namespace CCM_Session_Hello_mirror
} // /namespace CCM_Local
|
|
From: <tei...@us...> - 2003-11-28 17:55:32
|
Update of /cvsroot/ccmtools/ccmtools/test/CppRemoteGenerator/facet_basic_types In directory sc8-pr-cvs1:/tmp/cvs-serv28176 Removed Files: _check_CCM_Remote_CCM_Session_Hello_remote.cc Log Message: + Some tests needed for remote generator development. --- _check_CCM_Remote_CCM_Session_Hello_remote.cc DELETED --- |
|
From: <tei...@us...> - 2003-11-28 17:55:16
|
Update of /cvsroot/ccmtools/ccmtools/test/CppRemoteGenerator/attribute_basic_types In directory sc8-pr-cvs1:/tmp/cvs-serv28126 Removed Files: _check_CCM_Remote_CCM_Session_Hello_remote.cc Log Message: + Some tests needed for remote generator development. --- _check_CCM_Remote_CCM_Session_Hello_remote.cc DELETED --- |
|
From: <tei...@us...> - 2003-11-28 17:54:35
|
Update of /cvsroot/ccmtools/ccmtools/test/CppRemoteGenerator/facet_user_types
In directory sc8-pr-cvs1:/tmp/cvs-serv28008/facet_user_types
Modified Files:
Hello.idl
Log Message:
+ Some tests needed for remote generator development.
Index: Hello.idl
===================================================================
RCS file: /cvsroot/ccmtools/ccmtools/test/CppRemoteGenerator/facet_user_types/Hello.idl,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** Hello.idl 27 Nov 2003 17:32:11 -0000 1.1
--- Hello.idl 28 Nov 2003 17:54:32 -0000 1.2
***************
*** 4,7 ****
--- 4,12 ----
*/
+ //typedef long time_t;
+
+ enum Color {red, green, blue, black, orange};
+
+ //typedef double DoubleArray[10];
struct Person {
***************
*** 19,22 ****
--- 24,30 ----
Person foo3(in Person p1, inout Person p2, out Person p3);
PersonMap foo4(in PersonMap p1, inout PersonMap p2, out PersonMap p3);
+ Color foo5(in Color c1, inout Color c2, out Color c3);
+ // DoubleArray foo6(in DoubleArray a1, inout DoubleArray a2, out DoubleArray a3);
+ // time_t foo7(in time_t t1, inout time_t t2, out time_t t3);
};
|
|
From: <tei...@us...> - 2003-11-28 17:48:32
|
Update of /cvsroot/ccmtools/ccmtools/test/CppRemoteGenerator/supports_exception/src In directory sc8-pr-cvs1:/tmp/cvs-serv27041/supports_exception/src Log Message: Directory /cvsroot/ccmtools/ccmtools/test/CppRemoteGenerator/supports_exception/src added to the repository |
|
From: <tei...@us...> - 2003-11-28 17:44:41
|
Update of /cvsroot/ccmtools/ccmtools/CppGenerator/CppRemoteTemplates
In directory sc8-pr-cvs1:/tmp/cvs-serv26417/CppRemoteTemplates
Modified Files:
MOperationFacetAdapterImpl MOperationProvidesPrototype
Log Message:
+ Implemented namespace handling for CORBA exceptions and the generation for IDL enum type adapters
Index: MOperationFacetAdapterImpl
===================================================================
RCS file: /cvsroot/ccmtools/ccmtools/CppGenerator/CppRemoteTemplates/MOperationFacetAdapterImpl,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** MOperationFacetAdapterImpl 20 Nov 2003 14:28:50 -0000 1.8
--- MOperationFacetAdapterImpl 28 Nov 2003 17:44:36 -0000 1.9
***************
*** 1,3 ****
! %(CORBAType)s %(Object)sFacetAdapter::%(Identifier)s(%(MParameterDefCORBA)s) %(MExceptionDef)s
{
DEBUGNL(" %(Object)sFacetAdapter::%(Identifier)s()");
--- 1,3 ----
! %(CORBAType)s %(Object)sFacetAdapter::%(Identifier)s(%(MParameterDefCORBA)s) %(MExceptionDefCORBA)s
{
DEBUGNL(" %(Object)sFacetAdapter::%(Identifier)s()");
Index: MOperationProvidesPrototype
===================================================================
RCS file: /cvsroot/ccmtools/ccmtools/CppGenerator/CppRemoteTemplates/MOperationProvidesPrototype,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** MOperationProvidesPrototype 27 Nov 2003 17:20:31 -0000 1.3
--- MOperationProvidesPrototype 28 Nov 2003 17:44:36 -0000 1.4
***************
*** 1,3 ****
! virtual %(CORBAType)s %(Identifier)s ( %(MParameterDefCORBA)s ) %(MExceptionDef)s;
--- 1,3 ----
! virtual %(CORBAType)s %(Identifier)s ( %(MParameterDefCORBA)s ) %(MExceptionDefCORBA)s;
|
|
From: <tei...@us...> - 2003-11-28 17:44:41
|
Update of /cvsroot/ccmtools/ccmtools/CppGenerator
In directory sc8-pr-cvs1:/tmp/cvs-serv26417
Modified Files:
CppRemoteGeneratorImpl.java
Log Message:
+ Implemented namespace handling for CORBA exceptions and the generation for IDL enum type adapters
Index: CppRemoteGeneratorImpl.java
===================================================================
RCS file: /cvsroot/ccmtools/ccmtools/CppGenerator/CppRemoteGeneratorImpl.java,v
retrieving revision 1.29
retrieving revision 1.30
diff -C2 -d -r1.29 -r1.30
*** CppRemoteGeneratorImpl.java 27 Nov 2003 17:20:31 -0000 1.29
--- CppRemoteGeneratorImpl.java 28 Nov 2003 17:44:36 -0000 1.30
***************
*** 330,334 ****
vars.put("LanguageType", lang_type);
vars.put("CORBAType", getCORBALanguageType(operation));
! vars.put("MExceptionDef", getOperationExcepts(operation));
vars.put("MParameterDefAll", getOperationParams(operation));
vars.put("MParameterDefCORBA", getCORBAOperationParams(operation));
--- 330,334 ----
vars.put("LanguageType", lang_type);
vars.put("CORBAType", getCORBALanguageType(operation));
! vars.put("MExceptionDefCORBA", getCORBAExcepts(operation));
vars.put("MParameterDefAll", getOperationParams(operation));
vars.put("MParameterDefCORBA", getCORBAOperationParams(operation));
***************
*** 670,689 ****
}
// Handle operation parameter types and passing rules
if (object instanceof MParameterDef) {
MParameterDef param = (MParameterDef) object;
MParameterMode direction = param.getDirection();
! String prefix = "";
! String suffix = "";
if (direction == MParameterMode.PARAM_IN) {
! if(!(idl_type instanceof MPrimitiveDef)) {
! // Simple IDL types are passed as IN parameter witout const
! prefix = "const ";
}
}
else if(direction == MParameterMode.PARAM_OUT) {
if(idl_type instanceof MStringDef) {
! // OUT string is a special case in the CORBA to C++ mapping!
return "CORBA::String_out";
}
--- 670,698 ----
}
+ // Reduce MAliasDef to the original type
+ if(idl_type instanceof MAliasDef) {
+ idl_type = ((MTyped)idl_type).getIdlType();
+ }
+
// Handle operation parameter types and passing rules
if (object instanceof MParameterDef) {
MParameterDef param = (MParameterDef) object;
MParameterMode direction = param.getDirection();
! String prefix = "const ";
! String suffix = "&";
+ // IN Parameter
if (direction == MParameterMode.PARAM_IN) {
! if(idl_type instanceof MPrimitiveDef
! || idl_type instanceof MEnumDef
! || idl_type instanceof MArrayDef) {
! prefix = "";
! suffix = "";
}
}
+ // OUT Parameter
else if(direction == MParameterMode.PARAM_OUT) {
if(idl_type instanceof MStringDef) {
! // OUT string is a special case
return "CORBA::String_out";
}
***************
*** 692,712 ****
}
}
else if(direction == MParameterMode.PARAM_INOUT) {
! suffix = "&";
! }
!
! if ((idl_type instanceof MTypedefDef) ||
! (idl_type instanceof MFixedDef)) {
! suffix = "&";
}
return prefix + corba_type + suffix;
}
else if(object instanceof MOperationDef) {
! // Handle operation return types
! if(idl_type instanceof MStructDef ||
! idl_type instanceof MAliasDef) {
return corba_type + "*";
! }
! }
return corba_type;
--- 701,729 ----
}
}
+ // INOUT Parameter
else if(direction == MParameterMode.PARAM_INOUT) {
! prefix = "";
! if(idl_type instanceof MArrayDef) {
! suffix = "";
! }
}
return prefix + corba_type + suffix;
}
+
+ // Handle operation return types
else if(object instanceof MOperationDef) {
!
! // ToDo separate fixed and variable struct
! if(idl_type instanceof MPrimitiveDef
! || idl_type instanceof MEnumDef) {
! return corba_type;
! }
! else if(idl_type instanceof MArrayDef) {
! return corba_type + "_slice*";
! }
! else
return corba_type + "*";
! }
!
return corba_type;
***************
*** 752,767 ****
* @return Generated code as a string.
*/
! protected String getOperationExcepts(MOperationDef op)
{
Debug.println(Debug.METHODS,"CppRemoteGenerator.getOperationExcepts()");
List ret = new ArrayList();
! for (Iterator es = op.getExceptionDefs().iterator(); es.hasNext(); )
! ret.add(((MExceptionDef) es.next()).getIdentifier());
! if (ret.size() > 0)
return "throw(CORBA::SystemException, " + join(", ", ret) + " )";
else
! return "";
}
--- 769,791 ----
* @return Generated code as a string.
*/
! protected String getCORBAExcepts(MOperationDef op)
{
Debug.println(Debug.METHODS,"CppRemoteGenerator.getOperationExcepts()");
List ret = new ArrayList();
! for (Iterator es = op.getExceptionDefs().iterator(); es.hasNext(); ) {
! MExceptionDef IdlException = (MExceptionDef)es.next();
! List scope = getScope((MContained)IdlException);
! if(scope.size() > 0)
! ret.add("::" + join("::", scope) + "::" + IdlException.getIdentifier());
! else
! ret.add("::" + IdlException.getIdentifier());
! }
! if (ret.size() > 0) {
return "throw(CORBA::SystemException, " + join(", ", ret) + " )";
+ }
else
! return "throw(CORBA::SystemException)";
}
***************
*** 791,794 ****
--- 815,822 ----
ret.add(convertPrimitiveParameterFromCorbaToCpp(p));
}
+ else if(idl_type instanceof MEnumDef) {
+ MEnumDef idl_enum = (MEnumDef)idl_type;
+ ret.add(convertEnumParameterFromCorbaToCpp(p, idl_enum));
+ }
else if(idl_type instanceof MStructDef) {
MTypedefDef idl_typedef = (MTypedefDef)idl_type;
***************
*** 816,821 ****
}
-
-
protected String convertPrimitiveParameterFromCorbaToCpp(MParameterDef p)
{
--- 844,847 ----
***************
*** 835,838 ****
--- 861,884 ----
}
+ protected String convertEnumParameterFromCorbaToCpp(MParameterDef p, MEnumDef idl_enum)
+ {
+ MParameterMode direction = p.getDirection();
+
+ List ret = new ArrayList();
+ ret.add(" CCM_Local::" + getFullScopeIdentifier(idl_enum) + " parameter_"
+ + p.getIdentifier() + ";");
+ if(direction != MParameterMode.PARAM_OUT) {
+ ret.add(" switch(" + p.getIdentifier() + ") {");
+ for (Iterator members = idl_enum.getMembers().iterator(); members.hasNext(); ) {
+ String member = (String)members.next();
+ ret.add(" case " + member + ": parameter_" + p.getIdentifier()
+ + " = CCM_Local::" + getFullScopeIdentifier(idl_enum)
+ + "(" + member + "); break;");
+ }
+ ret.add(" }");
+ }
+ return join("\n", ret) + "\n";
+ }
+
protected String convertStructParameterFromCorbaToCpp(MParameterDef p,
MStructDef idl_struct,
***************
*** 941,944 ****
--- 987,994 ----
" result;";
}
+ else if(idl_type instanceof MEnumDef) {
+ MEnumDef idl_enum = (MEnumDef)idl_type;
+ ret_string = " CCM_Local::" + getFullScopeIdentifier(idl_enum) + " result;";
+ }
else if(idl_type instanceof MStructDef) {
MTypedefDef idl_typedef = (MTypedefDef)idl_type;
***************
*** 988,991 ****
--- 1038,1042 ----
if(idl_type instanceof MPrimitiveDef
|| idl_type instanceof MStringDef
+ || idl_type instanceof MEnumDef
|| idl_type instanceof MStructDef
|| idl_type instanceof MAliasDef) {
***************
*** 1032,1035 ****
--- 1083,1090 ----
ret.add(convertPrimitiveParameterFromCppToCorba(p));
}
+ else if(idl_type instanceof MEnumDef) {
+ MEnumDef idl_enum = (MEnumDef)idl_type;
+ ret.add(convertEnumParameterFromCppToCorba(p, idl_enum));
+ }
else if(idl_type instanceof MStructDef) {
MTypedefDef idl_typedef = (MTypedefDef)idl_type;
***************
*** 1076,1079 ****
--- 1131,1151 ----
}
+ protected String convertEnumParameterFromCppToCorba(MParameterDef p, MEnumDef idl_enum)
+ {
+ List ret = new ArrayList();
+ MParameterMode direction = p.getDirection();
+
+ if(direction != MParameterMode.PARAM_IN) {
+ ret.add(" switch(parameter_" + p.getIdentifier() + ") {");
+ for (Iterator members = idl_enum.getMembers().iterator(); members.hasNext(); ) {
+ String member = (String)members.next();
+ ret.add(" case " + member + ": " + p.getIdentifier() + " = "
+ + "::" + getFullScopeIdentifier(idl_enum) + "(" + member + "); break;");
+ }
+ ret.add(" }");
+ }
+ return join("\n", ret);
+ }
+
protected String convertStructParameterFromCppToCorba(MParameterDef p,
MStructDef idl_struct,
***************
*** 1222,1225 ****
--- 1294,1302 ----
ret.add(convertPrimitiveResultFromCppToCorba(op));
}
+ else if(idl_type instanceof MEnumDef) {
+ MEnumDef idl_enum = (MEnumDef)idl_type;
+ ret.add(convertEnumResultFromCppToCorba(idl_enum));
+ ret.add(" return return_value;");
+ }
else if(idl_type instanceof MStructDef) {
MTypedefDef idl_typedef = (MTypedefDef)idl_type;
***************
*** 1262,1265 ****
--- 1339,1357 ----
}
+ protected String convertEnumResultFromCppToCorba(MEnumDef idl_enum)
+ {
+ List ret = new ArrayList();
+ ret.add(" ::" + getFullScopeIdentifier(idl_enum) + " return_value;");
+ ret.add(" switch(result) {");
+ for (Iterator members = idl_enum.getMembers().iterator(); members.hasNext(); ) {
+ String member = (String)members.next();
+
+ ret.add(" case " + member + ": return_value = ::"
+ + getFullScopeIdentifier(idl_enum) + "(" + member + "); break;");
+ }
+ ret.add(" }");
+ return join("\n", ret);
+ }
+
protected String convertStructResultFromCppToCorba(MStructDef idl_struct,
String CorbaPrefix,
***************
*** 1360,1369 ****
List ret = new ArrayList();
for (Iterator es = op.getExceptionDefs().iterator(); es.hasNext(); ) {
! String exception_name = ((MExceptionDef) es.next()).getIdentifier();
! ret.add(" catch(const CCM_Local::"
! + exception_name
! + "&) { \n throw "
! + exception_name
! + "();\n }");
}
return join("\n", ret);
--- 1452,1467 ----
List ret = new ArrayList();
for (Iterator es = op.getExceptionDefs().iterator(); es.hasNext(); ) {
! MExceptionDef IdlException = (MExceptionDef)es.next();
! List scope = getScope(IdlException);
! String IdlExceptionScope = "";
!
! if(scope.size() >0) {
! IdlExceptionScope = join("::", scope) + "::";
! }
! ret.add(" catch(const CCM_Local::" + IdlExceptionScope
! + IdlException.getIdentifier() + "&) { ");
! ret.add(" throw " + "::" + IdlExceptionScope
! + IdlException.getIdentifier() + "();");
! ret.add(" }");
}
return join("\n", ret);
|
|
From: <tei...@us...> - 2003-11-27 17:32:18
|
Update of /cvsroot/ccmtools/ccmtools/test/CppRemoteGenerator/supports_exception/CCM_Test
In directory sc8-pr-cvs1:/tmp/cvs-serv12261/supports_exception/CCM_Test
Added Files:
_check_CCM_Remote_CCM_Session_Hello_remote.cc
Log Message:
I added some test cases for the remote generator. Note that these tests will be removed (and added in the test/CppGenerator) after the remote generator is able to run all user_type tests.
--- NEW FILE: _check_CCM_Remote_CCM_Session_Hello_remote.cc ---
#include <cstdlib>
#include <iostream>
#include <string>
#include <CCM_Utils/Debug.h>
#include <CORBA.h>
#include <coss/CosNaming.h>
#include <CCM_Remote/CCM_Session_Hello/HelloHome_remote.h>
#include <Hello.h>
using namespace std;
using namespace CCM_Utils;
//==============================================================================
// Implementation of remote client test
//==============================================================================
int main (int argc, char *argv[])
{
Debug::set_global(true);
DEBUGNL("C++_remote_test_client()");
// Initialize ORB
int argc_=3;
char ns[200];
sprintf(ns,"NameService=%s",getenv("CCM_NAME_SERVICE"));
char* argv_[] = {"", "-ORBInitRef", ns };
DEBUGNL(ns);
CORBA::ORB_var orb = CORBA::ORB_init(argc_, argv_);
/**
* Server-side code
*/
CCM::register_all_factories (orb);
int error = deploy_HelloHome(orb, "HelloHome:1.0");
if(!error) {
cout << "HelloHome stand-alone server is running..." << endl;
}
else {
cerr << "ERROR: Can't start components!" << endl;
assert(0);
}
/**
* Client-side code
*/
CORBA::Object_var obj = orb->resolve_initial_references ("NameService");
CosNaming::NamingContextExt_var nc =
CosNaming::NamingContextExt::_narrow (obj);
assert (!CORBA::is_nil (nc));
// Deployment
// Find ComponentHomes in the Naming-Service
obj = nc->resolve_str ("HelloHome:1.0");
assert (!CORBA::is_nil (obj));
HelloHome_var myHelloHome = HelloHome::_narrow (obj);
// Create component instances
Hello_var myHello = myHelloHome->create();
// Provide facets
myHello->configuration_complete();
DEBUGNL("==== Begin Test Case =============================================" );
char* s = CORBA::string_dup("Salomon.Automation");
CORBA::Long len;
len = myHello->println(s);
assert(len == strlen(s));
try {
char* s = CORBA::string_dup("error");
myHello->println(s);
assert(0);
}
catch(const ::error& e) {
cout << "OK: error exception catched!" << endl;
}
catch(const CORBA::SystemException& e) {
cout << "CORBA::SystemException catched!" << endl;
assert(0);
}
try {
char* s = CORBA::string_dup("super_error");
myHello->println(s);
assert(0);
}
catch(const ::super_error& e) {
cout << "OK: super_error exception catched!" << endl;
}
catch(const CORBA::SystemException& e) {
cout << "CORBA::SystemException catched!" << endl;
assert(0);
}
try {
char* s = CORBA::string_dup("fatal_error");
myHello->println(s);
assert(0);
}
catch(const ::fatal_error& e) {
cout << "OK: fatal_error exception catched!" << endl;
}
catch(const CORBA::SystemException& e) {
cout << "CORBA::SystemException catched!" << endl;
assert(0);
}
DEBUGNL("==== End Test Case ===============================================" );
// Un-Deployment
// Destroy component instances
myHello->remove();
}
|
|
From: <tei...@us...> - 2003-11-27 17:32:18
|
Update of /cvsroot/ccmtools/ccmtools/test/CppRemoteGenerator/supports_exception
In directory sc8-pr-cvs1:/tmp/cvs-serv12261/supports_exception
Added Files:
Hello.idl
Log Message:
I added some test cases for the remote generator. Note that these tests will be removed (and added in the test/CppGenerator) after the remote generator is able to run all user_type tests.
--- NEW FILE: Hello.idl ---
/**
* Test case: supports exception
*
*/
exception error{};
exception super_error{};
exception fatal_error{};
interface Console {
long println(in string s2)
raises (error, super_error, fatal_error);
};
component Hello supports Console
{
};
home HelloHome manages Hello
{
};
|
Update of /cvsroot/ccmtools/ccmtools/test/CppRemoteGenerator/facet_user_types/CCM_Test
In directory sc8-pr-cvs1:/tmp/cvs-serv12261/facet_user_types/CCM_Test
Added Files:
_check_CCM_Local_CCM_Session_Hello.cc
_check_CCM_Remote_CCM_Session_Hello_remote.cc
Log Message:
I added some test cases for the remote generator. Note that these tests will be removed (and added in the test/CppGenerator) after the remote generator is able to run all user_type tests.
--- NEW FILE: _check_CCM_Local_CCM_Session_Hello.cc ---
#include <localComponents/CCM.h>
#include <CCM_Local/HomeFinder.h>
#include <CCM_Utils/Debug.h>
#include <CCM_Utils/SmartPointer.h>
#ifdef CCM_TEST_PYTHON
#include <Python.h>
#endif
#include <CCM_Local/CCM_Session_Hello_mirror/Hello_mirror_gen.h>
#include <CCM_Local/CCM_Session_Hello_mirror/HelloHome_mirror_gen.h>
#include <CCM_Local/CCM_Session_Hello/Hello_gen.h>
#include <CCM_Local/CCM_Session_Hello/HelloHome_gen.h>
using namespace std;
using namespace CCM_Utils;
using namespace CCM_Local;
using namespace CCM_Session_Hello;
using namespace CCM_Session_Hello_mirror;
//==============================================================================
// implementation of local client test
//==============================================================================
int main ( int argc, char *argv[] )
{
int result = 0;
localComponents::HomeFinder* homeFinder;
SmartPtr<Hello> myHello;
SmartPtr<Hello_mirror> myHelloMirror;
SmartPtr<CCM_Local::CCM_Console> console;
Debug::set_global ( true );
DEBUGNL ( "test_client_Hello_component_main ( )" );
// get an instance of the local HomeFinder and register component homes
homeFinder = HomeFinder::Instance ( );
try {
homeFinder->register_home( create_HelloHomeAdapter ( ), "HelloHome" );
homeFinder->register_home( create_HelloHome_mirrorAdapter ( ), "HelloHome_mirror" );
} catch ( ... ) {
cout << "REGISTER: there is something wrong!" << endl;
return -1;
}
#ifdef CCM_TEST_PYTHON
Py_Initialize();
#endif
/* SET UP / DEPLOYMENT */
try {
// find component/mirror homes, instantiate components
SmartPtr<HelloHome> myHelloHome ( dynamic_cast<HelloHome*>
( homeFinder->find_home_by_name ( "HelloHome" ).ptr ( ) ) );
SmartPtr<HelloHome_mirror> myHelloHomeMirror ( dynamic_cast<HelloHome_mirror*>
( homeFinder->find_home_by_name ( "HelloHome_mirror" ).ptr ( ) ) );
myHello = myHelloHome.ptr ( )->create ( );
myHelloMirror = myHelloHomeMirror.ptr ( )->create ( );
// create facets, connect components
console = myHello.ptr()->provide_console();
myHelloMirror.ptr ( )->connect_console_mirror(console);
myHello.ptr ( )->configuration_complete ( );
myHelloMirror.ptr ( )->configuration_complete ( );
} catch ( localComponents::HomeNotFound ) {
cout << "DEPLOY: can't find a home!" << endl;
result = -1;
} catch ( localComponents::NotImplemented& e ) {
cout << "DEPLOY: function not implemented: " << e.what ( ) << endl;
result = -1;
} catch ( localComponents::InvalidName& e ) {
cout << "DEPLOY: invalid name during connection: " << e.what ( ) << endl;
result = -1;
} catch ( ... ) {
cout << "DEPLOY: there is something wrong!" << endl;
result = -1;
}
if (result < 0) return result;
/* TESTING */
try {
// check basic functionality
cout << "> getComponentVersion ( ) = "
<< myHello.ptr ( )->getComponentVersion ( ) << endl;
cout << "> getComponentDate ( ) = "
<< myHello.ptr ( )->getComponentDate ( ) << endl;
DEBUGNL("==== Begin Test Case =============================================" );
/*
* Test Case for: struct Value { long id; string name; };
*/
Person Value_1, Value_2, Value_3, Value_r;
Value_1.name = "egon"; Value_1.id = 3;
Value_2.name = "andrea"; Value_2.id = 23;
Value_r = console.ptr()->foo3(Value_1,Value_2,Value_3);
assert(Value_3.name == "andrea");
assert(Value_2.name == "egon");
assert(Value_r.name == "egonandrea");
/*
* Test Case for: typedef sequence<Value> map;
*/
PersonMap map_1, map_2, map_3, map_r;
for(int i=0;i<5;i++) {
Person v1, v2;
v1.name = "1";
v1.id = i;
map_1.push_back(v1);
v2.name = "2";
v2.id = i+i;
map_2.push_back(v2);
}
map_r = console.ptr()->foo4(map_1,map_2,map_3);
for(int i=0;i<map_r.size();i++) {
Person v = map_r.at(i);
assert(v.id == i);
}
for(int i=0;i<map_2.size();i++) {
Person v = map_2.at(i);
assert(v.id == i);
}
for(int i=0;i<map_3.size();i++) {
Person v = map_3.at(i);
assert(v.id == i+i);
}
DEBUGNL("==== End Test Case ===============================================" );
} catch ( localComponents::NotImplemented& e ) {
cout << "TEST: function not implemented: " << e.what ( ) << endl;
result = -1;
} catch ( ... ) {
cout << "TEST: there is something wrong!" << endl;
result = -1;
}
if (result < 0) return result;
/* TEAR DOWN */
try {
// disconnect components, destroy instances, unregister homes
myHelloMirror.ptr ( )->disconnect_console_mirror();
myHello.ptr ( )->remove ( );
myHelloMirror.ptr ( )->remove ( );
homeFinder->unregister_home ( "HelloHome" );
homeFinder->unregister_home ( "HelloHome_mirror" );
} catch ( localComponents::HomeNotFound ) {
cout << "TEARDOWN: can't find a home!" << endl;
result = -1;
} catch ( localComponents::NotImplemented& e ) {
cout << "TEARDOWN: function not implemented: " << e.what ( ) << endl;
result = -1;
} catch ( ... ) {
cout << "TEARDOWN: there is something wrong!" << endl;
result = -1;
}
#ifdef CCM_TEST_PYTHON
Py_Finalize();
#endif
DEBUGNL ( "exit test_client_Hello_component_main ( )" );
return result;
}
--- NEW FILE: _check_CCM_Remote_CCM_Session_Hello_remote.cc ---
#include <cstdlib>
#include <iostream>
#include <string>
#include <CCM_Utils/Debug.h>
#include <CORBA.h>
#include <coss/CosNaming.h>
#include <CCM_Remote/CCM_Session_Hello/HelloHome_remote.h>
#include <Hello.h>
using namespace std;
using namespace CCM_Utils;
//==============================================================================
// Implementation of remote client test
//==============================================================================
int main (int argc, char *argv[])
{
Debug::set_global(true);
DEBUGNL("C++_remote_test_client()");
int argc_=3;
char ns[200];
sprintf(ns,"NameService=%s",getenv("CCM_NAME_SERVICE"));
char* argv_[] = {"", "-ORBInitRef", ns };
DEBUGNL(ns);
// Initialize ORB
CORBA::ORB_var orb = CORBA::ORB_init(argc_, argv_);
/**
* Server-side code
*/
CCM::register_all_factories (orb);
int error = deploy_HelloHome(orb, "HelloHome:1.0");
if(!error) {
cout << "HelloHome stand-alone server is running..." << endl;
}
else {
cerr << "ERROR: Can't start components!" << endl;
assert(0);
}
// orb->run();
/**
* Client-side code
*/
CORBA::Object_var obj = orb->resolve_initial_references ("NameService");
CosNaming::NamingContextExt_var nc =
CosNaming::NamingContextExt::_narrow (obj);
assert (!CORBA::is_nil (nc));
// Deployment
// Find ComponentHomes in the Naming-Service
obj = nc->resolve_str ("HelloHome:1.0");
assert (!CORBA::is_nil (obj));
HelloHome_var myHelloHome = HelloHome::_narrow (obj);
// Create component instances
Hello_var myHello = myHelloHome->create();
// Provide facets
//Console_var console = myHello->provide_console();
Console_var Consoleconsole = myHello->provide_console();
myHello->configuration_complete();
DEBUGNL("==== Begin Test Case =============================================" );
/*
* Test Case for: typedef sequence<long>
*/
{
LongList_var list_1 = new LongList;
LongList_var list_2 = new LongList;
list_1->length(5);
list_2->length(5);
for(int i=0;i<5;i++) {
(*list_1)[i] = i;
(*list_2)[i] = i+i;
}
LongList_var list_3;
LongList_var list_r;
list_r = Consoleconsole->foo1(list_1,list_2,list_3);
for(CORBA::Long i=0;i<list_r->length();i++) {
assert((*list_r)[i]== i);
}
for(CORBA::Long i=0;i<list_2->length();i++) {
assert((*list_2)[i]== i);
}
for(CORBA::Long i=0;i<list_3->length();i++) {
assert((*list_3)[i]== i+i);
}
}
/*
* Test Case for: typedef sequence<string>
*/
{
StringList_var list_1 = new StringList;
StringList_var list_2 = new StringList;
list_1->length(5);
list_2->length(5);
for(int i=0;i<5;i++) {
(*list_1)[i] = "egon";
(*list_2)[i] = "andrea";
}
StringList_var list_3;
StringList_var list_r;
list_r = Consoleconsole->foo2(list_1,list_2,list_3);
/*
for(CORBA::Long i=0;i<list_r->length();i++) {
assert((*list_r)[i]== i);
}
for(CORBA::Long i=0;i<list_2->length();i++) {
assert((*list_2)[i]== i);
}
for(CORBA::Long i=0;i<list_3->length();i++) {
assert((*list_3)[i]== i+i);
}
*/
}
/*
* Test Case for: struct Value { long id; string name; };
*/
{
Person p1;
Person_var p2 = new Person;
Person_var p3;
Person_var result;
p1.name = CORBA::string_dup("egon");
p1.id = 3;
p2->name = CORBA::string_dup("andrea");
p2->id = 23;
result = Consoleconsole->foo3(p1,p2,p3);
assert(strcmp(p3->name, "andrea") == 0);
assert(strcmp(p2->name, "egon") == 0);
assert(strcmp(result->name, "egonandrea") == 0);
}
/*
* Test Case for: typedef sequence<struct>
*/
{
PersonMap_var map_1 = new PersonMap;
PersonMap_var map_2 = new PersonMap;
map_1->length(5);
map_2->length(5);
for(int i=0;i<5;i++) {
(*map_1)[i].name = "1";
(*map_1)[i].id = i;
(*map_2)[i].name = "2";
(*map_2)[i].id = i+i;
}
PersonMap_var map_3;
PersonMap_var map_r;
map_r = Consoleconsole->foo4(map_1,map_2,map_3);
for(CORBA::Long i=0;i<map_r->length();i++) {
assert((*map_r)[i].id == i);
}
for(CORBA::Long i=0;i<map_2->length();i++) {
assert((*map_2)[i].id == i);
}
for(CORBA::Long i=0;i<map_3->length();i++) {
assert((*map_3)[i].id == i+i);
}
}
DEBUGNL("==== End Test Case ===============================================" );
// Un-Deployment
// Destroy component instances
myHello->remove();
}
|
|
From: <tei...@us...> - 2003-11-27 17:32:17
|
Update of /cvsroot/ccmtools/ccmtools/test/CppRemoteGenerator/supports/CCM_Test
In directory sc8-pr-cvs1:/tmp/cvs-serv12261/supports/CCM_Test
Added Files:
_check_CCM_Remote_CCM_Session_Hello_remote.cc
Log Message:
I added some test cases for the remote generator. Note that these tests will be removed (and added in the test/CppGenerator) after the remote generator is able to run all user_type tests.
--- NEW FILE: _check_CCM_Remote_CCM_Session_Hello_remote.cc ---
#include <cstdlib>
#include <iostream>
#include <string>
#include <CCM_Utils/Debug.h>
#include <CORBA.h>
#include <coss/CosNaming.h>
#include <CCM_Remote/CCM_Session_Hello/HelloHome_remote.h>
#include <Hello.h>
using namespace std;
using namespace CCM_Utils;
//==============================================================================
// Implementation of remote client test
//==============================================================================
int main (int argc, char *argv[])
{
Debug::set_global(true);
DEBUGNL("C++_remote_test_client()");
// Initialize ORB
int argc_=3;
char ns[200];
sprintf(ns,"NameService=%s",getenv("CCM_NAME_SERVICE"));
char* argv_[] = {"", "-ORBInitRef", ns };
DEBUGNL(ns);
CORBA::ORB_var orb = CORBA::ORB_init(argc_, argv_);
/**
* Server-side code
*/
CCM::register_all_factories (orb);
int error = deploy_HelloHome(orb, "HelloHome:1.0");
if(!error) {
cout << "HelloHome stand-alone server is running..." << endl;
}
else {
cerr << "ERROR: Can't start components!" << endl;
assert(0);
}
/**
* Client-side code
*/
CORBA::Object_var obj = orb->resolve_initial_references ("NameService");
CosNaming::NamingContextExt_var nc =
CosNaming::NamingContextExt::_narrow (obj);
assert (!CORBA::is_nil (nc));
// Deployment
// Find ComponentHomes in the Naming-Service
obj = nc->resolve_str ("HelloHome:1.0");
assert (!CORBA::is_nil (obj));
HelloHome_var myHelloHome = HelloHome::_narrow (obj);
// Create component instances
Hello_var myHello = myHelloHome->create();
// Provide facets
myHello->configuration_complete();
DEBUGNL("==== Begin Test Case =============================================" );
char* s = CORBA::string_dup("0123456789");
CORBA::Long len;
len = myHello->println(s);
assert(len == strlen(s));
DEBUGNL("==== End Test Case ===============================================" );
// Un-Deployment
// Destroy component instances
myHello->remove();
}
|
|
From: <tei...@us...> - 2003-11-27 17:32:17
|
Update of /cvsroot/ccmtools/ccmtools/test/CppRemoteGenerator/supports_basic_types
In directory sc8-pr-cvs1:/tmp/cvs-serv12261/supports_basic_types
Added Files:
Hello.idl
Log Message:
I added some test cases for the remote generator. Note that these tests will be removed (and added in the test/CppGenerator) after the remote generator is able to run all user_type tests.
--- NEW FILE: Hello.idl ---
/**
* Test case: supports basic types
*
*/
interface Console {
short println1(in short p1, inout short p2, out short p3);
long println2(in long p1, inout long p2, out long p3);
unsigned short println3(in unsigned short p1, inout unsigned short p2, out unsigned short p3);
unsigned long println4(in unsigned long p1, inout unsigned long p2, out unsigned long p3);
float println5(in float p1, inout float p2, out float p3);
double println6(in double p1, inout double p2, out double p3);
char println7(in char p1, inout char p2, out char p3);
string println8(in string p1, inout string p2, out string p3);
boolean println9(in boolean p1, inout boolean p2, out boolean p3);
octet println10(in octet p1, inout octet p2, out octet p3);
};
component Hello supports Console
{
};
home HelloHome manages Hello
{
};
|
|
From: <tei...@us...> - 2003-11-27 17:32:17
|
Update of /cvsroot/ccmtools/ccmtools/test/CppRemoteGenerator/facet_user_types/src
In directory sc8-pr-cvs1:/tmp/cvs-serv12261/facet_user_types/src
Added Files:
Hello_app.cc Hello_remote.cc
Log Message:
I added some test cases for the remote generator. Note that these tests will be removed (and added in the test/CppGenerator) after the remote generator is able to run all user_type tests.
--- NEW FILE: Hello_app.cc ---
//==============================================================================
// Hello - business logic implementation
//==============================================================================
#include <iostream>
#include <CCM_Utils/Debug.h>
#include "Hello_app.h"
using namespace std;
using namespace CCM_Utils;
using namespace CCM_Local;
namespace CCM_Local {
namespace CCM_Session_Hello {
//==============================================================================
// business logic functionality
//==============================================================================
CCM_Console*
CCM_Hello_impl::get_console ( )
{
DEBUGNL ( " CCM_Hello_impl->get_console ( )" );
console_impl* facet = new console_impl(this);
return dynamic_cast<CCM_Console*> ( facet );
}
//==============================================================================
// console - facet implementation
//==============================================================================
console_impl::console_impl ( CCM_Hello_impl* component_impl )
: component ( component_impl )
{
DEBUGNL ( "+console_impl->console_impl ( )" );
}
console_impl::~console_impl ( )
{
DEBUGNL ( "-console_impl->~console_impl ( )" );
}
LongList
console_impl::foo1 ( const LongList& l1, LongList& l2, LongList& l3 )
{
DEBUGNL ( " console_impl->foo1 ( l1, l2, l3 )" );
LongList r;
for(int i=0;i<l1.size();i++) {
r.push_back(i);
l3.push_back(l2.at(i));
l2.at(i) = l1.at(i);
}
return r;
}
StringList
console_impl::foo2 ( const StringList& s1, StringList& s2, StringList& s3 )
{
DEBUGNL ( " console_impl->foo2 ( s1, s2, s3 )" );
StringList r;
for(int i=0;i<s1.size();i++) {
r.push_back("test");
s3.push_back(s2.at(i));
s2.at(i) = s1.at(i);
}
return r;
}
Person
console_impl::foo3 ( const Person& p1, Person& p2, Person& p3 )
{
DEBUGNL ( " console_impl->foo3 ( p1, p2, p3 )" );
cout << p1.name << endl;
cout << p2.name << endl;
cout << p3.name << endl;
Person r;
r.name = p1.name + p2.name;
r.id = p1.id + p2.id;
p3=p2;
p2=p1;
return r;
}
PersonMap
console_impl::foo4 ( const PersonMap& p1, PersonMap& p2, PersonMap& p3 )
{
DEBUGNL ( " console_impl->foo4 ( p1, p2, p3 )" );
PersonMap r;
for(int i=0;i<p1.size();i++) {
Person v;
v.name = "test";
v.id = i;
r.push_back(v);
p3.push_back(p2.at(i));
p2.at(i) = p1.at(i);
}
return r;
}
//==============================================================================
// class implementation
//==============================================================================
CCM_Hello_impl::CCM_Hello_impl ( )
{
DEBUGNL ( "+CCM_Hello_impl->CCM_Hello_impl ( )" );
}
CCM_Hello_impl::~CCM_Hello_impl ( )
{
DEBUGNL ( "-CCM_Hello_impl->~CCM_Hello_impl ( )" );
}
void
CCM_Hello_impl::set_session_context ( localComponents::SessionContext* context )
throw ( localComponents::CCMException )
{
DEBUGNL ( " CCM_Hello_impl->set_session_context ( )" );
ctx = dynamic_cast<CCM_Hello_Context*> ( context );
}
void
CCM_Hello_impl::ccm_activate ( )
throw ( localComponents::CCMException )
{
DEBUGNL ( " CCM_Hello_impl->ccm_activate ( )" );
}
void
CCM_Hello_impl::ccm_passivate ( )
throw ( localComponents::CCMException )
{
DEBUGNL ( " CCM_Hello_impl->ccm_passivate ( )" );
}
void
CCM_Hello_impl::ccm_remove ( )
throw ( localComponents::CCMException )
{
DEBUGNL ( " CCM_Hello_impl->ccm_remove ( )" );
}
} // /namespace CCM_Session_Hello
} // /namespace CCM_Local
--- NEW FILE: Hello_remote.cc ---
/*
* This file was automatically generated by CCM Tools
* (http://ccmtools.sourceforge.net)
* DO NOT EDIT!
*/
#include "Hello_remote.h"
using namespace std;
using namespace CCM_Utils;
namespace CCM_Remote {
namespace CCM_Session_Hello {
//============================================================================
// Component remote adapter
//============================================================================
Hello_impl::Hello_impl(CCM_Local::CCM_Session_Hello::CCM_Hello_impl* i, CCM::SessionContainer * c)
: local_adapter(i), ccm_container (c)
{
DEBUGNL("+Hello_impl::Hello_impl()");
local_context = new CCM_Hello_Context_impl(this,ccm_container);
console_facet_adapter = NULL;
}
Hello_impl::~Hello_impl ()
{
DEBUGNL("-Hello_impl::~Hello_impl()");
delete local_adapter;
delete local_context;
}
/*
* ReleaseInformation (extensions to CCM)
*
* These methods provides strings that carries information about version
* and creation date of a component.
*/
char* Hello_impl::getComponentVersion()
{
DEBUGNL(" Hello_impl::getComponentVersion()");
// TODO
return CORBA::string_dup("0.0");
}
char* Hello_impl::getComponentDate()
{
DEBUGNL(" Hello_impl::getComponentDate()");
// TODO
return CORBA::string_dup("0000-00-00");
}
char* Hello_impl::getComponentUUID()
{
DEBUGNL(" Hello_impl::getComponentUUID()");
// TODO
return CORBA::string_dup("no UUID");
}
/*
* Component Attributes
*/
/*
* Supported Interfaces
*/
/*
* Equivalent IDL methods
*/
// Facets
// console
Console_ptr Hello_impl::provide_console()
{
DEBUGNL(" Hello_impl::provide_console()");
if (console_facet_adapter == 0) {
console_facet_adapter = new consoleFacetAdapter(local_adapter);
CORBA::Object_var _facet_ref =
ccm_container->activate_facet(this, "console",NULL/* _instance_for_facet_calc*/,
console_facet_adapter);
reference_for_facet_console = Console::_narrow(_facet_ref);
}
return Console::_duplicate (reference_for_facet_console);
}
// Receptacles
// Publishers not supported
// Emitters not supported
// Consumers not suppored
/*
* Inherited Navigation interface
*/
CORBA::Object_ptr
Hello_impl::provide_facet (const char* name)
{
DEBUGNL(" Hello_impl::provide_facet()");
if (strcmp(name, "console") == 0) {
return provide_console();
}
throw Components::InvalidName();
return CORBA::Object::_nil ();
}
Components::FacetDescriptions *
Hello_impl::get_all_facets ()
{
DEBUGNL(" Hello_impl::get_all_facets()");
// TODO
return NULL;
}
Components::FacetDescriptions *
Hello_impl::get_named_facets (const Components::NameList & _names)
{
DEBUGNL(" Hello_impl::get_named_facets()");
// TODO
return NULL;
}
CORBA::Boolean
Hello_impl::same_component (CORBA::Object_ptr _ref)
{
DEBUGNL(" Hello_impl::same_component()");
// TODO
return false;
}
/*
* Inherited Receptacles interface
*/
Components::Cookie *
Hello_impl::connect (const char* name, CORBA::Object_ptr ref)
{
DEBUGNL(" Hello_impl::connect()");
throw Components::InvalidName();
return new CCM::Cookie_impl;
}
void
Hello_impl::disconnect (const char* name, Components::Cookie* _ck)
{
DEBUGNL(" Hello_impl::disconnect()");
throw Components::InvalidName();
}
Components::ConnectionDescriptions *
Hello_impl::get_connections (const char * _name)
{
DEBUGNL(" Hello_impl::get_connections()");
// TODO
return NULL;
}
Components::ReceptacleDescriptions *
Hello_impl::get_all_receptacles ()
{
DEBUGNL(" Hello_impl::get_all_receptacles()");
// TODO
return NULL;
}
Components::ReceptacleDescriptions *
Hello_impl::get_named_receptacles (const Components::NameList & _names)
{
DEBUGNL(" Hello_impl::get_named_receptacles()");
// TODO
return NULL;
}
/*
* Inherited Events interface
*/
Components::EventConsumerBase_ptr
Hello_impl::get_consumer (const char * _name)
{
DEBUGNL(" Hello_impl::get_consumer()");
throw Components::InvalidName();
return Components::EventConsumerBase::_nil ();
}
Components::ConsumerDescriptions *
Hello_impl::get_all_consumers ()
{
DEBUGNL(" Hello_impl::get_all_consumers()");
Components::NameList _allnames;
_allnames.length (0);
return get_named_consumers (_allnames);
}
Components::ConsumerDescriptions *
Hello_impl::get_named_consumers (const Components::NameList & _names)
{
DEBUGNL(" Hello_impl::get_named_consumers()");
Components::ConsumerDescriptions_var _res = new Components::ConsumerDescriptions;
_res->length (_names.length());
for (CORBA::ULong _idx=0; _idx<_names.length(); _idx++) {
throw Components::InvalidName();
}
return _res._retn();
}
Components::Cookie *
Hello_impl::subscribe (const char * _name, Components::EventConsumerBase_ptr _ref)
{
DEBUGNL(" Hello_impl::subscribe()");
throw Components::InvalidName();
return new CCM::Cookie_impl;
}
void
Hello_impl::unsubscribe (const char * _name, Components::Cookie * _ck)
{
DEBUGNL(" Hello_impl::unsubscribe()");
throw Components::InvalidName();
}
Components::PublisherDescriptions *
Hello_impl::get_all_publishers ()
{
DEBUGNL(" Hello_impl::get_all_publishers()");
Components::NameList _allnames;
_allnames.length (0);
return get_named_publishers (_allnames);
}
Components::PublisherDescriptions *
Hello_impl::get_named_publishers (const Components::NameList & _names)
{
DEBUGNL(" Hello_impl::get_named_publishers()");
Components::PublisherDescriptions_var _res = new Components::PublisherDescriptions;
_res->length (_names.length());
for (CORBA::ULong _idx=0; _idx<_names.length(); _idx++) {
throw Components::InvalidName();
}
return _res._retn();
}
void
Hello_impl::connect_consumer (const char * _name, Components::EventConsumerBase_ptr _ref)
{
DEBUGNL(" Hello_impl::connect_consumer()");
throw Components::InvalidName();
}
Components::EventConsumerBase_ptr
Hello_impl::disconnect_consumer (const char * _name)
{
DEBUGNL(" Hello_impl::disconnect_consumer()");
throw Components::InvalidName();
}
Components::EmitterDescriptions *
Hello_impl::get_all_emitters ()
{
DEBUGNL(" Hello_impl::get_all_emitters()");
Components::NameList _allnames;
_allnames.length (0);
return get_named_emitters (_allnames);
}
Components::EmitterDescriptions *
Hello_impl::get_named_emitters (const Components::NameList & _names)
{
DEBUGNL(" Hello_impl::get_named_emitters()");
Components::EmitterDescriptions_var _res = new Components::EmitterDescriptions;
_res->length (_names.length());
for (CORBA::ULong _idx=0; _idx<_names.length(); _idx++) {
throw Components::InvalidName();
}
return _res._retn();
}
/*
* Inherited CCMObject interface
*/
CORBA::Object_ptr
Hello_impl::get_component_def ()
{
DEBUGNL(" Hello_impl::get_component_def()");
// TODO
return CORBA::Object::_nil ();
}
Components::CCMHome_ptr
Hello_impl::get_ccm_home ()
{
DEBUGNL(" Hello_impl::get_ccm_home()");
return ccm_container->get_reference_for_home ();
}
void
Hello_impl::configuration_complete ()
{
DEBUGNL(" Hello_impl::configuration_complete()");
ccm_container->configuration_complete (this);
local_adapter->set_session_context(local_context);
local_adapter->ccm_activate ();
}
Components::ComponentPortDescription *
Hello_impl::get_all_ports ()
{
DEBUGNL(" Hello_impl::get_all_ports()");
// TODO
return NULL;
}
void
Hello_impl::remove ()
{
DEBUGNL(" Hello_impl::remove()");
local_adapter->ccm_passivate();
local_adapter->ccm_remove();
Components::CCMHome_var myhome = get_ccm_home ();
Components::CCMObject_var myself = ccm_container->get_reference_for_component (this);
myhome->remove_component (myself);
}
/*
* Overload default implementation
*/
CORBA::Object_ptr
Hello_impl::_get_component ()
{
DEBUGNL(" Hello_impl::_get_component()");
return ccm_container->get_reference_for_component (this);
}
//============================================================================
// Component Context
//============================================================================
CCM_Hello_Context_impl::
CCM_Hello_Context_impl(Hello_impl* c, CCM::SessionContainer* co)
: component_adapter(c), ccm_container(co)
{
DEBUGNL("+CCM_Hello_Context_impl->CCM_Hello_Context_impl()");
}
CCM_Hello_Context_impl::~CCM_Hello_Context_impl()
{
DEBUGNL("-CCM_Hello_Context_impl->~CCM_Hello_Context_impl()");
}
localComponents::Principal*
CCM_Hello_Context_impl::get_caller_principal()
{
DEBUGNL(" CCM_Hello_Context_impl->get_caller_principal()");
// TODO
return NULL;
}
localComponents::HomeExecutorBase*
CCM_Hello_Context_impl::get_CCM_home()
{
DEBUGNL(" CCM_Hello_Context_impl->get_CCM_home()");
// TODO
return NULL;
}
bool
CCM_Hello_Context_impl::get_rollback_only()
throw (localComponents::IllegalState)
{
DEBUGNL(" CCM_Hello_Context_impl->get_rollback_only()");
// TODO
return false;
}
localTransaction::UserTransaction*
CCM_Hello_Context_impl::get_user_transaction()
throw (localComponents::IllegalState)
{
DEBUGNL(" CCM_Hello_Context_impl->get_user_transaction()");
// TODO
return NULL;
}
bool
CCM_Hello_Context_impl::is_caller_in_role(const string& role)
{
DEBUGNL(" CCM_Hello_Context_impl->is_caller_in_role()");
// TODO
return false;
}
void
CCM_Hello_Context_impl::set_rollback_only()
throw (localComponents::IllegalState)
{
DEBUGNL(" CCM_Hello_Context_impl->set_rollback_only()");
// TODO
}
localComponents::Object*
CCM_Hello_Context_impl::get_CCM_object()
throw(localComponents::IllegalState)
{
DEBUGNL(" CCM_Hello_Context_impl->get_CCM_object()");
// TODO
return NULL;
}
//============================================================================
// console remote facet adapter
//============================================================================
consoleFacetAdapter::consoleFacetAdapter(CCM_Local::CCM_Session_Hello::CCM_Hello_impl* lc)
: local_component(lc)
{
DEBUGNL("+consoleFacetAdapter::consoleFacetAdapter()");
local_adapter = local_component->get_console();
}
consoleFacetAdapter::~consoleFacetAdapter()
{
DEBUGNL("-consoleFacetAdapter::~consoleFacetAdapter()");
delete local_adapter;
}
char* consoleFacetAdapter::foo1(const char* s1, char*& s2, CORBA::String_out s3)
{
DEBUGNL(" consoleFacetAdapter::foo1()");
// %(MParameterDefConvertParameter)s
std::string parameter_s1 = CCM::CORBAPK_STRING_to_PK_STRING(s1); // IN
std::string parameter_s2 = CCM::CORBAPK_STRING_to_PK_STRING(s2); // INOUT
std::string parameter_s3; // OUT
// %(MParameterDefDeclareResult)s
std::string result;
try {
// %(MParameterDefConvertMethod)s
result = local_adapter->foo1( parameter_s1, parameter_s2, parameter_s3);
}
// %(MParameterDefConvertExceptions)s
catch(...) {
throw CORBA::SystemException();
}
// %(MParameterDefConvertResult)s
s2= CCM::PK_STRING_to_CORBAPK_STRING(parameter_s2);
s3= CCM::PK_STRING_to_CORBAPK_STRING(parameter_s3);
return CCM::PK_STRING_to_CORBAPK_STRING(result);
}
Person* consoleFacetAdapter::foo3(const Person& p1, Person& p2, Person_out p3)
{
DEBUGNL(" consoleFacetAdapter::foo3()");
// %(MParameterDefConvertParameter)s
CCM_Local::Person parameter_p1; // IN
parameter_p1.id = CCM::CORBAPK_LONG_to_PK_LONG(p1.id);
parameter_p1.name = CCM::CORBAPK_STRING_to_PK_STRING(p1.name);
CCM_Local::Person parameter_p2; // INOUT
parameter_p2.id = CCM::CORBAPK_LONG_to_PK_LONG(p2.id);
parameter_p2.name = CCM::CORBAPK_STRING_to_PK_STRING(p2.name);
CCM_Local::Person parameter_p3; // OUT
// %(MParameterDefDeclareResult)s
CCM_Local::Person result;
try {
// %(MParameterDefConvertMethod)s
result = local_adapter->foo3(parameter_p1, parameter_p2, parameter_p3);
}
// %(MParameterDefConvertExceptions)s
catch(...) {
throw CORBA::SystemException();
}
// %(MParameterDefConvertResult)s
p2.id = CCM::PK_LONG_to_CORBAPK_LONG(parameter_p2.id);
p2.name = CCM::PK_STRING_to_CORBAPK_STRING(parameter_p2.name);
p3 = new Person;
p3->id = CCM::PK_LONG_to_CORBAPK_LONG(parameter_p3.id);
p3->name = CCM::PK_STRING_to_CORBAPK_STRING(parameter_p3.name);
Person_var return_value = new Person;
return_value->id = CCM::PK_LONG_to_CORBAPK_LONG(result.id);
return_value->name = CCM::PK_STRING_to_CORBAPK_STRING(result.name);
return return_value._retn();
}
PersonMap* consoleFacetAdapter::foo4(const PersonMap& p1, PersonMap& p2, PersonMap_out p3)
{
DEBUGNL(" consoleFacetAdapter::foo4()");
// %(MParameterDefConvertParameter)s
CCM_Local::PersonMap parameter_p1; // IN
CCM_Local::Person parameter_p1_item;
for(unsigned long i=0; i< p1.length(); i++) {
parameter_p1_item.name = CCM::CORBAPK_STRING_to_PK_STRING(p1[i].name);
parameter_p1_item.id = CCM::CORBAPK_LONG_to_PK_LONG(p1[i].id);
parameter_p1.push_back(parameter_p1_item);
}
CCM_Local::PersonMap parameter_p2; // INOUT
CCM_Local::Person parameter_p2_item;
for(unsigned long i=0; i< p2.length(); i++) {
parameter_p2_item.name = CCM::CORBAPK_STRING_to_PK_STRING(p2[i].name);
parameter_p2_item.id = CCM::CORBAPK_LONG_to_PK_LONG(p2[i].id);
parameter_p2.push_back(parameter_p2_item);
}
CCM_Local::PersonMap parameter_p3; // OUT
// %(MParameterDefDeclareResult)s
CCM_Local::PersonMap result;
try {
// %(MParameterDefConvertMethod)s
result = local_adapter->foo4(parameter_p1, parameter_p2, parameter_p3);
}
// %(MParameterDefConvertExceptions)s
catch(...) {
throw CORBA::SystemException();
}
// %(MParameterDefConvertResult)s
p2.length(parameter_p2.size());
for(unsigned long i=0; i< parameter_p2.size() ;i++) {
p2[i].id = CCM::PK_LONG_to_CORBAPK_LONG(parameter_p2[i].id);
p2[i].name = CCM::PK_STRING_to_CORBAPK_STRING(parameter_p2[i].name);
}
p3 = new PersonMap;
p3->length(parameter_p3.size());
for(unsigned long i=0; i< parameter_p3.size() ;i++) {
(*p3)[i].id = CCM::PK_LONG_to_CORBAPK_LONG(parameter_p3[i].id);
(*p3)[i].name = CCM::PK_STRING_to_CORBAPK_STRING(parameter_p3[i].name);
}
PersonMap_var return_value = new PersonMap;
return_value->length(result.size());
for(unsigned long i=0; i< result.size() ;i++) {
(*return_value)[i].id = CCM::PK_LONG_to_CORBAPK_LONG(result[i].id);
(*return_value)[i].name = CCM::PK_STRING_to_CORBAPK_STRING(result[i].name);
}
return return_value._retn();
}
} // /namespace CCM_Session_Hello
} // /namespace CCM_Remote
|
|
From: <tei...@us...> - 2003-11-27 17:32:17
|
Update of /cvsroot/ccmtools/ccmtools/test/CppRemoteGenerator/supports
In directory sc8-pr-cvs1:/tmp/cvs-serv12261/supports
Added Files:
Hello.idl
Log Message:
I added some test cases for the remote generator. Note that these tests will be removed (and added in the test/CppGenerator) after the remote generator is able to run all user_type tests.
--- NEW FILE: Hello.idl ---
/**
* Test case: supports
*
*/
interface Console {
long println(in string s2);
// long foo(in long il, inout long iol, out long ol);
};
component Hello supports Console
{
};
home HelloHome manages Hello
{
};
|
|
From: <tei...@us...> - 2003-11-27 17:32:17
|
Update of /cvsroot/ccmtools/ccmtools/test/CppRemoteGenerator/supports_basic_types/CCM_Test
In directory sc8-pr-cvs1:/tmp/cvs-serv12261/supports_basic_types/CCM_Test
Added Files:
_check_CCM_Remote_CCM_Session_Hello_remote.cc
Log Message:
I added some test cases for the remote generator. Note that these tests will be removed (and added in the test/CppGenerator) after the remote generator is able to run all user_type tests.
--- NEW FILE: _check_CCM_Remote_CCM_Session_Hello_remote.cc ---
#include <cstdlib>
#include <iostream>
#include <string>
#include <CCM_Utils/Debug.h>
#include <CORBA.h>
#include <coss/CosNaming.h>
#include <CCM_Remote/CCM_Session_Hello/HelloHome_remote.h>
#include <Hello.h>
using namespace std;
using namespace CCM_Utils;
//==============================================================================
// Implementation of remote client test
//==============================================================================
int main (int argc, char *argv[])
{
Debug::set_global(true);
DEBUGNL("C++_remote_test_client()");
// Initialize ORB
int argc_=3;
char ns[200];
sprintf(ns,"NameService=%s",getenv("CCM_NAME_SERVICE"));
char* argv_[] = {"", "-ORBInitRef", ns };
DEBUGNL(ns);
CORBA::ORB_var orb = CORBA::ORB_init(argc_, argv_);
/**
* Server-side code
*/
CCM::register_all_factories (orb);
int error = deploy_HelloHome(orb, "HelloHome:1.0");
if(!error) {
cout << "HelloHome stand-alone server is running..." << endl;
}
else {
cerr << "ERROR: Can't start components!" << endl;
assert(0);
}
/**
* Client-side code
*/
CORBA::Object_var obj = orb->resolve_initial_references ("NameService");
CosNaming::NamingContextExt_var nc =
CosNaming::NamingContextExt::_narrow (obj);
assert (!CORBA::is_nil (nc));
// Deployment
// Find ComponentHomes in the Naming-Service
obj = nc->resolve_str ("HelloHome:1.0");
assert (!CORBA::is_nil (obj));
HelloHome_var myHelloHome = HelloHome::_narrow (obj);
// Create component instances
Hello_var myHello = myHelloHome->create();
// Provide facets
myHello->configuration_complete();
DEBUGNL("==== Begin Test Case =============================================" );
CORBA::Short short_2=3, short_3, short_r;
short_r = myHello->println1(7,short_2, short_3);
assert(short_2 == 7);
assert(short_3 == 3);
assert(short_r == 3+7);
CORBA::Long long_2=3, long_3, long_r;
long_r = myHello->println2(7,long_2, long_3);
assert(long_2 == 7);
assert(long_3 == 3);
assert(long_r == 3+7);
CORBA::UShort ushort_2=3, ushort_3, ushort_r;
ushort_r = myHello->println3(7,ushort_2, ushort_3);
assert(ushort_2 == 7);
assert(ushort_3 == 3);
assert(ushort_r == 3+7);
CORBA::ULong ulong_2=3, ulong_3, ulong_r;
ulong_r = myHello->println4(7,ulong_2, ulong_3);
assert(ulong_2 == 7);
assert(ulong_3 == 3);
assert(ulong_r == 3+7);
CORBA::Float float_2=3.0, float_3, float_r;
float_r = myHello->println5(7.0,float_2, float_3);
assert(float_2 == 7.0);
assert(float_3 == 3.0);
assert(float_r == 3.0+7.0);
CORBA::Double double_2=3.0, double_3, double_r;
double_r = myHello->println6(7.0,double_2, double_3);
assert(double_2 == 7.0);
assert(double_3 == 3.0);
assert(double_r == 3.0+7.0);
CORBA::Char char_2=3, char_3, char_r;
char_r = myHello->println7(7,char_2, char_3);
assert(char_2 == 7);
assert(char_3 == 3);
assert(char_r == 3+7);
char* string_2 = CORBA::string_dup("drei");
char* string_3;
char* string_r;
string_r = myHello->println8("sieben",string_2, string_3);
assert(strcmp(string_2,"sieben") == 0);
assert(strcmp(string_3,"drei") == 0);
assert(strcmp(string_r,"dreisieben") == 0);
CORBA::Boolean bool_2=false, bool_3, bool_r;
bool_r = myHello->println9(true, bool_2, bool_3);
assert(bool_2 == true);
assert(bool_3 == false);
assert(bool_r == false && true);
CORBA::Octet octet_2=3, octet_3, octet_r;
octet_r = myHello->println10(7,octet_2, octet_3);
assert(octet_2 == 7);
assert(octet_3 == 3);
assert(octet_r == 3+7);
DEBUGNL("==== End Test Case ===============================================" );
// Un-Deployment
// Destroy component instances
myHello->remove();
}
|
|
From: <tei...@us...> - 2003-11-27 17:32:17
|
Update of /cvsroot/ccmtools/ccmtools/test/CppRemoteGenerator/facet_module
In directory sc8-pr-cvs1:/tmp/cvs-serv12261/facet_module
Added Files:
Hello.idl
Log Message:
I added some test cases for the remote generator. Note that these tests will be removed (and added in the test/CppGenerator) after the remote generator is able to run all user_type tests.
--- NEW FILE: Hello.idl ---
/**
* Test case: facet user types with modules
*
*/
module world {
module europe {
module austria {
struct Person {
long id;
string name;
};
typedef sequence<long> LongList;
typedef sequence<string> StringList;
typedef sequence<Person> PersonMap;
interface Console {
LongList foo1(in LongList l1, inout LongList l2, out LongList l3);
StringList foo2(in StringList s1, inout StringList s2, out StringList s3);
Person foo3(in Person p1, inout Person p2, out Person p3);
PersonMap foo4(in PersonMap p1, inout PersonMap p2, out PersonMap p3);
};
component Hello
{
provides Console console;
};
home HelloHome manages Hello
{
};
};
};
};
|
|
From: <tei...@us...> - 2003-11-27 17:32:16
|
Update of /cvsroot/ccmtools/ccmtools/test/CppRemoteGenerator/facet/CCM_Test
In directory sc8-pr-cvs1:/tmp/cvs-serv12261/facet/CCM_Test
Added Files:
_check_CCM_Remote_CCM_Session_Hello_remote.cc
Log Message:
I added some test cases for the remote generator. Note that these tests will be removed (and added in the test/CppGenerator) after the remote generator is able to run all user_type tests.
--- NEW FILE: _check_CCM_Remote_CCM_Session_Hello_remote.cc ---
#include <cstdlib>
#include <iostream>
#include <string>
#include <CCM_Utils/Debug.h>
#include <CORBA.h>
#include <coss/CosNaming.h>
#include <CCM_Remote/CCM_Session_Hello/HelloHome_remote.h>
#include <Hello.h>
using namespace std;
using namespace CCM_Utils;
//==============================================================================
// Implementation of remote client test
//==============================================================================
int main (int argc, char *argv[])
{
Debug::set_global(true);
DEBUGNL("C++_remote_test_client()");
// Initialize ORB
int argc_=3;
char ns[200];
sprintf(ns,"NameService=%s",getenv("CCM_NAME_SERVICE"));
char* argv_[] = {"", "-ORBInitRef", ns };
DEBUGNL(ns);
CORBA::ORB_var orb = CORBA::ORB_init(argc_, argv_);
/**
* Server-side code
*/
CCM::register_all_factories (orb);
int error = deploy_HelloHome(orb, "HelloHome:1.0");
if(!error) {
cout << "HelloHome stand-alone server is running..." << endl;
}
else {
cerr << "ERROR: Can't start components!" << endl;
assert(0);
}
/**
* Client-side code
*/
CORBA::Object_var obj = orb->resolve_initial_references ("NameService");
CosNaming::NamingContextExt_var nc =
CosNaming::NamingContextExt::_narrow (obj);
assert (!CORBA::is_nil (nc));
// Deployment
// Find ComponentHomes in the Naming-Service
obj = nc->resolve_str ("HelloHome:1.0");
assert (!CORBA::is_nil (obj));
HelloHome_var myHelloHome = HelloHome::_narrow (obj);
// Create component instances
Hello_var myHello = myHelloHome->create();
// Provide facets
Console_var Consoleconsole = myHello->provide_console();
myHello->configuration_complete();
DEBUGNL("==== Begin Test Case =============================================" );
char* s = CORBA::string_dup("1234567890");
CORBA::Long size = Consoleconsole->println(s);
assert(strlen(s) == size);
DEBUGNL("==== End Test Case ===============================================" );
// Un-Deployment
// Destroy component instances
myHello->remove();
}
|
|
From: <tei...@us...> - 2003-11-27 17:32:16
|
Update of /cvsroot/ccmtools/ccmtools/test/CppRemoteGenerator/facet_basic_types
In directory sc8-pr-cvs1:/tmp/cvs-serv12261/facet_basic_types
Added Files:
Hello.idl
Log Message:
I added some test cases for the remote generator. Note that these tests will be removed (and added in the test/CppGenerator) after the remote generator is able to run all user_type tests.
--- NEW FILE: Hello.idl ---
/**
* Test case: facet basic types
*
*/
interface Console {
short println1(in short p1, inout short p2, out short p3);
long println2(in long p1, inout long p2, out long p3);
unsigned short println3(in unsigned short p1, inout unsigned short p2, out unsigned short p3);
unsigned long println4(in unsigned long p1, inout unsigned long p2, out unsigned long p3);
float println5(in float p1, inout float p2, out float p3);
double println6(in double p1, inout double p2, out double p3);
char println7(in char p1, inout char p2, out char p3);
string println8(in string p1, inout string p2, out string p3);
boolean println9(in boolean p1, inout boolean p2, out boolean p3);
octet println10(in octet p1, inout octet p2, out octet p3);
};
component Hello
{
provides Console console;
};
home HelloHome manages Hello
{
};
|
|
From: <tei...@us...> - 2003-11-27 17:32:16
|
Update of /cvsroot/ccmtools/ccmtools/test/CppRemoteGenerator/facet_exception/CCM_Test
In directory sc8-pr-cvs1:/tmp/cvs-serv12261/facet_exception/CCM_Test
Added Files:
_check_CCM_Remote_CCM_Session_Hello_remote.cc
Log Message:
I added some test cases for the remote generator. Note that these tests will be removed (and added in the test/CppGenerator) after the remote generator is able to run all user_type tests.
--- NEW FILE: _check_CCM_Remote_CCM_Session_Hello_remote.cc ---
#include <cstdlib>
#include <iostream>
#include <string>
#include <CCM_Utils/Debug.h>
#include <CORBA.h>
#include <coss/CosNaming.h>
#include <CCM_Remote/CCM_Session_Hello/HelloHome_remote.h>
#include <Hello.h>
using namespace std;
using namespace CCM_Utils;
//==============================================================================
// Implementation of remote client test
//==============================================================================
int main (int argc, char *argv[])
{
Debug::set_global(true);
DEBUGNL("C++_remote_test_client()");
// Initialize ORB
int argc_=3;
char ns[200];
sprintf(ns,"NameService=%s",getenv("CCM_NAME_SERVICE"));
char* argv_[] = {"", "-ORBInitRef", ns };
DEBUGNL(ns);
CORBA::ORB_var orb = CORBA::ORB_init(argc_, argv_);
/**
* Server-side code
*/
CCM::register_all_factories (orb);
int error = deploy_HelloHome(orb, "HelloHome:1.0");
if(!error) {
cout << "HelloHome stand-alone server is running..." << endl;
}
else {
cerr << "ERROR: Can't start components!" << endl;
assert(0);
}
/**
* Client-side code
*/
CORBA::Object_var obj = orb->resolve_initial_references ("NameService");
CosNaming::NamingContextExt_var nc =
CosNaming::NamingContextExt::_narrow (obj);
assert (!CORBA::is_nil (nc));
// Deployment
// Find ComponentHomes in the Naming-Service
obj = nc->resolve_str ("HelloHome:1.0");
assert (!CORBA::is_nil (obj));
HelloHome_var myHelloHome = HelloHome::_narrow (obj);
// Create component instances
Hello_var myHello = myHelloHome->create();
// Provide facets
//Console_var console = myHello->provide_console();
Console_var Consoleconsole = myHello->provide_console();
myHello->configuration_complete();
DEBUGNL("==== Begin Test Case =============================================" );
char* s = CORBA::string_dup("Salomon.Automation");
CORBA::Long len;
len = Consoleconsole->println(s);
assert(len == strlen(s));
try {
char* s = CORBA::string_dup("error");
Consoleconsole->println(s);
assert(0);
}
catch(const ::error& e) {
cout << "OK: error exception catched!" << endl;
}
catch(const CORBA::SystemException& e) {
cout << "CORBA::SystemException catched!" << endl;
assert(0);
}
try {
char* s = CORBA::string_dup("super_error");
Consoleconsole->println(s);
assert(0);
}
catch(const ::super_error& e) {
cout << "OK: super_error exception catched!" << endl;
}
catch(const CORBA::SystemException& e) {
cout << "CORBA::SystemException catched!" << endl;
assert(0);
}
try {
char* s = CORBA::string_dup("fatal_error");
Consoleconsole->println(s);
assert(0);
}
catch(const ::fatal_error& e) {
cout << "OK: fatal_error exception catched!" << endl;
}
catch(const CORBA::SystemException& e) {
cout << "CORBA::SystemException catched!" << endl;
assert(0);
}
DEBUGNL("==== End Test Case ===============================================" );
// Un-Deployment
// Destroy component instances
myHello->remove();
}
|
|
From: <tei...@us...> - 2003-11-27 17:32:16
|
Update of /cvsroot/ccmtools/ccmtools/test/CppRemoteGenerator/facet_user_types
In directory sc8-pr-cvs1:/tmp/cvs-serv12261/facet_user_types
Added Files:
Hello.idl adapter.cc
Log Message:
I added some test cases for the remote generator. Note that these tests will be removed (and added in the test/CppGenerator) after the remote generator is able to run all user_type tests.
--- NEW FILE: Hello.idl ---
/**
* Test case: facet user types
*
*/
struct Person {
long id;
string name;
};
typedef sequence<long> LongList;
typedef sequence<string> StringList;
typedef sequence<Person> PersonMap;
interface Console {
LongList foo1(in LongList l1, inout LongList l2, out LongList l3);
StringList foo2(in StringList s1, inout StringList s2, out StringList s3);
Person foo3(in Person p1, inout Person p2, out Person p3);
PersonMap foo4(in PersonMap p1, inout PersonMap p2, out PersonMap p3);
};
component Hello
{
provides Console console;
};
home HelloHome manages Hello
{
};
--- NEW FILE: adapter.cc ---
/**
* IDL: string foo1(in string s1, inout string s2, out string s3);
*
**/
char* consoleFacetAdapter::foo1(const char* s1, char*& s2, CORBA::String_out s3)
{
DEBUGNL(" consoleFacetAdapter::foo1()");
// %(MParameterDefConvertParameter)s
std::string parameter_s1 = CCM::CORBAPK_STRING_to_PK_STRING(s1); // IN
std::string parameter_s2 = CCM::CORBAPK_STRING_to_PK_STRING(s2); // INOUT
std::string parameter_s3; // OUT
// %(MParameterDefDeclareResult)s
std::string result;
try {
// %(MParameterDefConvertMethod)s
result = local_adapter->foo1( parameter_s1, parameter_s2, parameter_s3);
}
// %(MParameterDefConvertExceptions)s
catch(...) {
throw CORBA::SystemException();
}
// %(MParameterDefConvertResult)s
s2= CCM::PK_STRING_to_CORBAPK_STRING(parameter_s2);
s3= CCM::PK_STRING_to_CORBAPK_STRING(parameter_s3);
return CCM::PK_STRING_to_CORBAPK_STRING(result);
}
/**
* IDL: Person foo3(in Person p1, inout Person p2, out Person p3);
*
**/
Person* consoleFacetAdapter::foo3(const Person& p1, Person& p2, Person_out p3)
{
DEBUGNL(" consoleFacetAdapter::foo3()");
// %(MParameterDefConvertParameter)s
CCM_Local::Person parameter_p1; // IN
parameter_p1.id = CCM::CORBAPK_LONG_to_PK_LONG(p1.id);
parameter_p1.name = CCM::CORBAPK_STRING_to_PK_STRING(p1.name);
CCM_Local::Person parameter_p2; // INOUT
parameter_p2.id = CCM::CORBAPK_LONG_to_PK_LONG(p2.id);
parameter_p2.name = CCM::CORBAPK_STRING_to_PK_STRING(p2.name);
CCM_Local::Person parameter_p3; // OUT
// %(MParameterDefDeclareResult)s
CCM_Local::Person result;
try {
// %(MParameterDefConvertMethod)s
result = local_adapter->foo3(parameter_p1, parameter_p2, parameter_p3);
}
// %(MParameterDefConvertExceptions)s
catch(...) {
throw CORBA::SystemException();
}
// %(MParameterDefConvertParameterToCorba)s
p2.id = CCM::PK_LONG_to_CORBAPK_LONG(parameter_p2.id);
p2.name = CCM::PK_STRING_to_CORBAPK_STRING(parameter_p2.name);
p3 = new Person;
p3->id = CCM::PK_LONG_to_CORBAPK_LONG(parameter_p3.id);
p3->name = CCM::PK_STRING_to_CORBAPK_STRING(parameter_p3.name);
// %(MParameterDefConvertResult)s
Person_var return_value = new Person;
return_value->id = CCM::PK_LONG_to_CORBAPK_LONG(result.id);
return_value->name = CCM::PK_STRING_to_CORBAPK_STRING(result.name);
return return_value._retn();
}
/**
* IDL: longList foo2(in longList l1, inout longList l2, out longList l3);
*
**/
longList* consoleFacetAdapter::foo2(const longList& l1, longList& l2, longList_out l3)
{
DEBUGNL(" consoleFacetAdapter::foo2()");
// %(MParameterDefConvertParameter)s
CCM_Local::longList parameter_l1; // IN
for(unsigned long i=0; i< l1.length(); i++) {
parameter_l1.push_back(CCM::CORBAPK_LONG_to_PK_LONG(l1[i]));
}
CCM_Local::longList parameter_l2; // INOUT
for(unsigned long i=0; i< l2.length(); i++) {
parameter_l2.push_back(CCM::CORBAPK_LONG_to_PK_LONG(l2[i]));
}
CCM_Local::longList parameter_l3; // OUT
// %(MParameterDefDeclareResult)s
CCM_Local::longList result;
try {
// %(MParameterDefConvertMethod)s
result = local_adapter->foo2( parameter_l1, parameter_l2, parameter_l3);
}
// %(MParameterDefConvertExceptions)s
catch(...) {
throw CORBA::SystemException();
}
// %(MParameterDefConvertParameterToCorba)s
l2.length(parameter_l2.size()); // INOUT
for(unsigned long i=0; i<parameter_l2.size();i++) {
l2[i] = CCM::PK_LONG_to_CORBAPK_LONG(parameter_l2[i]);
}
l3 = new longList;
l3->length(parameter_l3.size()); // OUT
for(unsigned long i=0; i<parameter_l3.size();i++) {
(*l3)[i] = CCM::PK_LONG_to_CORBAPK_LONG(parameter_l3[i]);
}
// %(MParameterDefConvertResult)s
longList_var return_value = new longList;
return_value->length(result.size());
for(unsigned long i=0; i< result.size();i++) {
(*return_value)[i] = CCM::PK_LONG_to_CORBAPK_LONG(result[i]);
}
return return_value._retn();
}
PersonMap* consoleFacetAdapter::foo4(const PersonMap& p1, PersonMap& p2, PersonMap_out p3)
{
DEBUGNL(" consoleFacetAdapter::foo4()");
// %(MParameterDefConvertParameter)s
// IN
CCM_Local::PersonMap parameter_p1;
for(unsigned long i=0; i< p1.length(); i++) {
Person p1_corba_item = p1[i]; // remote struct
CCM_Local::Person p1_cpp_item; // local struct
p1_cpp_item.id = CCM::CORBAPK_LONG_to_PK_LONG(p1_corba_item.id);
p1_cpp_item.name = CCM::CORBAPK_STRING_to_PK_STRING(p1_corba_item.name);
parameter_p1.push_back(p1_cpp_item);
}
// INOUT
CCM_Local::PersonMap parameter_p2;
for(unsigned long i=0; i< p2.length(); i++) {
Person p2_corba_item = p2[i]; // remote struct
CCM_Local::Person p2_cpp_item; // local struct
p2_cpp_item.id = CCM::CORBAPK_LONG_to_PK_LONG(p2_corba_item.id);
p2_cpp_item.name = CCM::CORBAPK_STRING_to_PK_STRING(p2_corba_item.name);
parameter_p2.push_back(p2_cpp_item);
}
// OUT
CCM_Local::PersonMap parameter_p3;
// %(MParameterDefDeclareResult)s
CCM_Local::PersonMap result;
try {
// %(MParameterDefConvertMethod)s
result = local_adapter->foo4( parameter_p1, parameter_p2, parameter_p3);
}
// %(MParameterDefConvertExceptions)s
catch(...) {
throw CORBA::SystemException();
}
// %(MParameterDefConvertResult)s
// INOUT
p2.length(parameter_p2.size());
for(unsigned long i=0; i< parameter_p2.size(); i++) {
CCM_Local::Person cpp_item = parameter_p2[i]; // local struct
Person corba_item; // remote struct
corba_item.id = CCM::PK_LONG_to_CORBAPK_LONG(cpp_item.id);
corba_item.name = CCM::PK_STRING_to_CORBAPK_STRING(cpp_item.name);
p2[i] = corba_item;
}
// OUT
p3 = new PersonMap;
p3->length(parameter_p3.size());
for(unsigned long i=0; i< parameter_p3.size(); i++) {
CCM_Local::Person Cpp_item= parameter_p3[i];
Person_var corba_item = new Person;
corba_item->id = CCM::PK_LONG_to_CORBAPK_LONG(Cpp_item.id);
corba_item->name = CCM::PK_STRING_to_CORBAPK_STRING(Cpp_item.name);
(*p3)[i] = corba_item;
}
// %(MParameterDefConvertResult)s
PersonMap_var return_value = new PersonMap;
return_value->length(result.size());
for(unsigned long i=0; i< result.size(); i++) {
CCM_Local::Person cpp_item = result[i]; // local struct
Person corba_item; // remote struct
corba_item.id = CCM::PK_LONG_to_CORBAPK_LONG(cpp_item.id);
corba_item.name = CCM::PK_STRING_to_CORBAPK_STRING(cpp_item.name);
(*return_value)[i] = corba_item;
}
return return_value._retn();
}
|
|
From: <tei...@us...> - 2003-11-27 17:32:16
|
Update of /cvsroot/ccmtools/ccmtools/test/CppRemoteGenerator/facet_exception
In directory sc8-pr-cvs1:/tmp/cvs-serv12261/facet_exception
Added Files:
Hello.idl
Log Message:
I added some test cases for the remote generator. Note that these tests will be removed (and added in the test/CppGenerator) after the remote generator is able to run all user_type tests.
--- NEW FILE: Hello.idl ---
/**
* Test case: facet exception
*
*/
exception error{};
exception super_error{};
exception fatal_error{};
interface Console {
long println(in string s2)
raises (error, super_error, fatal_error);
};
component Hello
{
provides Console console;
};
home HelloHome manages Hello
{
};
|
|
From: <tei...@us...> - 2003-11-27 17:32:15
|
Update of /cvsroot/ccmtools/ccmtools/test/CppRemoteGenerator/facet_basic_types/CCM_Test
In directory sc8-pr-cvs1:/tmp/cvs-serv12261/facet_basic_types/CCM_Test
Added Files:
_check_CCM_Remote_CCM_Session_Hello_remote.cc
Log Message:
I added some test cases for the remote generator. Note that these tests will be removed (and added in the test/CppGenerator) after the remote generator is able to run all user_type tests.
--- NEW FILE: _check_CCM_Remote_CCM_Session_Hello_remote.cc ---
#include <cstdlib>
#include <iostream>
#include <string>
#include <CCM_Utils/Debug.h>
#include <CORBA.h>
#include <coss/CosNaming.h>
#include <CCM_Remote/CCM_Session_Hello/HelloHome_remote.h>
#include <Hello.h>
using namespace std;
using namespace CCM_Utils;
//==============================================================================
// Implementation of remote client test
//==============================================================================
int main (int argc, char *argv[])
{
Debug::set_global(true);
DEBUGNL("C++_remote_test_client()");
// Initialize ORB
int argc_=3;
char ns[200];
sprintf(ns,"NameService=%s",getenv("CCM_NAME_SERVICE"));
char* argv_[] = {"", "-ORBInitRef", ns };
DEBUGNL(ns);
CORBA::ORB_var orb = CORBA::ORB_init(argc_, argv_);
/**
* Server-side code
*/
CCM::register_all_factories (orb);
int error = deploy_HelloHome(orb, "HelloHome:1.0");
if(!error) {
cout << "HelloHome stand-alone server is running..." << endl;
}
else {
cerr << "ERROR: Can't start components!" << endl;
assert(0);
}
/**
* Client-side code
*/
CORBA::Object_var obj = orb->resolve_initial_references ("NameService");
CosNaming::NamingContextExt_var nc =
CosNaming::NamingContextExt::_narrow (obj);
assert (!CORBA::is_nil (nc));
// Deployment
// Find ComponentHomes in the Naming-Service
obj = nc->resolve_str ("HelloHome:1.0");
assert (!CORBA::is_nil (obj));
HelloHome_var myHelloHome = HelloHome::_narrow (obj);
// Create component instances
Hello_var myHello = myHelloHome->create();
// Provide facets
//Console_var console = myHello->provide_console();
Console_var Consoleconsole = myHello->provide_console();
myHello->configuration_complete();
DEBUGNL("==== Begin Test Case =============================================" );
CORBA::Short short_2=3, short_3, short_r;
short_r = Consoleconsole->println1(7,short_2, short_3);
assert(short_2 == 7);
assert(short_3 == 3);
assert(short_r == 3+7);
CORBA::Long long_2=3, long_3, long_r;
long_r = Consoleconsole->println2(7,long_2, long_3);
assert(long_2 == 7);
assert(long_3 == 3);
assert(long_r == 3+7);
CORBA::UShort ushort_2=3, ushort_3, ushort_r;
ushort_r = Consoleconsole->println3(7,ushort_2, ushort_3);
assert(ushort_2 == 7);
assert(ushort_3 == 3);
assert(ushort_r == 3+7);
CORBA::ULong ulong_2=3, ulong_3, ulong_r;
ulong_r = Consoleconsole->println4(7,ulong_2, ulong_3);
assert(ulong_2 == 7);
assert(ulong_3 == 3);
assert(ulong_r == 3+7);
CORBA::Float float_2=3.0, float_3, float_r;
float_r = Consoleconsole->println5(7.0,float_2, float_3);
assert(float_2 == 7.0);
assert(float_3 == 3.0);
assert(float_r == 3.0+7.0);
CORBA::Double double_2=3.0, double_3, double_r;
double_r = Consoleconsole->println6(7.0,double_2, double_3);
assert(double_2 == 7.0);
assert(double_3 == 3.0);
assert(double_r == 3.0+7.0);
CORBA::Char char_2=3, char_3, char_r;
char_r = Consoleconsole->println7(7,char_2, char_3);
assert(char_2 == 7);
assert(char_3 == 3);
assert(char_r == 3+7);
char* string_2 = CORBA::string_dup("drei");
char* string_3;
char* string_r;
string_r = Consoleconsole->println8("sieben",string_2, string_3);
assert(strcmp(string_2,"sieben") == 0);
assert(strcmp(string_3,"drei") == 0);
assert(strcmp(string_r,"dreisieben") == 0);
CORBA::Boolean bool_2=false, bool_3, bool_r;
bool_r = Consoleconsole->println9(true, bool_2, bool_3);
assert(bool_2 == true);
assert(bool_3 == false);
assert(bool_r == false && true);
CORBA::Octet octet_2=3, octet_3, octet_r;
octet_r = Consoleconsole->println10(7,octet_2, octet_3);
assert(octet_2 == 7);
assert(octet_3 == 3);
assert(octet_r == 3+7);
DEBUGNL("==== End Test Case ===============================================" );
// Un-Deployment
// Destroy component instances
myHello->remove();
}
|