Commits

Anonymous committed 9620e0b

moved ProxyProviderSvc_test to ControlTest

  • Participants
  • Parent commits a478165

Comments (0)

Files changed (5)

+2007-07-09  Paolo Calafiura 
+	* cmt/requirements: moved ProxyProviderSvc_test to ControlTest to 
+	remove StoreGate <-> SGComps dep loop
+	* tagged as SGComps-00-00-04
+
 2007-07-06  Paolo Calafiura  <calaf@0-d-60-fb-f8-d3.dhcp.lbl.gov>
 	* cmt/requirements: make chkconfig happy
 	* tagged as SGComps-00-00-03
 
 private
 use TestTools      TestTools-*      AtlasTest
-use ToyConversion ToyConversion-*   Control/AthenaExamples 
-# need StoreGateSvc to run ProxyProviderSvc test
-use StoreGate      StoreGate-*      Control
-apply_pattern UnitTest_run unit_test=ProxyProviderSvc
-macro_append ProxyProviderSvc_testlinkopts " -L../$(CMTCONFIG) -lSGComps
 
 apply_pattern UnitTest_run unit_test=SGFolder
 

share/ProxyProviderSvc_test.ref

Binary file removed.

share/ProxyProviderSvc_test.txt

-// job opts for ProxyProviderSvc unit test
-
-// $Id: ProxyProviderSvc_test.txt,v 1.1.1.1 2007-06-22 23:21:47 calaf Exp $
-
-#include "StoreGate/StoreGateTestCommon.txt"
-#include "ToyConversion/ToyConversionOpts.txt"
-ProxyProviderSvc.OutputLevel = 1;

test/ProxyProviderSvc_test.cxx

-/** @file ProxyProviderSvc_test.cxx
- * @brief unit test for the proxy provider mechanism
- * @author ATLAS Collaboration
- ***************************************************************************/
-
-// $Id: ProxyProviderSvc_test.cxx,v 1.2 2007-06-22 23:54:59 calaf Exp $
-
-//<<<<<< INCLUDES                                                       >>>>>>
-
-#include "../src/ProxyProviderSvc.h"
-
-#include <cassert>
-#include <iostream>
-#include <string>
-
-#include "TestTools/initGaudi.h"
-#include "TestTools/SGassert.h"
-#include "ToyConversion/FooBar.h"
-#include "ToyConversion/ToyConversionSvc.h"
-
-#include "SGTools/TransientAddress.h"
-#include "SGTools/DataProxy.h"
-
-#include "StoreGate/StoreGateSvc.h"
-#include "CLIDSvc/tools/ClassID_traits.h"
-#include "AthenaKernel/IAddressProvider.h"
-#include "AthenaKernel/StoreID.h"
-
-#include "GaudiKernel/GenericAddress.h"
-#include "GaudiKernel/ISvcLocator.h"
-#include "GaudiKernel/StatusCode.h"
-#include "GaudiKernel/ClassID.h"
-
-
-#include <string>
-
-using namespace Athena_test;
-using std::cerr;
-using std::cout;
-using std::endl;
-using std::string;
-using SG::DataProxy;
-using SG::TransientAddress;
-
-class FooBar {};
-#include "CLIDSvc/CLASS_DEF.h"
-CLASS_DEF(FooBar, 8109, 0)
-
-template <typename PROXIED>
-class TestProvider : public IAddressProvider {
-public:
-  TestProvider(string key) :
-    m_ID(ClassID_traits<PROXIED>::ID()), m_key(key) 
-  {
-    m_IOA = new GenericAddress(ToyConversionSvc::storageType(),
-			       m_ID,m_key);
-  }
-  virtual ~TestProvider() {}
-  ///get all addresses that the provider wants to preload in SG maps
-
-  virtual StatusCode loadAddresses(StoreID::type /*id*/, tadList& /* tList */) 
-  {return StatusCode::SUCCESS;}
-
-  virtual StatusCode preLoadAddresses(StoreID::type /*id*/, tadList& tList) 
-  {
-    TransientAddress* tad = new TransientAddress(m_ID, m_key, m_IOA);
-    tList.push_back(tad);
-    return StatusCode::SUCCESS;
-  }
-
-  ///get a specific address, plus all others  the provider wants to load in SG maps
-  virtual StatusCode updateAddress(TransientAddress* tad)
-  { 
-    
-    if ((tad->clID() != m_ID) || (tad->name() != m_key)) {
-//        cout << "m_ID: " << m_ID.clID() << " " << m_ID.key() << endl;
-//        cout << "id: " << id.clID() << " " << id.key() << endl;
-      return StatusCode::FAILURE;
-    } else {
-      tad->setAddress(m_IOA);
-    }
-      return StatusCode::SUCCESS;
-  }
-      
-private:
-  CLID m_ID;
-  std::string m_key;
-  IOpaqueAddress* m_IOA;
-};
-
-
-int main() {
-  ISvcLocator* pSvcLoc(0);
-  if (!initGaudi("ProxyProviderSvc_test.txt", pSvcLoc)) {
-    cerr << "This test can not be run" << endl;
-    return 0;
-  }  
-  assert( pSvcLoc );
-
-  StoreGateSvc* pStore(0);
-  static const bool CREATE(true);
-  assert( (pSvcLoc->service("StoreGateSvc", pStore, CREATE)).isSuccess() );
-  assert( pStore );
-  IProxyProviderSvc* pIPPSvc;
-  assert( (pSvcLoc->service("ProxyProviderSvc", pIPPSvc, CREATE)).isSuccess() );
-  assert( pIPPSvc );
-
-  ProxyProviderSvc* pPPSvc = dynamic_cast<ProxyProviderSvc*>(pIPPSvc);
-  assert( pPPSvc );
-
-  pPPSvc->addProvider(new TestProvider<Foo>("aFoo"));
-  pPPSvc->addProvider(new TestProvider<Bar>("aBar"));
-  pPPSvc->addProvider(new TestProvider<FooBar>("aFooBar"));
-
-
-  DataHandle<Bar> hBar;
-  assert( (pStore->bind(hBar, "aBar")).isSuccess() );
-  
-  assert( hBar.ID() == "aBar" );
-
-  assert( hBar.cptr() );
-
-  cout << pStore->dump() << endl;
-
-  assert( !(pStore->transientContains<Foo>("aFoo")) );
-  assert( pStore->contains<Foo>("aFoo") );
-
-  const Foo* pFoo(0);
-  assert( (pStore->retrieve(pFoo, "aFoo")).isSuccess() );
-  assert( pFoo );
-
-
-  const FooBar* pFooBar(0);
-  SGASSERTERROR( (pStore->retrieve(pFooBar, "aFooBar")).isSuccess() );
-  assert( 0 == pFooBar );
-
-  cout << "*** ProxyProviderSvc_test OK ***" <<endl;
-  return 0;
-}
-