summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorirfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-01-19 17:20:14 +0000
committerirfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-01-19 17:20:14 +0000
commit4057220a05c0c2b5d62458144a3801628edcc9f7 (patch)
treede2d02298be78cade0ab866cbabb2ea96c7e77a3
parent6675fbb0b36f86f7b852971cb18dba8c77dbe06d (diff)
downloadATCD-4057220a05c0c2b5d62458144a3801628edcc9f7.tar.gz
*** empty log message ***
-rw-r--r--TAO/tests/POA/NewPOA/NewPOA.cpp79
-rw-r--r--TAO/tests/POA/NewPOA/NewPOA.dsp89
-rw-r--r--TAO/tests/POA/NewPOA/NewPOA.dsw29
3 files changed, 197 insertions, 0 deletions
diff --git a/TAO/tests/POA/NewPOA/NewPOA.cpp b/TAO/tests/POA/NewPOA/NewPOA.cpp
new file mode 100644
index 00000000000..7d5a265113d
--- /dev/null
+++ b/TAO/tests/POA/NewPOA/NewPOA.cpp
@@ -0,0 +1,79 @@
+#include "ace/streams.h"
+#include "tao/corba.h"
+
+int
+main (int argc, char **argv)
+{
+ CORBA::Environment env;
+
+ CORBA::ORB_ptr orb = CORBA::ORB_init (argc, argv, 0, env);
+ if (env.exception () != 0)
+ {
+ env.print_exception ("CORBA::ORB_init");
+ return -1;
+ }
+
+ CORBA::Object_var obj = orb->resolve_initial_references ("RootPOA");
+
+ PortableServer::POA_var rootPOA = PortableServer::POA::_narrow (obj, env);
+ if (env.exception () != 0)
+ {
+ env.print_exception ("PortableServer::POA::_narrow");
+ return -1;
+ }
+
+ // CORBA::PolicyList policies (2);
+ PortableServer::PolicyList policies (2);
+
+ policies[0] = rootPOA->create_thread_policy (PortableServer::ORB_CTRL_MODEL, env);
+ policies[1] = rootPOA->create_lifespan_policy (PortableServer::TRANSIENT, env);
+ policies.length (2);
+
+ PortableServer::POA_ptr childPOA = rootPOA->create_POA ("my_little_poa",
+ PortableServer::POAManager::_nil(),
+ policies,
+ env);
+ if (env.exception () != 0)
+ {
+ env.print_exception ("PortableServer::POA::create_POA");
+ return -1;
+ }
+
+ for (int i = 0; i < policies.length () && env.exception == 0; i++)
+ {
+ // const CORBA::Policy_ptr policy = policies[i];
+ const PortableServer::Policy_ptr policy = policies[i];
+ policy->destroy (env);
+ }
+ if (env.exception () != 0)
+ {
+ env.print_exception ("PortableServer::POA::create_POA");
+ return -1;
+ }
+
+ CORBA::String_var rootPOA_name = rootPOA->the_name (env);
+ if (env.exception () != 0)
+ {
+ env.print_exception ("PortableServer::POA::_narrow");
+ return -1;
+ }
+
+ CORBA::String_var childPOA_name = childPOA->the_name (env);
+ if (env.exception () != 0)
+ {
+ env.print_exception ("PortableServer::POA::_narrow");
+ return -1;
+ }
+
+ char *name = 0;
+
+ name = rootPOA_name;
+ cout << name << endl;
+
+ name = childPOA_name;
+ cout << name << endl;
+
+ CORBA::release (orb);
+
+ return 0;
+}
diff --git a/TAO/tests/POA/NewPOA/NewPOA.dsp b/TAO/tests/POA/NewPOA/NewPOA.dsp
new file mode 100644
index 00000000000..a1f92d6ab31
--- /dev/null
+++ b/TAO/tests/POA/NewPOA/NewPOA.dsp
@@ -0,0 +1,89 @@
+# Microsoft Developer Studio Project File - Name="NewPOA" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 5.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=NewPOA - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "NewPOA.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "NewPOA.mak" CFG="NewPOA - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "NewPOA - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "NewPOA - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "NewPOA - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+
+!ELSEIF "$(CFG)" == "NewPOA - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\..\.." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 tao.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\tao\\"
+# SUBTRACT LINK32 /pdb:none
+
+!ENDIF
+
+# Begin Target
+
+# Name "NewPOA - Win32 Release"
+# Name "NewPOA - Win32 Debug"
+# Begin Source File
+
+SOURCE=.\NewPOA.cpp
+# End Source File
+# End Target
+# End Project
diff --git a/TAO/tests/POA/NewPOA/NewPOA.dsw b/TAO/tests/POA/NewPOA/NewPOA.dsw
new file mode 100644
index 00000000000..e7ce2ae3196
--- /dev/null
+++ b/TAO/tests/POA/NewPOA/NewPOA.dsw
@@ -0,0 +1,29 @@
+Microsoft Developer Studio Workspace File, Format Version 5.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "NewPOA"=.\NewPOA.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+