Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-03-09 04:50:14

0001 /*
0002  *  makepset_t.cc
0003  *  EDMProto
0004  *
0005  *  Created by Chris Jones on 5/18/05.
0006  *
0007  */
0008 
0009 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0010 #include "FWCore/PythonParameterSet/interface/PyBind11ProcessDesc.h"
0011 #include "FWCore/Utilities/interface/EDMException.h"
0012 #include "FWCore/Utilities/interface/resolveSymbolicLinks.h"
0013 
0014 #include "cppunit/extensions/HelperMacros.h"
0015 
0016 #include <memory>
0017 
0018 #include <algorithm>
0019 #include <iostream>
0020 #include <fstream>
0021 #include <stdlib.h>  // for setenv; <cstdlib> is likely to fail
0022 #include <string>
0023 #include <unistd.h>
0024 #include <filesystem>
0025 
0026 class testmakepset : public CppUnit::TestFixture {
0027   CPPUNIT_TEST_SUITE(testmakepset);
0028   CPPUNIT_TEST(typesTest);
0029   CPPUNIT_TEST(secsourceTest);
0030   CPPUNIT_TEST(usingBlockTest);
0031   CPPUNIT_TEST(fileinpathTest);
0032   CPPUNIT_TEST_SUITE_END();
0033 
0034 public:
0035   void setUp() {}
0036   void tearDown() {}
0037   void typesTest();
0038   void secsourceTest();
0039   void usingBlockTest();
0040   void fileinpathTest();
0041 
0042 private:
0043   void secsourceAux();
0044   void usingBlockAux();
0045   void fileinpathAux();
0046 };
0047 
0048 ///registration of the test so that the runner can find it
0049 CPPUNIT_TEST_SUITE_REGISTRATION(testmakepset);
0050 
0051 void testmakepset::secsourceTest() {
0052   try {
0053     this->secsourceAux();
0054   } catch (cms::Exception& x) {
0055     std::cerr << "testmakepset::secsourceTest() caught a cms::Exception\n";
0056     std::cerr << x.what() << '\n';
0057     throw;
0058   } catch (std::exception& x) {
0059     std::cerr << "testmakepset::secsourceTest() caught a std::exception\n";
0060     std::cerr << x.what() << '\n';
0061     throw;
0062   } catch (...) {
0063     std::cerr << "testmakepset::secsourceTest() caught an unidentified exception\n";
0064     throw;
0065   }
0066 }
0067 
0068 void testmakepset::secsourceAux() {
0069   char const* kTest =
0070       "import FWCore.ParameterSet.Config as cms\n"
0071       "process = cms.Process('PROD')\n"
0072       "process.maxEvents = cms.untracked.PSet(\n"
0073       "    input = cms.untracked.int32(2)\n"
0074       ")\n"
0075       "process.source = cms.Source('PoolSource',\n"
0076       "    fileNames = cms.untracked.vstring('file:main.root')\n"
0077       ")\n"
0078       "process.out = cms.OutputModule('PoolOutputModule',\n"
0079       "    fileName = cms.string('file:CumHits.root')\n"
0080       ")\n"
0081       "process.mix = cms.EDFilter('MixingModule',\n"
0082       "    input = cms.SecSource('EmbeddedRootSource',\n"
0083       "        fileNames = cms.untracked.vstring('file:pileup.root')\n"
0084       "    ),\n"
0085       "    max_bunch = cms.int32(3),\n"
0086       "    average_number = cms.double(14.3),\n"
0087       "    min_bunch = cms.int32(-5),\n"
0088       "    type = cms.string('fixed')\n"
0089       ")\n"
0090       "process.p = cms.Path(process.mix)\n"
0091       "process.ep = cms.EndPath(process.out)\n";
0092 
0093   std::string config(kTest);
0094 
0095   // Create the ParameterSet object from this configuration string.
0096   PyBind11ProcessDesc builder(config);
0097   std::shared_ptr<edm::ParameterSet> ps = builder.parameterSet();
0098 
0099   CPPUNIT_ASSERT(nullptr != ps.get());
0100 
0101   // Make sure this ParameterSet object has the right contents
0102   edm::ParameterSet const& mixingModuleParams = ps->getParameterSet("mix");
0103   edm::ParameterSet const& secondarySourceParams = mixingModuleParams.getParameterSet("input");
0104   CPPUNIT_ASSERT(secondarySourceParams.getParameter<std::string>("@module_type") == "EmbeddedRootSource");
0105   CPPUNIT_ASSERT(secondarySourceParams.getParameter<std::string>("@module_label") == "input");
0106   CPPUNIT_ASSERT(secondarySourceParams.getUntrackedParameter<std::vector<std::string> >("fileNames")[0] ==
0107                  "file:pileup.root");
0108 }
0109 
0110 void testmakepset::usingBlockTest() {
0111   try {
0112     this->usingBlockAux();
0113   } catch (cms::Exception& x) {
0114     std::cerr << "testmakepset::usingBlockTest() caught a cms::Exception\n";
0115     std::cerr << x.what() << '\n';
0116     throw;
0117   } catch (...) {
0118     std::cerr << "testmakepset::usingBlockTest() caught an unidentified exception\n";
0119     throw;
0120   }
0121 }
0122 
0123 void testmakepset::usingBlockAux() {
0124   char const* kTest =
0125       "import FWCore.ParameterSet.Config as cms\n"
0126       "process = cms.Process('PROD')\n"
0127       "process.maxEvents = cms.untracked.PSet(\n"
0128       "    input = cms.untracked.int32(2)\n"
0129       ")\n"
0130       "process.source = cms.Source('PoolSource',\n"
0131       "    fileNames = cms.untracked.vstring('file:main.root')\n"
0132       ")\n"
0133       "process.b = cms.PSet(\n"
0134       "    s = cms.string('original'),\n"
0135       "    r = cms.double(1.5)\n"
0136       ")\n"
0137       "process.m1 = cms.EDFilter('Class1',\n"
0138       "    process.b,\n"
0139       "    i = cms.int32(1)\n"
0140       ")\n"
0141       "process.m2 = cms.EDFilter('Class2',\n"
0142       "    process.b,\n"
0143       "    i = cms.int32(2),\n"
0144       "    j = cms.int32(3),\n"
0145       "    u = cms.uint64(1011),\n"
0146       "    l = cms.int64(101010)\n"
0147       ")\n"
0148       "process.p = cms.Path(process.m1+process.m2)\n";
0149 
0150   std::string config(kTest);
0151   // Create the ParameterSet object from this configuration string.
0152   PyBind11ProcessDesc builder(config);
0153   std::shared_ptr<edm::ParameterSet> ps = builder.parameterSet();
0154   CPPUNIT_ASSERT(nullptr != ps.get());
0155 
0156   // Make sure this ParameterSet object has the right contents
0157   edm::ParameterSet const& m1Params = ps->getParameterSet("m1");
0158   edm::ParameterSet const& m2Params = ps->getParameterSet("m2");
0159   CPPUNIT_ASSERT(m1Params.getParameter<int>("i") == 1);
0160   CPPUNIT_ASSERT(m2Params.getParameter<int>("i") == 2);
0161   CPPUNIT_ASSERT(m2Params.getParameter<int>("j") == 3);
0162   CPPUNIT_ASSERT(m2Params.getParameter<long long>("l") == 101010);
0163   CPPUNIT_ASSERT(m2Params.getParameter<unsigned long long>("u") == 1011);
0164 
0165   CPPUNIT_ASSERT(m1Params.getParameter<std::string>("s") == "original");
0166   CPPUNIT_ASSERT(m2Params.getParameter<std::string>("s") == "original");
0167 
0168   CPPUNIT_ASSERT(m1Params.getParameter<double>("r") == 1.5);
0169   CPPUNIT_ASSERT(m2Params.getParameter<double>("r") == 1.5);
0170 }
0171 
0172 void testmakepset::fileinpathTest() {
0173   try {
0174     this->fileinpathAux();
0175   } catch (cms::Exception& x) {
0176     std::cerr << "testmakepset::fileinpathTest() caught a cms::Exception\n";
0177     std::cerr << x.what() << '\n';
0178     throw;
0179   } catch (...) {
0180     std::cerr << "testmakepset::fileinpathTest() caught an unidentified exception\n";
0181     throw;
0182   }
0183 }
0184 
0185 void testmakepset::fileinpathAux() {
0186   char const* kTest =
0187       "import FWCore.ParameterSet.Config as cms\n"
0188       "process = cms.Process('PROD')\n"
0189       "process.main = cms.PSet(\n"
0190       "    topo = cms.FileInPath('Geometry/TrackerSimData/data/trackersens.xml'),\n"
0191       "    fip = cms.FileInPath('FWCore/PythonParameterSet/test/fip.txt'),\n"
0192       "    ufip = cms.untracked.FileInPath('FWCore/PythonParameterSet/test/ufip.txt'),\n"
0193       "    extraneous = cms.int32(12)\n"
0194       ")\n"
0195       "process.source = cms.Source('EmptySource')\n";
0196 
0197   std::string config(kTest);
0198   std::string tmpout;
0199   bool localArea = false;
0200   // Create the ParameterSet object from this configuration string.
0201   {
0202     PyBind11ProcessDesc builder(config);
0203     std::shared_ptr<edm::ParameterSet> ps = builder.parameterSet();
0204     CPPUNIT_ASSERT(nullptr != ps.get());
0205 
0206     edm::ParameterSet const& innerps = ps->getParameterSet("main");
0207     edm::FileInPath fip = innerps.getParameter<edm::FileInPath>("fip");
0208     edm::FileInPath ufip = innerps.getUntrackedParameter<edm::FileInPath>("ufip");
0209     CPPUNIT_ASSERT(innerps.existsAs<int>("extraneous"));
0210     CPPUNIT_ASSERT(!innerps.existsAs<int>("absent"));
0211     char* releaseBase = std::getenv("CMSSW_RELEASE_BASE");
0212     char* localBase = std::getenv("CMSSW_BASE");
0213     localArea = (releaseBase != nullptr && strlen(releaseBase) != 0 && strcmp(releaseBase, localBase));
0214     if (localArea) {
0215       // Need to account for possible symbolic links
0216       std::string const src("/src");
0217       std::string release = releaseBase + src;
0218       std::string local = localBase + src;
0219       edm::resolveSymbolicLinks(release);
0220       edm::resolveSymbolicLinks(local);
0221       localArea = (local != release);
0222     }
0223 
0224     if (localArea) {
0225       CPPUNIT_ASSERT(fip.location() == edm::FileInPath::Local);
0226     }
0227     CPPUNIT_ASSERT(fip.relativePath() == "FWCore/PythonParameterSet/test/fip.txt");
0228     CPPUNIT_ASSERT(ufip.relativePath() == "FWCore/PythonParameterSet/test/ufip.txt");
0229     std::string fullpath = fip.fullPath();
0230     std::cerr << "fullPath is: " << fip.fullPath() << std::endl;
0231     std::cerr << "copy of fullPath is: " << fullpath << std::endl;
0232 
0233     CPPUNIT_ASSERT(!fullpath.empty());
0234 
0235     tmpout = fullpath.substr(0, fullpath.find("FWCore/PythonParameterSet/test/fip.txt")) + "tmp.py";
0236 
0237     edm::FileInPath topo = innerps.getParameter<edm::FileInPath>("topo");
0238     // if the file is local, then just disable this check as then it is expected to fail
0239     {
0240       std::string const src("/src");
0241       std::string local = localBase + src;
0242       std::string localFile = local + "/Geometry/TrackerSimData/data/trackersens.xml";
0243       if (!std::filesystem::exists(localFile))
0244         CPPUNIT_ASSERT(topo.location() != edm::FileInPath::Local);
0245       else
0246         std::cerr << "Disabling test against local path for trackersens.xml as package is checked out in this test"
0247                   << std::endl;
0248     }
0249     CPPUNIT_ASSERT(topo.relativePath() == "Geometry/TrackerSimData/data/trackersens.xml");
0250     fullpath = topo.fullPath();
0251     CPPUNIT_ASSERT(!fullpath.empty());
0252 
0253     std::vector<edm::FileInPath> v(1);
0254     CPPUNIT_ASSERT(innerps.getAllFileInPaths(v) == 3);
0255 
0256     CPPUNIT_ASSERT(v.size() == 4);
0257     CPPUNIT_ASSERT(std::count(v.begin(), v.end(), fip) == 1);
0258     CPPUNIT_ASSERT(std::count(v.begin(), v.end(), topo) == 1);
0259 
0260     edm::ParameterSet empty;
0261     v.clear();
0262     CPPUNIT_ASSERT(empty.getAllFileInPaths(v) == 0);
0263     CPPUNIT_ASSERT(v.empty());
0264   }
0265   // This last test checks that a FileInPath parameter can be read
0266   // successfully even if the associated file no longer exists.
0267   std::ofstream out(tmpout.c_str());
0268   CPPUNIT_ASSERT(!(!out));
0269 
0270   char const* kTest2 =
0271       "import FWCore.ParameterSet.Config as cms\n"
0272       "process = cms.Process('PROD')\n"
0273       "process.main = cms.PSet(\n"
0274       "    fip2 = cms.FileInPath('tmp.py')\n"
0275       ")\n"
0276       "process.source = cms.Source('EmptySource')\n";
0277 
0278   std::string config2(kTest2);
0279   // Create the ParameterSet object from this configuration string.
0280   PyBind11ProcessDesc builder2(config2);
0281   unlink(tmpout.c_str());
0282   std::shared_ptr<edm::ParameterSet> ps2 = builder2.parameterSet();
0283 
0284   CPPUNIT_ASSERT(nullptr != ps2.get());
0285 
0286   edm::ParameterSet const& innerps2 = ps2->getParameterSet("main");
0287   edm::FileInPath fip2 = innerps2.getParameter<edm::FileInPath>("fip2");
0288   if (localArea) {
0289     CPPUNIT_ASSERT(fip2.location() == edm::FileInPath::Local);
0290   }
0291   CPPUNIT_ASSERT(fip2.relativePath() == "tmp.py");
0292   std::string fullpath2 = fip2.fullPath();
0293   std::cerr << "fullPath is: " << fip2.fullPath() << std::endl;
0294   std::cerr << "copy of fullPath is: " << fullpath2 << std::endl;
0295   CPPUNIT_ASSERT(!fullpath2.empty());
0296 }
0297 
0298 void testmakepset::typesTest() {
0299   //vbool vb = {true, false};
0300   char const* kTest =
0301       "import FWCore.ParameterSet.Config as cms\n"
0302       "process = cms.Process('t')\n"
0303       "process.p = cms.PSet(\n"
0304       "    input2 = cms.InputTag('Label2','Instance2'),\n"
0305       "    sb3 = cms.string('    '),\n"
0306       "    input1 = cms.InputTag('Label1','Instance1'),\n"
0307       "    input6 = cms.InputTag('source'),\n"
0308       "    ##justasbig = cms.double(inf),\n"
0309       "    input4 = cms.InputTag('Label4','Instance4','Process4'),\n"
0310       "    input3 = cms.untracked.InputTag('Label3','Instance3'),\n"
0311       "    h2 = cms.uint32(255),\n"
0312       "    vi = cms.vint32(1, -2),\n"
0313       "    input8 = cms.string('deprecatedString:tag'),\n"
0314       "    h1 = cms.int32(74),\n"
0315       "    vs = cms.vstring('','1', \n"
0316       "        '2', \n"
0317       "        'a', 'XXX'),\n"
0318       "    vs2 = cms.vstring(), vs3 = cms.vstring(''),\n"
0319       "    sb2 = cms.string(''),\n"
0320       "    input7 = cms.InputTag('source','sink'),\n"
0321       "    ps = cms.PSet(\n"
0322       "        b2 = cms.untracked.bool(True)\n"
0323       "    ),\n"
0324       "    input5 = cms.InputTag('Label5','','Process5'),\n"
0325       "    h3 = cms.untracked.uint32(3487559679),\n"
0326       "    input = cms.InputTag('Label'),\n"
0327       "    vps = cms.VPSet(cms.PSet(\n"
0328       "        b3 = cms.bool(False)\n"
0329       "    )),\n"
0330       "    ##indebt = cms.double(-inf),\n"
0331       "    ##big = cms.double(inf),\n"
0332       "    vinput = cms.VInputTag(cms.InputTag('l1','i1'), cms.InputTag('l2'), cms.InputTag('l3','i3','p3'), "
0333       "cms.InputTag('l4','','p4'), cms.InputTag('source'), \n"
0334       "        cms.InputTag('source','sink')),\n"
0335       "    ui = cms.uint32(1),\n"
0336       "    eventID = cms.EventID(1, 0, 1),\n"
0337       "    b = cms.untracked.bool(True),\n"
0338       "    d = cms.double(1.0),\n"
0339       "    i = cms.int32(1),\n"
0340       "    vui = cms.vuint32(1, 2, 1, 255),\n"
0341       "    s = cms.string('this string'),\n"
0342       "    sb1 = cms.string(''),\n"
0343       "    emptyString = cms.untracked.string(''),\n"
0344       "    vEventID = cms.VEventID('1:1', '2:2','3:3'),\n"
0345       "    lumi = cms.LuminosityBlockID(55, 65),\n"
0346       "    vlumis = cms.VLuminosityBlockID('75:85', '95:105'),\n"
0347       "    einput1 = cms.ESInputTag(),\n"
0348       "    einput2 = cms.ESInputTag(data='blah'),\n"
0349       "    einput3 = cms.ESInputTag('ESProd:'),\n"
0350       "    einput4 = cms.ESInputTag('ESProd','something'),\n"
0351       "    einput5 = cms.ESInputTag('ESProd:something'),\n"
0352       "    veinput1 = cms.VESInputTag(),\n"
0353       "    veinput2 = cms.VESInputTag(cms.ESInputTag(data='blah'),cms.ESInputTag('ESProd:'))\n"
0354       ")\n"
0355 
0356       ;
0357 
0358   std::string config2(kTest);
0359   // Create the ParameterSet object from this configuration string.
0360   PyBind11ProcessDesc builder2(config2);
0361   std::shared_ptr<edm::ParameterSet> ps2 = builder2.parameterSet();
0362   edm::ParameterSet const& test = ps2->getParameterSet("p");
0363 
0364   CPPUNIT_ASSERT(1 == test.getParameter<int>("i"));
0365   CPPUNIT_ASSERT(test.retrieve("i").isTracked());
0366   CPPUNIT_ASSERT(1 == test.getParameter<unsigned int>("ui"));
0367   CPPUNIT_ASSERT(1 == test.getParameter<double>("d"));
0368   //CPPUNIT_ASSERT(100000. < test.getParameter<double>("big"));
0369   //CPPUNIT_ASSERT(100000. < test.getParameter<double>("justasbig"));
0370   //CPPUNIT_ASSERT(-1000000. > test.getParameter<double>("indebt"));
0371 
0372   // test hex numbers
0373   CPPUNIT_ASSERT(74 == test.getParameter<int>("h1"));
0374   CPPUNIT_ASSERT(255 == test.getParameter<unsigned int>("h2"));
0375   CPPUNIT_ASSERT(3487559679U == test.getUntrackedParameter<unsigned int>("h3"));
0376 
0377   CPPUNIT_ASSERT("this string" == test.getParameter<std::string>("s"));
0378   CPPUNIT_ASSERT("" == test.getParameter<std::string>("sb1"));
0379   CPPUNIT_ASSERT("" == test.getUntrackedParameter<std::string>("emptyString", "default"));
0380   CPPUNIT_ASSERT("" == test.getParameter<std::string>("sb2"));
0381   CPPUNIT_ASSERT(4 == test.getParameter<std::string>("sb3").size());
0382   std::vector<std::string> vs = test.getParameter<std::vector<std::string> >("vs");
0383   int vssize = vs.size();
0384   //FIXME doesn't do spaces right
0385   edm::Entry e(test.retrieve("vs"));
0386   CPPUNIT_ASSERT(5 == vssize);
0387   CPPUNIT_ASSERT(vssize && "" == vs[0]);
0388   CPPUNIT_ASSERT(vssize > 1 && "1" == vs[1]);
0389   CPPUNIT_ASSERT(vssize > 1 && "a" == vs[3]);
0390   vs = test.getParameter<std::vector<std::string> >("vs2");
0391   CPPUNIT_ASSERT(vs.size() == 0);
0392   vs = test.getParameter<std::vector<std::string> >("vs3");
0393   CPPUNIT_ASSERT(vs.size() == 1);
0394   CPPUNIT_ASSERT(vs[0] == "");
0395 
0396   static unsigned int const vuia[] = {1, 2, 1, 255};
0397   static std::vector<unsigned int> const vui(vuia, vuia + sizeof(vuia) / sizeof(unsigned int));
0398   CPPUNIT_ASSERT(vui == test.getParameter<std::vector<unsigned int> >("vui"));
0399 
0400   static int const via[] = {1, -2};
0401   static std::vector<int> const vi(via, via + sizeof(via) / sizeof(int));
0402   test.getParameter<std::vector<int> >("vi");
0403   CPPUNIT_ASSERT(true == test.getUntrackedParameter<bool>("b", false));
0404   CPPUNIT_ASSERT(test.retrieve("vi").isTracked());
0405   //test.getParameter<std::vector<bool> >("vb");
0406   edm::ParameterSet const& ps = test.getParameterSet("ps");
0407   CPPUNIT_ASSERT(true == ps.getUntrackedParameter<bool>("b2", false));
0408   std::vector<edm::ParameterSet> const& vps = test.getParameterSetVector("vps");
0409   CPPUNIT_ASSERT(1 == vps.size());
0410   CPPUNIT_ASSERT(false == vps.front().getParameter<bool>("b3"));
0411 
0412   // InputTag
0413   edm::InputTag inputProduct = test.getParameter<edm::InputTag>("input");
0414   edm::InputTag inputProduct1 = test.getParameter<edm::InputTag>("input1");
0415   edm::InputTag inputProduct2 = test.getParameter<edm::InputTag>("input2");
0416   edm::InputTag inputProduct3 = test.getUntrackedParameter<edm::InputTag>("input3");
0417   edm::InputTag inputProduct4 = test.getParameter<edm::InputTag>("input4");
0418   edm::InputTag inputProduct5 = test.getParameter<edm::InputTag>("input5");
0419   edm::InputTag inputProduct6 = test.getParameter<edm::InputTag>("input6");
0420   edm::InputTag inputProduct7 = test.getParameter<edm::InputTag>("input7");
0421   edm::InputTag inputProduct8 = test.getParameter<edm::InputTag>("input8");
0422 
0423   //edm::OutputTag outputProduct = test.getParameter<edm::OutputTag>("output");
0424 
0425   CPPUNIT_ASSERT("Label" == inputProduct.label());
0426   CPPUNIT_ASSERT("Label1" == inputProduct1.label());
0427   CPPUNIT_ASSERT("Label2" == inputProduct2.label());
0428   CPPUNIT_ASSERT("Instance2" == inputProduct2.instance());
0429   CPPUNIT_ASSERT("Label3" == inputProduct3.label());
0430   CPPUNIT_ASSERT("Instance3" == inputProduct3.instance());
0431   CPPUNIT_ASSERT("Label4" == inputProduct4.label());
0432   CPPUNIT_ASSERT("Instance4" == inputProduct4.instance());
0433   CPPUNIT_ASSERT("Process4" == inputProduct4.process());
0434   CPPUNIT_ASSERT("Label5" == inputProduct5.label());
0435   CPPUNIT_ASSERT("" == inputProduct5.instance());
0436   CPPUNIT_ASSERT("Process5" == inputProduct5.process());
0437   CPPUNIT_ASSERT("source" == inputProduct6.label());
0438   CPPUNIT_ASSERT("source" == inputProduct7.label());
0439   CPPUNIT_ASSERT("deprecatedString" == inputProduct8.label());
0440 
0441   // vector of InputTags
0442 
0443   std::vector<edm::InputTag> vtags = test.getParameter<std::vector<edm::InputTag> >("vinput");
0444   CPPUNIT_ASSERT("l1" == vtags[0].label());
0445   CPPUNIT_ASSERT("i1" == vtags[0].instance());
0446   CPPUNIT_ASSERT("l2" == vtags[1].label());
0447   CPPUNIT_ASSERT("l3" == vtags[2].label());
0448   CPPUNIT_ASSERT("i3" == vtags[2].instance());
0449   CPPUNIT_ASSERT("p3" == vtags[2].process());
0450   CPPUNIT_ASSERT("l4" == vtags[3].label());
0451   CPPUNIT_ASSERT("" == vtags[3].instance());
0452   CPPUNIT_ASSERT("p4" == vtags[3].process());
0453   CPPUNIT_ASSERT("source" == vtags[4].label());
0454   CPPUNIT_ASSERT("source" == vtags[5].label());
0455 
0456   // ESInputTag
0457   edm::ESInputTag einput1 = test.getParameter<edm::ESInputTag>("einput1");
0458   edm::ESInputTag einput2 = test.getParameter<edm::ESInputTag>("einput2");
0459   edm::ESInputTag einput3 = test.getParameter<edm::ESInputTag>("einput3");
0460   edm::ESInputTag einput4 = test.getParameter<edm::ESInputTag>("einput4");
0461   edm::ESInputTag einput5 = test.getParameter<edm::ESInputTag>("einput5");
0462   CPPUNIT_ASSERT("" == einput1.module());
0463   CPPUNIT_ASSERT("" == einput1.data());
0464   CPPUNIT_ASSERT("" == einput2.module());
0465   CPPUNIT_ASSERT("blah" == einput2.data());
0466   CPPUNIT_ASSERT("ESProd" == einput3.module());
0467   CPPUNIT_ASSERT("" == einput3.data());
0468   CPPUNIT_ASSERT("ESProd" == einput4.module());
0469   CPPUNIT_ASSERT("something" == einput4.data());
0470   CPPUNIT_ASSERT("ESProd" == einput5.module());
0471   CPPUNIT_ASSERT("something" == einput5.data());
0472 
0473   std::vector<edm::ESInputTag> veinput1 = test.getParameter<std::vector<edm::ESInputTag> >("veinput1");
0474   std::vector<edm::ESInputTag> veinput2 = test.getParameter<std::vector<edm::ESInputTag> >("veinput2");
0475   CPPUNIT_ASSERT(0 == veinput1.size());
0476   CPPUNIT_ASSERT(2 == veinput2.size());
0477   CPPUNIT_ASSERT("" == veinput2[0].module());
0478   CPPUNIT_ASSERT("blah" == veinput2[0].data());
0479   CPPUNIT_ASSERT("ESProd" == veinput2[1].module());
0480   CPPUNIT_ASSERT("" == veinput2[1].data());
0481 
0482   edm::EventID eventID = test.getParameter<edm::EventID>("eventID");
0483   std::vector<edm::EventID> vEventID = test.getParameter<std::vector<edm::EventID> >("vEventID");
0484   CPPUNIT_ASSERT(1 == eventID.run());
0485   CPPUNIT_ASSERT(1 == eventID.event());
0486   CPPUNIT_ASSERT(1 == vEventID[0].run());
0487   CPPUNIT_ASSERT(1 == vEventID[0].event());
0488   CPPUNIT_ASSERT(3 == vEventID[2].run());
0489   CPPUNIT_ASSERT(3 == vEventID[2].event());
0490 
0491   edm::LuminosityBlockID lumi = test.getParameter<edm::LuminosityBlockID>("lumi");
0492   CPPUNIT_ASSERT(55 == lumi.run());
0493   CPPUNIT_ASSERT(65 == lumi.luminosityBlock());
0494   std::vector<edm::LuminosityBlockID> vlumis = test.getParameter<std::vector<edm::LuminosityBlockID> >("vlumis");
0495   CPPUNIT_ASSERT(vlumis.size() == 2);
0496   CPPUNIT_ASSERT(vlumis[0].run() == 75);
0497   CPPUNIT_ASSERT(vlumis[0].luminosityBlock() == 85);
0498   CPPUNIT_ASSERT(vlumis[1].run() == 95);
0499   CPPUNIT_ASSERT(vlumis[1].luminosityBlock() == 105);
0500 
0501   //CPPUNIT_ASSERT("Label2" == outputProduct.label());
0502   //CPPUNIT_ASSERT(""       == outputProduct.instance());
0503   //CPPUNIT_ASSERT("Alias2" == outputProduct.alias());
0504   //BOOST_CHECK_THROW(makePSet(*nodeList), std::runtime_error);
0505 }