summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormk1 <mk1@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-04-24 17:11:19 +0000
committermk1 <mk1@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-04-24 17:11:19 +0000
commitd6a32e25835084295bc641377ce934dc04c7ffd9 (patch)
tree65fb258e93a1d1dbbc1b60d684847b0fe82a8df3
parent0795a8a6e10bac7a48e6e57886a1fc030a41fcdf (diff)
downloadATCD-d6a32e25835084295bc641377ce934dc04c7ffd9.tar.gz
finally running, yeah!
-rw-r--r--TAO/tests/Quoter/Factory_Finder.cpp2
-rw-r--r--TAO/tests/Quoter/Factory_Finder_Impl.cpp15
-rw-r--r--TAO/tests/Quoter/Generic_Factory.dsp106
-rw-r--r--TAO/tests/Quoter/Quoter_Impl.cpp7
-rw-r--r--TAO/tests/Quoter/client.cpp47
-rwxr-xr-xTAO/tests/Quoter/client.exebin1168 -> 1888 bytes
-rw-r--r--TAO/tests/Quoter/client.h3
-rw-r--r--TAO/tests/Quoter/run_test.btm31
-rw-r--r--TAO/tests/Quoter/server.cpp4
-rwxr-xr-xTAO/tests/Quoter/server.exebin431 -> 431 bytes
10 files changed, 177 insertions, 38 deletions
diff --git a/TAO/tests/Quoter/Factory_Finder.cpp b/TAO/tests/Quoter/Factory_Finder.cpp
index 11fb3b70bf9..113368791b8 100644
--- a/TAO/tests/Quoter/Factory_Finder.cpp
+++ b/TAO/tests/Quoter/Factory_Finder.cpp
@@ -160,7 +160,7 @@ Quoter_Factory_Finder_Server::run (CORBA::Environment& env)
// Function get_options.
-u_
+u_int
Quoter_Factory_Finder_Server::parse_args (void)
{
// We need the 'O' in get_opt () because we also want to have ORB
diff --git a/TAO/tests/Quoter/Factory_Finder_Impl.cpp b/TAO/tests/Quoter/Factory_Finder_Impl.cpp
index 2954bbfd366..1987ccb2bfb 100644
--- a/TAO/tests/Quoter/Factory_Finder_Impl.cpp
+++ b/TAO/tests/Quoter/Factory_Finder_Impl.cpp
@@ -38,12 +38,6 @@ Quoter_Factory_Finder_Impl::find_factories (const CosLifeCycle::Key &factory_key
{
CORBA::Environment env_here;
- // fill in the name of the Quoter Factory
- CosNaming::Name factoryName (1); // max = 1
- factoryName.length (1);
- factoryName[0].id = CORBA::string_dup ("quoter_factory");
- // or
-
// Get a reference to the ORB.
CORBA::ORB_ptr orb_ptr = TAO_ORB_Core_instance ()->orb ();
@@ -98,8 +92,15 @@ Quoter_Factory_Finder_Impl::find_factories (const CosLifeCycle::Key &factory_key
// ** now a proper reference to the quoter naming context is available
+ // fill in the name of the Quoter Factory
+ //CosNaming::Name factoryName (1); // max = 1
+ //factoryName.length (1);
+ //factoryName[0].id = CORBA::string_dup ("Quoter_Generic_Factory");
+ // for direct contact with the Quoter Factory
+ // factoryName[0].id = CORBA::string_dup ("Quoter_Factory");
+ // or
// Take the key supplied to search for a Quoter Factory
- //CosNaming::Name factoryName = (CosNaming::Name) factory_key;
+ CosNaming::Name factoryName = (CosNaming::Name) factory_key;
// Try to get a reference to a Quoter Factory
CORBA::Object_var quoterFactoryObject_var =
diff --git a/TAO/tests/Quoter/Generic_Factory.dsp b/TAO/tests/Quoter/Generic_Factory.dsp
index 1e2619e1173..ee7f81afecc 100644
--- a/TAO/tests/Quoter/Generic_Factory.dsp
+++ b/TAO/tests/Quoter/Generic_Factory.dsp
@@ -8,12 +8,12 @@ CFG=QuoterGenericFactory - 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 "QuoterGenericFactory.mak".
+!MESSAGE NMAKE /f "Generic_Factory.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 "QuoterGenericFactory.mak"\
+!MESSAGE NMAKE /f "Generic_Factory.mak"\
CFG="QuoterGenericFactory - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
@@ -62,11 +62,12 @@ LINK32=link.exe
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "QuoterGe"
-# PROP Intermediate_Dir "QuoterGe"
+# PROP Output_Dir ""
+# 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 /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /W3 /Gm /GX /Zi /Od /I "..\..\..\\" /I "..\..\\" /I "..\..\orbsvcs" /I "..\..\orbsvcs\orbsvcs" /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
@@ -74,7 +75,7 @@ BSC32=bscmake.exe
# 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 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 aced.lib tao.lib orbsvcs.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\ace" /libpath:"..\..\tao" /libpath:"..\..\orbsvcs\orbsvcs"
!ENDIF
@@ -82,5 +83,98 @@ LINK32=link.exe
# Name "QuoterGenericFactory - Win32 Release"
# Name "QuoterGenericFactory - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\Generic_Factory.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\Generic_Factory_Impl.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\QuoterC.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\QuoterS.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\Generic_Factory.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\Generic_Factory_Impl.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\QuoterC.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\QuoterS.h
+# End Source File
+# End Group
+# Begin Group "Inline Files"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\QuoterC.i
+# End Source File
+# Begin Source File
+
+SOURCE=.\QuoterS.i
+# End Source File
+# End Group
+# Begin Group "IDL Files"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\Quoter.idl
+
+!IF "$(CFG)" == "QuoterGenericFactory - Win32 Release"
+
+!ELSEIF "$(CFG)" == "QuoterGenericFactory - Win32 Debug"
+
+# Begin Custom Build - Invoking TAO_IDL compiler
+InputPath=.\Quoter.idl
+InputName=Quoter
+
+BuildCmds= \
+ ..\..\tao_idl\tao_idl $(InputName).idl
+
+"$(InputName)C.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"$(InputName)C.i" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"$(InputName)C.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"$(InputName)S.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"$(InputName)S.i" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"$(InputName)S.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+# End Custom Build
+
+!ENDIF
+
+# End Source File
+# End Group
# End Target
# End Project
diff --git a/TAO/tests/Quoter/Quoter_Impl.cpp b/TAO/tests/Quoter/Quoter_Impl.cpp
index d8d29fafd83..061b7f4c45e 100644
--- a/TAO/tests/Quoter/Quoter_Impl.cpp
+++ b/TAO/tests/Quoter/Quoter_Impl.cpp
@@ -83,7 +83,7 @@ Quoter_Impl::copy (CosLifeCycle::FactoryFinder_ptr there,
// The name of the Quoter Factory
CosLifeCycle::Key factoryKey (1); // max = 1
factoryKey.length(1);
- factoryKey[0].id = CORBA::string_dup ("quoter_factory");
+ factoryKey[0].id = CORBA::string_dup ("Quoter_Factory");
// Find an appropriate factory over there.
CosLifeCycle::Factories_ptr factories_ptr =
@@ -111,6 +111,11 @@ Quoter_Impl::copy (CosLifeCycle::FactoryFinder_ptr there,
TAO_TRY_ENV);
TAO_CHECK_ENV;
+ if (CORBA::is_nil (quoter_Factory_var.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Quoter::copy: Factory did not create the Quoter properly.\n"),
+ 0);
+
// Try to get a Quoter created by this factory.
// and duplicate the pointer to it
quoter_var = Stock::Quoter::_duplicate (
diff --git a/TAO/tests/Quoter/client.cpp b/TAO/tests/Quoter/client.cpp
index 4f123806793..a9eaa288ff0 100644
--- a/TAO/tests/Quoter/client.cpp
+++ b/TAO/tests/Quoter/client.cpp
@@ -189,13 +189,14 @@ Quoter_Client::init_naming_service (void)
ACE_DEBUG ((LM_DEBUG, "Have a proper reference to the Naming Service.\n"));
+ // deprecated
// ------------------------------------------- direct use of the Quoter Factory
/*
// Try to get the quoter_factory
CosNaming::Name quoter_factory_name (2);
quoter_factory_name.length (2);
quoter_factory_name[0].id = CORBA::string_dup ("IDL_Quoter");
- quoter_factory_name[1].id = CORBA::string_dup ("quoter_factory");
+ quoter_factory_name[1].id = CORBA::string_dup ("Quoter_Factory");
ACE_DEBUG ((LM_DEBUG, "Trying to resolve the Quoter Factory!\n"));
@@ -247,7 +248,7 @@ Quoter_Client::init_naming_service (void)
CosLifeCycle::Key factoryName (1); // max = 1
factoryName.length(1);
factoryName[0].id =
- CORBA::string_dup ("quoter_factory");
+ CORBA::string_dup ("Quoter_Generic_Factory");
// Find an appropriate factory over there.
CosLifeCycle::Factories_ptr factories_ptr =
@@ -255,7 +256,7 @@ Quoter_Client::init_naming_service (void)
if (factories_ptr == 0)
ACE_ERROR_RETURN ((LM_ERROR,
- "Did not get a Quoter Factory.\n"),
+ "Did not get a Generic Quoter Factory.\n"),
-1);
// Get the first object reference to a factory.
@@ -273,13 +274,15 @@ Quoter_Client::init_naming_service (void)
-1);
}
- // Narrow it to a Quoter Factory.
- factory_var_ = Stock::Quoter_Factory::_narrow (quoter_FactoryObj_var.in (),
- TAO_TRY_ENV);
+ // Narrow it
+ // to a direct Quoter Factory
+ // factory_var_ = Stock::Quoter_Factory::_narrow (quoter_FactoryObj_var.in (), TAO_TRY_ENV);
+ // to a Quoter Generic Factory
+ generic_Factory_var_ = Stock::Quoter_Generic_Factory::_narrow (quoter_FactoryObj_var.in (), TAO_TRY_ENV);
TAO_CHECK_ENV;
- if (CORBA::is_nil (this->factory_var_.in ()))
+ if (CORBA::is_nil (this->generic_Factory_var_.in ()))
ACE_ERROR_RETURN ((LM_ERROR,
"Factory received is not valid.\n"),
-1);
@@ -319,18 +322,19 @@ Quoter_Client::init (int argc, char **argv)
if (this->parse_args () == -1)
return -1;
- if (this->use_naming_service_)
- {
+ // deprecated
+ //if (this->use_naming_service_)
+ //{
int naming_result = this->init_naming_service ();
if (naming_result == -1)
return naming_result;
- }
+ /*}
else
- {
+ {
if (this->quoter_factory_key_ == 0)
ACE_ERROR_RETURN ((LM_ERROR,
"%s: no quoter factory key specified\n",
- this->argv_[0]),
+ this->argv_[0]),
-1);
CORBA::Object_var factory_object =
@@ -348,14 +352,25 @@ Quoter_Client::init (int argc, char **argv)
this->quoter_factory_key_),
-1);
}
- }
+ }*/
ACE_DEBUG ((LM_DEBUG, "Factory received OK\n"));
// Now retrieve the Quoter obj ref corresponding to the key.
- this->quoter_ =
- this->factory_var_->create_quoter (this->quoter_key_,
- TAO_TRY_ENV);
+ // direct Quoter Factory
+
+ // this->quoter_ = this->factory_var_->create_quoter (this->quoter_key_, TAO_TRY_ENV);
+
+ // using the Quoter Generic Factory
+ CosLifeCycle::Key genericFactoryName (1); // max = 1
+ genericFactoryName.length(1);
+ genericFactoryName[0].id = CORBA::string_dup ("Generic_Quoter_Factory");
+ CORBA::Object_var quoterObject_var =
+ this->generic_Factory_var_->create_object (genericFactoryName,
+ 0, TAO_TRY_ENV);
+ TAO_CHECK_ENV;
+
+ this->quoter_ = Stock::Quoter::_narrow (quoterObject_var.in(), TAO_TRY_ENV);
TAO_CHECK_ENV;
ACE_DEBUG ((LM_DEBUG, "Quoter Created\n"));
diff --git a/TAO/tests/Quoter/client.exe b/TAO/tests/Quoter/client.exe
index b8c25f9882d..36138ed87c8 100755
--- a/TAO/tests/Quoter/client.exe
+++ b/TAO/tests/Quoter/client.exe
Binary files differ
diff --git a/TAO/tests/Quoter/client.h b/TAO/tests/Quoter/client.h
index e91215faa26..833509975f5 100644
--- a/TAO/tests/Quoter/client.h
+++ b/TAO/tests/Quoter/client.h
@@ -75,6 +75,9 @@ private:
Stock::Quoter_Factory_var factory_var_;
// Pointer to a factory
+ Stock::Quoter_Generic_Factory_var generic_Factory_var_;
+ // Pointer to a generic factory
+
CORBA::Environment env_;
// Environment variable.
diff --git a/TAO/tests/Quoter/run_test.btm b/TAO/tests/Quoter/run_test.btm
index a42444959b0..ee2e29db9c7 100644
--- a/TAO/tests/Quoter/run_test.btm
+++ b/TAO/tests/Quoter/run_test.btm
@@ -15,6 +15,7 @@ set nsport=20002
set clport=20003
set svport=20004
set ffport=20005
+set gfport=20006
set n=1
set leave=/C
set ior=0
@@ -26,12 +27,12 @@ if %1 == /h goto is_h
if %1 == /? goto is_h
goto no_h
:is_h
-echo run_test [/n num] [/leave] [/h] [/ns|sv|ff|cl]
+echo run_test [/n num] [/leave] [/h] [/ns|sv|ff|cl|gf]
echo.
-echo /n num -- runs the client num times
-echo /leave -- leaves the servers running and their windows open
-echo /h -- prints this information
-echo /ns /sv /ff /cl -- Runs each separately
+echo /n num -- runs the client num times
+echo /leave -- leaves the servers running and their windows open
+echo /h -- prints this information
+echo /ns /sv /ff /cl /gf -- Runs each separately
quit
:no_h
@@ -50,6 +51,12 @@ set done=quit
goto run_finder
:no_ff
+if not %1 == /gf goto no_gf
+set done=quit
+goto run_generic_factory
+:no_gf
+
+
if not %1 == /cl goto no_cl
set done=quit
goto run_client
@@ -102,6 +109,19 @@ start "Quoter Factory Finder" %leave Factory_Finder.exe -ORBport %ffport -ORBobj
REM Delay some to let the Factory Finder get set up
DELAY %del
+:run_generic_factory
+REM read in the IOR from the file
+for %%d in (@%nsiorfile) do set ior=%%d
+
+REM Start the factory finder
+start "Quoter Generic Factory" %leave Generic_Factory.exe -ORBport %gfport -ORBobjrefstyle url -ORBnameserviceior %ior -ORBsvcconf svc.conf
+
+
+%done
+
+REM Delay some to let the Generic Factory get set up
+DELAY %del
+
:run_client
REM read in the IOR from the file
for %%d in (@%nsiorfile) do set ior=%%d
@@ -118,5 +138,6 @@ REM Remove any running servers
if %leave==/C activate "Naming Service" CLOSE
if %leave==/C activate "Quoter Server" CLOSE
if %leave==/C activate "Quoter Factory Finder" CLOSE
+if %leave==/C activate "Quoter Generic Factory" CLOSE
endlocal \ No newline at end of file
diff --git a/TAO/tests/Quoter/server.cpp b/TAO/tests/Quoter/server.cpp
index f62ae03c2dd..7e580492580 100644
--- a/TAO/tests/Quoter/server.cpp
+++ b/TAO/tests/Quoter/server.cpp
@@ -139,7 +139,7 @@ Quoter_Server::init_naming_service (CORBA::Environment& env)
//Context...
CosNaming::Name quoterFactoryContextName (1);
quoterFactoryContextName.length (1);
- quoterFactoryContextName[0].id = CORBA::string_dup ("quoter_factory");
+ quoterFactoryContextName[0].id = CORBA::string_dup ("Quoter_Factory");
quoterNameContext->bind (quoterFactoryContextName,
quoter_Factory_Impl_._this(env),
env);
@@ -175,7 +175,7 @@ Quoter_Server::~Quoter_Server (void)
CosNaming::Name factory_name (2);
factory_name.length (2);
factory_name[0].id = CORBA::string_dup ("IDL_Quoter");
- factory_name[1].id = CORBA::string_dup ("quoter_factory");
+ factory_name[1].id = CORBA::string_dup ("Quoter_Factory");
this->namingContext_var_->unbind (factory_name,TAO_TRY_ENV);
TAO_CHECK_ENV;
factory_name.length (1);
diff --git a/TAO/tests/Quoter/server.exe b/TAO/tests/Quoter/server.exe
index dcd5d206668..65864c822b3 100755
--- a/TAO/tests/Quoter/server.exe
+++ b/TAO/tests/Quoter/server.exe
Binary files differ