summaryrefslogtreecommitdiff
path: root/tests/CIAO_ComponentServer/Basic
diff options
context:
space:
mode:
Diffstat (limited to 'tests/CIAO_ComponentServer/Basic')
-rw-r--r--tests/CIAO_ComponentServer/Basic/Basic.mpc6
-rw-r--r--tests/CIAO_ComponentServer/Basic/client.cpp143
-rwxr-xr-xtests/CIAO_ComponentServer/Basic/run_test.pl110
3 files changed, 0 insertions, 259 deletions
diff --git a/tests/CIAO_ComponentServer/Basic/Basic.mpc b/tests/CIAO_ComponentServer/Basic/Basic.mpc
deleted file mode 100644
index 1de96195bb9..00000000000
--- a/tests/CIAO_ComponentServer/Basic/Basic.mpc
+++ /dev/null
@@ -1,6 +0,0 @@
-// $Id$
-project (Basic_CIAOComponentServer_Test) : ciao_componentserver_stub {
- Source_Files {
- client.cpp
- }
-} \ No newline at end of file
diff --git a/tests/CIAO_ComponentServer/Basic/client.cpp b/tests/CIAO_ComponentServer/Basic/client.cpp
deleted file mode 100644
index 8d36037c8f2..00000000000
--- a/tests/CIAO_ComponentServer/Basic/client.cpp
+++ /dev/null
@@ -1,143 +0,0 @@
-// $Id$
-
-#include "ace/Get_Opt.h"
-#include "ciao/ComponentServer/CIAO_ComponentServerC.h"
-
-const ACE_TCHAR *server_1 = ACE_TEXT("file://test1.ior");
-const ACE_TCHAR *server_2 = ACE_TEXT("file://test2.ior");
-
-int
-parse_args (int argc, ACE_TCHAR *argv[])
-{
- ACE_Get_Opt get_opts (argc, argv, ACE_TEXT("k:j:"));
- int c;
-
- while ((c = get_opts ()) != -1)
- switch (c)
- {
- case 'k':
- server_1 = get_opts.opt_arg ();
- break;
-
- case 'j':
- server_2 = get_opts.opt_arg ();
- break;
-
- case '?':
- default:
- ACE_ERROR_RETURN ((LM_ERROR,
- "usage: %s "
- "-k <ior> "
- "-j <ior> "
- "\n",
- argv [0]),
- -1);
- }
- // Indicates sucessful parsing of the command line
- return 0;
-}
-
-int
-ACE_TMAIN (int argc, ACE_TCHAR **argv)
-{
- using namespace CIAO::Deployment;
-
- try
- {
- CORBA::ORB_var orb = CORBA::ORB_init (argc, argv);
-
- if (parse_args (argc, argv) != 0)
- return 1;
-
- CORBA::Object_var tmp1 = orb->string_to_object(server_1);
- CORBA::Object_var tmp2 = orb->string_to_object(server_2);
-
- ComponentServer_var server1 (ComponentServer::_narrow (tmp1)),
- server2 (ComponentServer::_narrow (tmp2));
-
- if (CORBA::is_nil (server1.in ()) ||
- CORBA::is_nil (server1.in ()))
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "Nil componentserver references"), -1);
- }
-
- Components::Deployment::Container_var tmp = server1->create_container (0);
- Container_var cont1a = Container::_narrow (tmp.in ());
- if (CORBA::is_nil (cont1a.in ()))
- {
- ACE_ERROR ((LM_ERROR, "Error: Got nil object reference from first create op on server 1 %u %u\n",
- tmp.in (), cont1a.in ()));
- return -1;
- }
- ACE_ERROR ((LM_DEBUG, "Got container from server 1a\n"));
-
- Container_var cont1b = Container::_narrow (server1->create_container (0));
- if (CORBA::is_nil (cont1b.in ()))
- {
- ACE_ERROR ((LM_ERROR, "Error: Got nil object reference from second create op on server 1\n"));
- return -1;
- }
- ACE_ERROR ((LM_DEBUG, "Got container from server 1b\n"));
-
- Container_var cont2a = Container::_narrow (server2->create_container (0));
- if (CORBA::is_nil (cont2a.in ()))
- {
- ACE_ERROR ((LM_ERROR, "Error: Got nil object reference from first create op on server 2\n"));
- return -1;
- }
- ACE_ERROR ((LM_DEBUG, "Got container from server 2a\n"));
-
- try
- {
- server2->remove_container (cont1a);
- ACE_ERROR ((LM_ERROR, "Error: remove_container removed a container not belonging to the component server\n"));
- }
- catch (const ::Components::RemoveFailure &)
- {
- ACE_DEBUG ((LM_DEBUG, "Server 2 Refused to remove container it didn't own\n"));
- // expected
- }
-
- ::Components::Deployment::Containers_var cses = server1->get_containers ();
-
- if (cses->length () != 2)
- ACE_ERROR ((LM_ERROR, "Error: get_containers returned the wrong number of containers, %u should be 2\n",
- cses->length ()));
- else ACE_DEBUG ((LM_DEBUG, "Got %u containers\n", cses->length ()));
-
- server1->remove_container (cont1a);
- ACE_DEBUG ((LM_DEBUG, "Successfully removed container 1a\n"));
-
- cses = server1->get_containers ();
-
- if (cses->length () != 1)
- ACE_ERROR ((LM_ERROR, "Error: get_containers returned %u containers after removal, should be 1\n",
- cses->length ()));
-
- server2->remove_container (cont2a);
- ACE_DEBUG ((LM_DEBUG, "Successfully removed container 2a\n"));
- server1->remove_container (cont1b);
- ACE_DEBUG ((LM_DEBUG, "Successfully removed container 1b\n"));
-
- server1->remove ();
- server1->shutdown ();
- server2->remove ();
- server2->shutdown ();
-
- orb->destroy ();
- }
- catch (const ::Components::CreateFailure &)
- {
- ACE_ERROR ((LM_ERROR, "Error: Caught CreateFailure exception.\n"));
- }
- catch (const ::Components::RemoveFailure &)
- {
- ACE_ERROR ((LM_ERROR, "Error: Caught RemoveFailure exception.\n"));
- }
- catch (...)
- {
- ACE_ERROR ((LM_ERROR, "Error: Caught unknown exception\n"));
- }
- return 0;
-}
diff --git a/tests/CIAO_ComponentServer/Basic/run_test.pl b/tests/CIAO_ComponentServer/Basic/run_test.pl
deleted file mode 100755
index ed2f80825a6..00000000000
--- a/tests/CIAO_ComponentServer/Basic/run_test.pl
+++ /dev/null
@@ -1,110 +0,0 @@
-eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
- & eval 'exec perl -S $0 $argv:q'
- if 0;
-
-# $Id$
-# -*- perl -*-
-
-use lib "$ENV{ACE_ROOT}/bin";
-use PerlACE::TestTarget;
-
-$status = 0;
-$debug_level = '0';
-$ciao_root = "$ENV{CIAO_ROOT}";
-
-foreach $i (@ARGV) {
- if ($i eq '-debug') {
- $debug_level = '10';
- }
-}
-
-my $target = PerlACE::TestTarget::create_target (1);
-my $host = new PerlACE::TestTarget;
-
-$iorbase1 = "server1.ior";
-$iorbase2 = "server2.ior";
-
-$server_iorfile1 = $target->LocalFile ($iorbase1);
-$server_iorfile2 = $target->LocalFile ($iorbase2);
-
-$target->DeleteFile($iorbase1);
-$target->DeleteFile($iorbase2);
-
-$client_iorfile1 = $host->LocalFile ($iorbase1);
-$client_iorfile2 = $host->LocalFile ($iorbase2);
-
-$host->DeleteFile($iorbase1);
-$host->DeleteFile($iorbase2);
-
-$SV1 = $target->CreateProcess ("$ciao_root/bin/ciao_componentserver", "-ORBDebuglevel $debug_level -u $server_iorfile1 -o $server_iorfile1");
-$SV2 = $target->CreateProcess ("$ciao_root/bin/ciao_componentserver", "-ORBDebuglevel $debug_level -u $server_iorfile2 -o $server_iorfile2");
-
-$CL = $host->CreateProcess ("client", "-k file://$client_iorfile1 -j file://$client_iorfile2");
-
-$server_status1 = $SV1->Spawn ();
-$server_status2 = $SV2->Spawn ();
-
-if ($server_status1 != 0) {
- print STDERR "ERROR: server1 returned $server_status1\n";
- exit 1;
-}
-if ($server_status2 != 0) {
- print STDERR "ERROR: server2 returned $server_status2\n";
- exit 1;
-}
-
-if ($target->WaitForFileTimed ($iorbase1,
- $target->ProcessStartWaitInterval ()) == -1) {
- print STDERR "ERROR: cannot find file <$server_iorfile1>\n";
- $SV1->Kill (); $SV1->TimedWait (1);
- exit 1;
-}
-
-if ($target->WaitForFileTimed ($iorbase2,
- $target->ProcessStartWaitInterval ()) == -1) {
- print STDERR "ERROR: cannot find file <$server_iorfile2>\n";
- $SV2->Kill (); $SV2->TimedWait (1);
- exit 1;
-}
-
-if ($target->GetFile ($server_iorfile1, $iorbase) == -1) {
- print STDERR "ERROR: cannot retrieve file <$iorbase1>\n";
- $SV1->Kill (); $SV1->TimedWait (1);
- exit 1;
-}
-
-if ($target->GetFile ($server_iorfile2, $iorbase) == -1) {
- print STDERR "ERROR: cannot retrieve file <$iorbase2>\n";
- $SV2->Kill (); $SV2->TimedWait (1);
- exit 1;
-}
-
-$client_status = $CL->SpawnWaitKill ($host->ProcessStartWaitInterval ());
-
-if ($client_status != 0) {
- print STDERR "ERROR: client returned $client_status\n";
- $status = 1;
-}
-
-$server_status1 = $SV1->WaitKill ($target->ProcessStopWaitInterval ());
-$server_status2 = $SV2->WaitKill ($target->ProcessStopWaitInterval ());
-
-if ($server_status1 != 0) {
- print STDERR "ERROR: server1 returned $server_status1\n";
- $status = 1;
-}
-
-if ($server_status2 != 0) {
- print STDERR "ERROR: server2 returned $server_status2\n";
- $status = 1;
-}
-
-$target->GetStderrLog();
-
-$target->DeleteFile($iorbase1);
-$target->DeleteFile($iorbase2);
-
-$host->DeleteFile($iorbase1);
-$host->DeleteFile($iorbase2);
-
-exit $status;