Package com.opengamma.financial.analytics.ircurve

Examples of com.opengamma.financial.analytics.ircurve.FixedIncomeStripWithIdentifier


  @Override
  public FixedIncomeStripWithIdentifier buildObject(FudgeDeserializer deserializer, FudgeMsg message) {
    FixedIncomeStrip type = deserializer.fieldValueToObject(FixedIncomeStrip.class, message.getByName(STRIP_NAME));
    ExternalId security = deserializer.fieldValueToObject(ExternalId.class, message.getByName(IDENTIFIER_NAME));
    return new FixedIncomeStripWithIdentifier(type, security);
  }
View Full Code Here


  @Override
  public FixedIncomeStripWithIdentifier buildObject(FudgeDeserializer deserializer, FudgeMsg message) {
    FixedIncomeStrip type = deserializer.fieldValueToObject(FixedIncomeStrip.class, message.getByName(STRIP_NAME));
    ExternalId security = deserializer.fieldValueToObject(ExternalId.class, message.getByName(IDENTIFIER_NAME));
    return new FixedIncomeStripWithIdentifier(type, security);
  }
View Full Code Here

@Test(groups = TestGroup.UNIT)
public class FixedIncomeStripWithIdentifierFudgeEncodingTest extends FinancialTestBase {

  @Test
  public void testCycle() {
    FixedIncomeStripWithIdentifier strip = new FixedIncomeStripWithIdentifier(new FixedIncomeStrip(StripInstrumentType.CASH, Tenor.DAY, "DEFAULT"), ExternalId.of(ExternalSchemes.BLOOMBERG_TICKER,
        "USDR5 Curncy"));
    assertEquals(strip, cycleObject(FixedIncomeStripWithIdentifier.class, strip));
    strip = new FixedIncomeStripWithIdentifier(new FixedIncomeStrip(StripInstrumentType.LIBOR, Tenor.ONE_MONTH, "DEFAULT"), ExternalId.of(ExternalSchemes.BLOOMBERG_TICKER, "US0001M Curncy"));
    assertEquals(strip, cycleObject(FixedIncomeStripWithIdentifier.class, strip));
    strip = new FixedIncomeStripWithIdentifier(new FixedIncomeStrip(StripInstrumentType.EURIBOR, Tenor.ONE_MONTH, "DEFAULT"), ExternalId.of(ExternalSchemes.BLOOMBERG_TICKER, "US0001M Curncy"));
    assertEquals(strip, cycleObject(FixedIncomeStripWithIdentifier.class, strip));
    strip = new FixedIncomeStripWithIdentifier(new FixedIncomeStrip(StripInstrumentType.FUTURE, Tenor.YEAR, 3, "DEFAULT"), ExternalId.of(ExternalSchemes.BLOOMBERG_TICKER, "L Z3 Comdty"));
    assertEquals(strip, cycleObject(FixedIncomeStripWithIdentifier.class, strip));
    strip = new FixedIncomeStripWithIdentifier(new FixedIncomeStrip(StripInstrumentType.FRA_3M, Tenor.YEAR, "DEFAULT"), ExternalId.of(ExternalSchemes.BLOOMBERG_TICKER, "USFR01C Curncy"));
    assertEquals(strip, cycleObject(FixedIncomeStripWithIdentifier.class, strip));
    strip = new FixedIncomeStripWithIdentifier(new FixedIncomeStrip(StripInstrumentType.FRA_6M, Tenor.YEAR, "DEFAULT"), ExternalId.of(ExternalSchemes.BLOOMBERG_TICKER, "USFR01C Curncy"));
    assertEquals(strip, cycleObject(FixedIncomeStripWithIdentifier.class, strip));
    strip = new FixedIncomeStripWithIdentifier(new FixedIncomeStrip(StripInstrumentType.SWAP_3M, Tenor.YEAR, "DEFAULT"), ExternalId.of(ExternalSchemes.BLOOMBERG_TICKER, "USSW1 Curncy"));
    assertEquals(strip, cycleObject(FixedIncomeStripWithIdentifier.class, strip));
    strip = new FixedIncomeStripWithIdentifier(new FixedIncomeStrip(StripInstrumentType.SWAP_3M, Tenor.YEAR, "DEFAULT"), ExternalId.of(ExternalSchemes.BLOOMBERG_TICKER, "USSW1 Curncy"));
    assertEquals(strip, cycleObject(FixedIncomeStripWithIdentifier.class, strip));
    strip = new FixedIncomeStripWithIdentifier(new FixedIncomeStrip(StripInstrumentType.TENOR_SWAP, Tenor.YEAR, "DEFAULT"), ExternalId.of(ExternalSchemes.BLOOMBERG_TICKER, "USBG1 Curncy"));
    assertEquals(strip, cycleObject(FixedIncomeStripWithIdentifier.class, strip));
    strip = new FixedIncomeStripWithIdentifier(new FixedIncomeStrip(StripInstrumentType.BASIS_SWAP, Tenor.YEAR, Tenor.SIX_MONTHS, Tenor.ONE_YEAR, IndexType.Libor, IndexType.Libor, "DEFAULT"),
        ExternalId.of(ExternalSchemes.BLOOMBERG_TICKER, "USBG1 Curncy"));
    assertEquals(strip, cycleObject(FixedIncomeStripWithIdentifier.class, strip));
    strip = new FixedIncomeStripWithIdentifier(new FixedIncomeStrip(StripInstrumentType.OIS_SWAP, Tenor.YEAR, "DEFAULT"), ExternalId.of(ExternalSchemes.BLOOMBERG_TICKER, "USSO1 Curncy"));
    assertEquals(strip, cycleObject(FixedIncomeStripWithIdentifier.class, strip));
  }
View Full Code Here

TOP

Related Classes of com.opengamma.financial.analytics.ircurve.FixedIncomeStripWithIdentifier

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.