summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/tests
diff options
context:
space:
mode:
authorfrehberger <frehberger@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2006-03-29 06:26:35 +0000
committerfrehberger <frehberger@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2006-03-29 06:26:35 +0000
commite040750d24cdcae53b7a5e1a27a9465bea4f5f36 (patch)
treedf940e25a0a4cb8300316ad185a91ffb0395b5ed /TAO/orbsvcs/tests
parent3e1e3fe3590185d1aba3d8e6d7803e5fba99e4fd (diff)
downloadATCD-e040750d24cdcae53b7a5e1a27a9465bea4f5f36.tar.gz
ChangeLogTag: Tue Mar 28 23:59:00 UTC 2006 Frank Rehberger <frehberger@prismtech.com>
Diffstat (limited to 'TAO/orbsvcs/tests')
-rw-r--r--TAO/orbsvcs/tests/FaultTolerance/GroupRef_Manipulation/Server_Request_Interceptor.cpp26
-rw-r--r--TAO/orbsvcs/tests/FaultTolerance/GroupRef_Manipulation/Server_Request_Interceptor.h5
-rw-r--r--TAO/orbsvcs/tests/FaultTolerance/GroupRef_Manipulation/client.cpp21
-rw-r--r--TAO/orbsvcs/tests/FaultTolerance/GroupRef_Manipulation/test.idl1
4 files changed, 51 insertions, 2 deletions
diff --git a/TAO/orbsvcs/tests/FaultTolerance/GroupRef_Manipulation/Server_Request_Interceptor.cpp b/TAO/orbsvcs/tests/FaultTolerance/GroupRef_Manipulation/Server_Request_Interceptor.cpp
index 00fffe1a363..1e7c6bee6aa 100644
--- a/TAO/orbsvcs/tests/FaultTolerance/GroupRef_Manipulation/Server_Request_Interceptor.cpp
+++ b/TAO/orbsvcs/tests/FaultTolerance/GroupRef_Manipulation/Server_Request_Interceptor.cpp
@@ -24,6 +24,14 @@ Server_Request_Interceptor::~Server_Request_Interceptor (void)
}
void
+Server_Request_Interceptor::reset (ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->request_count_ = 0;
+ this->forward_request_thrown_ = false;
+}
+
+void
Server_Request_Interceptor::forward_references (
CORBA::Object_ptr obj1,
CORBA::Object_ptr obj2
@@ -37,8 +45,22 @@ Server_Request_Interceptor::forward_references (
EINVAL),
CORBA::COMPLETED_NO));
- this->obj_[0] = CORBA::Object::_duplicate (obj1);
- this->obj_[1] = CORBA::Object::_duplicate (obj2);
+ char *argv[] = {NULL};
+ int argc = 0;
+
+ // Fetch the ORB having been initialized in main()
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv, "Server ORB" ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::String_var str1 = orb->object_to_string (obj1 ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::String_var str2 = orb->object_to_string (obj2 ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->obj_[0] = orb->string_to_object (str1 ACE_ENV_ARG_PARAMETER);
+ this->obj_[1] = orb->string_to_object (str2 ACE_ENV_ARG_PARAMETER);
}
char *
diff --git a/TAO/orbsvcs/tests/FaultTolerance/GroupRef_Manipulation/Server_Request_Interceptor.h b/TAO/orbsvcs/tests/FaultTolerance/GroupRef_Manipulation/Server_Request_Interceptor.h
index 554d85d203a..d8a5ce664cf 100644
--- a/TAO/orbsvcs/tests/FaultTolerance/GroupRef_Manipulation/Server_Request_Interceptor.h
+++ b/TAO/orbsvcs/tests/FaultTolerance/GroupRef_Manipulation/Server_Request_Interceptor.h
@@ -55,6 +55,11 @@ public:
ACE_ENV_ARG_DECL_WITH_DEFAULTS)
ACE_THROW_SPEC ((CORBA::SystemException));
+ /// Reset to initial state, like counter etc, keeps the object-references
+ virtual void reset (ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+
/**
* @name Methods Required by the Server Request Interceptor
* Interface
diff --git a/TAO/orbsvcs/tests/FaultTolerance/GroupRef_Manipulation/client.cpp b/TAO/orbsvcs/tests/FaultTolerance/GroupRef_Manipulation/client.cpp
index 82ac5cdec4b..34241c0e068 100644
--- a/TAO/orbsvcs/tests/FaultTolerance/GroupRef_Manipulation/client.cpp
+++ b/TAO/orbsvcs/tests/FaultTolerance/GroupRef_Manipulation/client.cpp
@@ -62,6 +62,13 @@ main (int argc, char *argv[])
ForwardRequestTest::test::_narrow (object.in () ACE_ENV_ARG_PARAMETER);
ACE_TRY_CHECK;
+ // Before and after the LOCATION_FORWARD_PERM the marshaled
+ // object reference must differ.
+
+ // Create a stringified/marshaled snapshot of Object reference
+ CORBA::String_var marshaled_obj_snapshot1 =
+ orb->object_to_string (server.in () ACE_ENV_ARG_PARAMETER);
+
if (CORBA::is_nil (server.in ()))
{
ACE_ERROR_RETURN ((LM_ERROR,
@@ -95,6 +102,20 @@ main (int argc, char *argv[])
ACE_OS::abort ();
}
+ // One of the request triggerd a LOCATION_FORWARD_PERM, in
+ // consequence the marshaled representation of "server" should
+ // look different now, compare to snapshot1.
+ CORBA::String_var marshaled_obj_snapshot2 =
+ orb->object_to_string (server.in () ACE_ENV_ARG_PARAMETER);
+
+ if (strcmp (marshaled_obj_snapshot1, marshaled_obj_snapshot2) == 0)
+ {
+ // Error, before and after the marhaled object references look equal
+ ACE_ERROR ((LM_ERROR,
+ "(%P|%t) ERROR: Marshaled Object reference should differ after LOCATION_FORWARD_PERM\n"));
+ ACE_OS::abort ();
+ }
+
server->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_TRY_CHECK;
}
diff --git a/TAO/orbsvcs/tests/FaultTolerance/GroupRef_Manipulation/test.idl b/TAO/orbsvcs/tests/FaultTolerance/GroupRef_Manipulation/test.idl
index beadf9759da..f154942bbb7 100644
--- a/TAO/orbsvcs/tests/FaultTolerance/GroupRef_Manipulation/test.idl
+++ b/TAO/orbsvcs/tests/FaultTolerance/GroupRef_Manipulation/test.idl
@@ -24,6 +24,7 @@ module ForwardRequestTest
void forward_references (in Object obj1,
in Object obj2);
+ void reset ();
};
};