Package com.opengamma.financial.analytics.ircurve.strips

Examples of com.opengamma.financial.analytics.ircurve.strips.FRANode.accept()


  }

  @Test(expectedExceptions = OpenGammaRuntimeException.class)
  public void testNullFRAConvention() {
    final FRANode node = new FRANode(Tenor.ONE_DAY, Tenor.THREE_MONTHS, LIBOR_3M_ID, SCHEME);
    node.accept(EMPTY_CONVENTIONS);
  }

  @Test(expectedExceptions = OpenGammaRuntimeException.class)
  public void testNullRateFutureConvention() {
    final RateFutureNode node = new RateFutureNode(2, Tenor.ONE_DAY, Tenor.THREE_MONTHS, Tenor.THREE_MONTHS, RATE_FUTURE_3M_ID, LIBOR_3M_ID, SCHEME);
View Full Code Here


  }

  @Test
  public void testFRANode() {
    final FRANode node = new FRANode(Tenor.ONE_DAY, Tenor.THREE_MONTHS, LIBOR_3M_ID, SCHEME);
    final Set<Currency> currencies = node.accept(VISITOR);
    assertEquals(1, currencies.size());
    assertEquals(Currency.USD, currencies.iterator().next());
  }

  @Test
View Full Code Here

    final double rate = 0.0012345;
    marketValues.setDataPoint(marketDataId, rate);
    final FRANode fraNode = new FRANode(Tenor.SIX_MONTHS, Tenor.NINE_MONTHS, ExternalId.of(SCHEME, "Test"), "Mapper");
    final CurveNodeVisitor<InstrumentDefinition<?>> converter = new FRANodeConverter(CONVENTION_SOURCE, HOLIDAY_SOURCE, REGION_SOURCE,
        marketValues, marketDataId, NOW);
    fraNode.accept(converter);
  }

  @Test(expectedExceptions = OpenGammaRuntimeException.class)
  public void testWrongConventionForFRA() {
    final ExternalId marketDataId = ExternalId.of(SCHEME, "Data");
View Full Code Here

    final double rate = 0.0012345;
    marketValues.setDataPoint(marketDataId, rate);
    final FRANode fraNode = new FRANode(Tenor.SIX_MONTHS, Tenor.NINE_MONTHS, FIXED_LEG_ID, "Mapper");
    final CurveNodeVisitor<InstrumentDefinition<?>> converter = new FRANodeConverter(CONVENTION_SOURCE, HOLIDAY_SOURCE, REGION_SOURCE,
        marketValues, marketDataId, NOW);
    fraNode.accept(converter);
  }

  @Test(expectedExceptions = OpenGammaRuntimeException.class)
  public void testNoFutureConvention() {
    final ExternalId marketDataId = ExternalId.of(SCHEME, "Data");
View Full Code Here

    marketValues.setDataPoint(marketDataId, rate);
    final FRANode fraNode = new FRANode(Tenor.SIX_MONTHS, Tenor.NINE_MONTHS, LIBOR_3M_ID, "Mapper");
    final IborIndex index = new IborIndex(Currency.USD, Tenor.THREE_MONTHS.getPeriod(), 2, THIRTY_360, MODIFIED_FOLLOWING, false, LIBOR_3M_ID.getValue());
    final ZonedDateTime now = DateUtils.getUTCDate(2013, 3, 1);
    final CurveNodeVisitor<InstrumentDefinition<?>> converter = new FRANodeConverter(CONVENTION_SOURCE, HOLIDAY_SOURCE, REGION_SOURCE, marketValues, marketDataId, now);
    final InstrumentDefinition<?> definition = fraNode.accept(converter);
    assertTrue(definition instanceof ForwardRateAgreementDefinition);
    final ForwardRateAgreementDefinition fra = (ForwardRateAgreementDefinition) definition;
    final ForwardRateAgreementDefinition expectedFRA = ForwardRateAgreementDefinition.from(DateUtils.getUTCDate(2013, 9, 5), DateUtils.getUTCDate(2013, 12, 5), 1, index, rate, CALENDAR);
    assertEquals(expectedFRA, fra);
  }
View Full Code Here

  }

  @Test
  public void testFRA() {
    final FRANode fra = new FRANode(Tenor.ONE_DAY, Tenor.TWO_MONTHS, ExternalId.of("Test", "Test"), "Test");
    assertEquals(new CurveNodeWithIdentifier(fra, ExternalId.of("Test", "FRA"), "FRA Data", DataFieldType.OUTRIGHT), fra.accept(BUILDER));
  }

  @Test
  public void testFXForward() {
    final FXForwardNode fxForward = new FXForwardNode(Tenor.ONE_DAY, Tenor.TWO_MONTHS, ExternalId.of("Test1", "Test1"), Currency.USD, Currency.JPY, "Test");
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.