33 {
34
35 BOOST_TEST_MESSAGE("Testing parsing of correlation curve configuration from XML");
36
37
38 string configXml;
39 configXml.append("<Correlation>");
40 configXml.append(" <CurveId>EUR-CMS-10Y/EUR-CMS-1Y</CurveId>");
41 configXml.append(" <CurveDescription>EUR CMS correlations</CurveDescription>");
42 configXml.append(" <CorrelationType>CMSSpread</CorrelationType>");
43 configXml.append(" <Currency>EUR</Currency>");
44 configXml.append(" <Dimension>ATM</Dimension>");
45 configXml.append(" <QuoteType>PRICE</QuoteType>");
46 configXml.append(" <Extrapolation>true</Extrapolation>");
47 configXml.append(" <Conventions>EUR-CMS-10Y-1Y-CONVENTION</Conventions>");
48 configXml.append(" <SwaptionVolatility>EUR</SwaptionVolatility>");
49 configXml.append(" <DiscountCurve>EUR-EONIA</DiscountCurve>");
50 configXml.append(" <Calendar>TARGET</Calendar>");
51 configXml.append(" <DayCounter>A365</DayCounter>");
52 configXml.append(" <BusinessDayConvention>Following</BusinessDayConvention>");
53 configXml.append(" <OptionTenors>1Y,2Y</OptionTenors>");
54 configXml.append(" <Index1>EUR-CMS-10Y</Index1>");
55 configXml.append(" <Index2>EUR-CMS-1Y</Index2>");
56 configXml.append("</CorrelationCurve>");
57
58
62
63
66
67
68 vector<string> quotes = {"CORRELATION/PRICE/EUR-CMS-10Y/EUR-CMS-1Y/1Y/ATM",
69 "CORRELATION/PRICE/EUR-CMS-10Y/EUR-CMS-1Y/2Y/ATM"};
70
71
72 BOOST_CHECK_EQUAL(config.
curveID(),
"EUR-CMS-10Y/EUR-CMS-1Y");
74 BOOST_CHECK_EQUAL(config.
index1(),
"EUR-CMS-10Y");
75 BOOST_CHECK_EQUAL(config.
index2(),
"EUR-CMS-1Y");
76 BOOST_CHECK_EQUAL_COLLECTIONS(quotes.begin(), quotes.end(), config.
quotes().begin(), config.
quotes().end());
78 BOOST_CHECK_EQUAL(config.
conventions(),
"EUR-CMS-10Y-1Y-CONVENTION");
81 BOOST_CHECK_EQUAL(config.
dayCounter().name(),
"Actual/365 (Fixed)");
82 BOOST_CHECK_EQUAL(config.
calendar().name(),
"TARGET");
84
85 vector<string> p;
86 p.push_back("1Y");
87 p.push_back("2Y");
88
90}
Correlation curve configuration.
const string & swaptionVolatility() const
const vector< string > & optionTenors() const
const string & index1() const
const bool & extrapolate() const
const DayCounter & dayCounter() const
const Calendar & calendar() const
void fromXML(XMLNode *node) override
const vector< string > & quotes() override
Return all the market quotes required for this config.
const string & conventions() const
const string & discountCurve() const
const string & index2() const
const BusinessDayConvention & businessDayConvention() const
const string & curveDescription() const
const string & curveID() const
Small XML Document wrapper class.
void fromXMLString(const string &xmlString)
load a document from a hard-coded string
XMLNode * getFirstNode(const string &name) const