Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

testCfgEditor.cc File Reference

#include <iostream>
#include "Config/Param.h"
#include "Config/Config.h"
#include "Config/Observer.h"
#include "Config/Table.h"
#include "Config/Exception.h"
#include "Config/ConfigBuilder.h"
#include "Config/ConfigEditor.h"

Go to the source code of this file.

Classes

class  TestBuilder
 Test the handling of edit and build functions. More...
class  TestEditor
class  TestObserver

Functions

int main ()


Function Documentation

int main void   ) 
 

Definition at line 85 of file testCfgEditor.cc.

References TestBuilder::BuildCfg1(), TestBuilder::BuildCfg2(), cfg::ConfigEditor::Edit(), and cfg::Table::Instance().

00086 {
00087   TestBuilder b;
00088   b.BuildCfg1();
00089   b.BuildCfg2();
00090   
00091   std::cerr << "Should see updates as observer registers itself.\n";
00092   TestObserver obs;
00093 
00094   std::cerr << "Should see updates as configurations are edited.\n";
00095 
00096   cfg::Config* cfg1 = cfg::Table::Instance().GetConfig("Cfg1","test");
00097   if (cfg1==0) {
00098     std::cerr << "no Cfg1"; return 1;
00099   }
00100   TestEditor e1(cfg1);
00101   e1.Edit();
00102   
00103   cfg::Config* cfg2 = cfg::Table::Instance().GetConfig("Cfg2","default");
00104   if (cfg2==0) {
00105     std::cerr << "no Cfg2"; return 1;
00106   }
00107   try {
00108     TestEditor e2(cfg2);
00109     e2.Edit();
00110   }
00111   catch (cfg::Exception& e) {
00112     std::cerr << "*=> Exception caught: Correct behavior.\n";
00113   }
00114   return 0;
00115 }


Generated on Mon Nov 23 04:45:29 2009 for NOvA Offline by  doxygen 1.3.9.1