summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkirthika <kirthika@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2000-07-12 16:47:54 +0000
committerkirthika <kirthika@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2000-07-12 16:47:54 +0000
commite3385819fa76c370af0c84e6f0f1588626c08cc4 (patch)
treeae9830fa812852ab651879dfa16bdf23d12c8b15
parentbee1b593625232d1d2a71f7870db5733137e1328 (diff)
downloadATCD-e3385819fa76c370af0c84e6f0f1588626c08cc4.tar.gz
*** empty log message ***
-rw-r--r--TAO/tests/Portable_Interceptors/Dynamic/README4
-rw-r--r--TAO/tests/Portable_Interceptors/Dynamic/client.cpp12
-rw-r--r--TAO/tests/Portable_Interceptors/Dynamic/interceptors.cpp37
-rwxr-xr-xTAO/tests/Portable_Interceptors/Dynamic/run_test.pl2
-rw-r--r--TAO/tests/Portable_Interceptors/Dynamic/test_i.cpp9
-rw-r--r--TAO/tests/Portable_Interceptors/Dynamic/test_i.h7
-rw-r--r--TAO/tests/Portable_Interceptors/Service_Context_Manipulation/interceptors.cpp49
7 files changed, 60 insertions, 60 deletions
diff --git a/TAO/tests/Portable_Interceptors/Dynamic/README b/TAO/tests/Portable_Interceptors/Dynamic/README
index b991425377e..4abad34898c 100644
--- a/TAO/tests/Portable_Interceptors/Dynamic/README
+++ b/TAO/tests/Portable_Interceptors/Dynamic/README
@@ -1,7 +1,9 @@
# $Id$
This test allows you to visually check the correct invocation of
-TAO's pseudo-portable interceptors. To run the test, try:
+TAO's pseudo-portable interceptors, especially the Dynamic interface.
+
+ To run the test, try:
server -o test.ior
diff --git a/TAO/tests/Portable_Interceptors/Dynamic/client.cpp b/TAO/tests/Portable_Interceptors/Dynamic/client.cpp
index c89fd034a72..1338e42c22e 100644
--- a/TAO/tests/Portable_Interceptors/Dynamic/client.cpp
+++ b/TAO/tests/Portable_Interceptors/Dynamic/client.cpp
@@ -38,14 +38,16 @@ void
run_test (Test_Interceptors::Visual_ptr server,
CORBA::Environment &ACE_TRY_ENV)
{
-
server->normal (10, ACE_TRY_ENV);
ACE_CHECK;
- cout << "normal done"<<endl;
- server->nothing (ACE_TRY_ENV);
-
- cout<< "nothing done"<<endl;
+ CORBA::Long one = 1, two = 1, result = 0;
+ result = server->calculate (one,
+ two,
+ ACE_TRY_ENV);
+ ACE_DEBUG ((LM_DEBUG,
+ "result=%d\n",
+ result));
ACE_CHECK;
ACE_TRY
diff --git a/TAO/tests/Portable_Interceptors/Dynamic/interceptors.cpp b/TAO/tests/Portable_Interceptors/Dynamic/interceptors.cpp
index 5b73cf58340..e274ccbb720 100644
--- a/TAO/tests/Portable_Interceptors/Dynamic/interceptors.cpp
+++ b/TAO/tests/Portable_Interceptors/Dynamic/interceptors.cpp
@@ -84,6 +84,21 @@ Echo_Client_Request_Interceptor::receive_reply (PortableInterceptor::ClientReque
"the arg is %d\n",
param));
}
+ if (ACE_OS::strcmp (ri->operation (), "calculate") == 0)
+ {
+ Dynamic::ParameterList paramlist = *(ri->arguments ());
+ CORBA::Long param1, param2, result;
+ (paramlist)[0].argument >>= param1;
+ (paramlist)[1].argument >>= param2;
+ CORBA_Any result_any = *(ri->result ());
+ result_any >>= result;
+
+ ACE_DEBUG ((LM_DEBUG,
+ "the result of calculate is %d of %d + %d\n",
+ result,
+ param1,
+ param2));
+ }
}
@@ -150,7 +165,7 @@ Echo_Server_Request_Interceptor::name (CORBA::Environment &)
void
Echo_Server_Request_Interceptor::receive_request (PortableInterceptor::ServerRequestInfo_ptr ri,
- CORBA::Environment &ACE_TRY_ENV)
+ CORBA::Environment &)
ACE_THROW_SPEC ((CORBA::SystemException,
PortableInterceptor::ForwardRequest))
{
@@ -169,12 +184,13 @@ Echo_Server_Request_Interceptor::receive_request (PortableInterceptor::ServerReq
param));
}
+
}
void
Echo_Server_Request_Interceptor::send_reply (PortableInterceptor::ServerRequestInfo_ptr ri,
- CORBA::Environment &ACE_TRY_ENV)
+ CORBA::Environment &)
ACE_THROW_SPEC ((CORBA::SystemException,
PortableInterceptor::ForwardRequest))
{
@@ -191,6 +207,23 @@ Echo_Server_Request_Interceptor::send_reply (PortableInterceptor::ServerRequestI
"the arg is %d\n",
param));
}
+
+ if (ACE_OS::strcmp (ri->operation (), "calculate") == 0)
+ {
+ Dynamic::ParameterList paramlist = *(ri->arguments ());
+ CORBA::Long param1, param2, result;
+ (paramlist)[0].argument >>= param1;
+ (paramlist)[1].argument >>= param2;
+
+ CORBA_Any result_any = *(ri->result ());
+ result_any >>= result;
+
+ ACE_DEBUG ((LM_DEBUG,
+ "the result of calculate is %d of %d + %d\n",
+ result,
+ param1,
+ param2));
+ }
}
void
diff --git a/TAO/tests/Portable_Interceptors/Dynamic/run_test.pl b/TAO/tests/Portable_Interceptors/Dynamic/run_test.pl
index 5cf0a8ce597..05c7d10c096 100755
--- a/TAO/tests/Portable_Interceptors/Dynamic/run_test.pl
+++ b/TAO/tests/Portable_Interceptors/Dynamic/run_test.pl
@@ -13,7 +13,7 @@ use Cwd;
$cwd = getcwd();
ACE::checkForTarget($cwd);
-print STDERR "\n\n==== Running interceptor test\n";
+print STDERR "\n\n==== Running interceptor Dynamic test\n";
$file = "$cwd$DIR_SEPARATOR" . "test.ior";
diff --git a/TAO/tests/Portable_Interceptors/Dynamic/test_i.cpp b/TAO/tests/Portable_Interceptors/Dynamic/test_i.cpp
index 7de086d3a4b..80741e36a05 100644
--- a/TAO/tests/Portable_Interceptors/Dynamic/test_i.cpp
+++ b/TAO/tests/Portable_Interceptors/Dynamic/test_i.cpp
@@ -18,11 +18,14 @@ Visual_i::normal (CORBA::Long arg,
ACE_DEBUG ((LM_DEBUG, "Visual::normal called with %d\n", arg));
}
-void
-Visual_i::nothing (CORBA::Environment&)
+CORBA::Long
+Visual_i::calculate (CORBA::Long one,
+ CORBA::Long two,
+ CORBA::Environment&)
ACE_THROW_SPEC ((CORBA::SystemException))
{
- ACE_DEBUG ((LM_DEBUG, "Visual::nothing\n"));
+ ACE_DEBUG ((LM_DEBUG, "Visual::calculate\n"));
+ return (one + two);
}
void
diff --git a/TAO/tests/Portable_Interceptors/Dynamic/test_i.h b/TAO/tests/Portable_Interceptors/Dynamic/test_i.h
index eab5e203fa5..2069c011727 100644
--- a/TAO/tests/Portable_Interceptors/Dynamic/test_i.h
+++ b/TAO/tests/Portable_Interceptors/Dynamic/test_i.h
@@ -18,8 +18,6 @@
#include "testS.h"
-
-
class Visual_i : public POA_Test_Interceptors::Visual
{
// = DESCRIPTION
@@ -33,7 +31,10 @@ public:
CORBA::Environment&)
ACE_THROW_SPEC ((CORBA::SystemException));
- void nothing (CORBA::Environment&)
+ CORBA::Long calculate (
+ CORBA::Long one,
+ CORBA::Long two,
+ CORBA::Environment&)
ACE_THROW_SPEC ((CORBA::SystemException));
void user (CORBA::Environment&)
diff --git a/TAO/tests/Portable_Interceptors/Service_Context_Manipulation/interceptors.cpp b/TAO/tests/Portable_Interceptors/Service_Context_Manipulation/interceptors.cpp
index ae7013d745e..e0171f27926 100644
--- a/TAO/tests/Portable_Interceptors/Service_Context_Manipulation/interceptors.cpp
+++ b/TAO/tests/Portable_Interceptors/Service_Context_Manipulation/interceptors.cpp
@@ -43,7 +43,7 @@ Echo_Client_Request_Interceptor::name (CORBA::Environment &)
void
Echo_Client_Request_Interceptor::send_request (PortableInterceptor::ClientRequestInfo_ptr ri,
- CORBA::Environment &ACE_TRY_ENV)
+ CORBA::Environment &)
ACE_THROW_SPEC ((CORBA::SystemException,
PortableInterceptor::ForwardRequest))
{
@@ -69,15 +69,6 @@ Echo_Client_Request_Interceptor::send_request (PortableInterceptor::ClientReques
// Add this context to the service context list.
ri->add_request_service_context (sc, 0);
-
- if (ACE_OS::strcmp (ri->operation (), "normal") == 0)
- {
- /* Dynamic::ParameterList_var paramlist = ri->arguments ();
- CORBA::Long param;
- (*paramlist)[0].argument >>= param;
-
- cout << "the arg is " << param <<endl;*/
- }
}
void
@@ -91,7 +82,7 @@ Echo_Client_Request_Interceptor::receive_reply (PortableInterceptor::ClientReque
this->orb_->object_to_string (ri->target ())));
// ACE_CHECK;
- // ServiceID? is hacked and set to 1 for now
+
IOP::ServiceId id = reply_ctx_id;
IOP::ServiceContext * sc = ri->get_reply_service_context (id);
@@ -102,15 +93,6 @@ Echo_Client_Request_Interceptor::receive_reply (PortableInterceptor::ClientReque
ACE_DEBUG ((LM_DEBUG,
" Received reply service context: %s\n",
buf));
- if (ACE_OS::strcmp (ri->operation (), "normal") == 0)
- {
- /*Dynamic::ParameterList_var paramlist = ri->arguments ();
- CORBA::Long param;
- (*paramlist)[0].argument >>= param;
-
- cout << "the arg is " << param <<endl;
- */ }
-
}
void
@@ -124,7 +106,7 @@ Echo_Client_Request_Interceptor::receive_exception (PortableInterceptor::ClientR
"Echo_Client_Request_Interceptor::received_exception from \"%s\" on object: %s\n",
ri->operation (ACE_TRY_ENV),
this->orb_->object_to_string (ri->target ())));
- // ACE_CHECK;
+ ACE_CHECK;
}
@@ -170,8 +152,6 @@ Echo_Server_Request_Interceptor::receive_request (PortableInterceptor::ServerReq
"Echo_Server_Request_Interceptor::receive_request from \"%s\"",
ri->operation ()));
-
- // ServiceID? is hacked and set to 1 for now
IOP::ServiceId id = request_ctx_id;
IOP::ServiceContext *sc = ri->get_request_service_context (id);
@@ -183,7 +163,7 @@ Echo_Server_Request_Interceptor::receive_request (PortableInterceptor::ServerReq
" Received service context: %s\n",
buf));
- // MAke the context to send the context to the client
+ // Make the context to send the context to the client
IOP::ServiceContext scc;
scc.context_id = reply_ctx_id;
@@ -199,16 +179,6 @@ Echo_Server_Request_Interceptor::receive_request (PortableInterceptor::ServerReq
// Add this context to the service context list.
ri->add_reply_service_context (scc, 0);
-
-
- if (ACE_OS::strcmp (ri->operation (), "normal") == 0)
- {/*
- Dynamic::ParameterList_var paramlist = ri->arguments ();
- CORBA::Long param;
- (*paramlist)[0].argument >>= param;
-
- cout << "the arg is " << param <<endl;
- */ }
}
@@ -222,7 +192,6 @@ Echo_Server_Request_Interceptor::send_reply (PortableInterceptor::ServerRequestI
"Echo_Server_Request_Interceptor::send_reply from \"%s\"",
ri->operation ()));
- // ServiceID? is hacked and set to 1 for now
IOP::ServiceId id = reply_ctx_id;
IOP::ServiceContext *sc = ri->get_reply_service_context (id);
@@ -234,16 +203,6 @@ Echo_Server_Request_Interceptor::send_reply (PortableInterceptor::ServerRequestI
ACE_DEBUG ((LM_DEBUG,
" Replying service context: %s\n",
buf));
-
-
- if (ACE_OS::strcmp (ri->operation (), "normal") == 0)
- {
- /* Dynamic::ParameterList_var paramlist = ri->arguments ();
- CORBA::Long param;
- (*paramlist)[0].argument >>= param;
-
- cout << "the arg is " << param <<endl;
- */ }
}
void