Examples of accept()


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

  }

  @Test
  public void testFXForwardNode() {
    final FXForwardNode node = new FXForwardNode(Tenor.ONE_DAY, Tenor.ONE_YEAR, FX_FORWARD_ID, Currency.EUR, Currency.AUD, SCHEME);
    final Set<Currency> currencies = node.accept(VISITOR);
    assertEquals(2, currencies.size());
    assertEquals(Sets.newHashSet(Currency.EUR, Currency.AUD), currencies);
  }

  @Test
View Full Code Here

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

  }

  @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);
    node.accept(EMPTY_CONVENTIONS);
  }

  @Test(expectedExceptions = OpenGammaRuntimeException.class)
  public void testNullRateFutureUnderlyingConvention() {
    final Map<ExternalId, Convention> map = new HashMap<>();
View Full Code Here

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

  }

  @Test(expectedExceptions = OpenGammaRuntimeException.class)
  public void testNullSwapPayConvention() {
    final SwapNode node = new SwapNode(Tenor.ONE_DAY, Tenor.TEN_YEARS, FIXED_LEG_ID, SWAP_3M_IBOR_ID, SCHEME);
    node.accept(EMPTY_CONVENTIONS);
  }

  @Test(expectedExceptions = OpenGammaRuntimeException.class)
  public void testNullSwapReceiveConvention() {
    final Map<ExternalId, Convention> map = new HashMap<>();
View Full Code Here

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

  }

  @Test(expectedExceptions = OpenGammaRuntimeException.class)
  public void testNullZeroCouponInflationConvention() {
    final ZeroCouponInflationNode node = new ZeroCouponInflationNode(Tenor.EIGHT_MONTHS, ZERO_COUPON_INFLATION_ID, FIXED_LEG_ID, InflationNodeType.INTERPOLATED, "TEST");
    node.accept(EMPTY_CONVENTIONS);
  }

  @Test(expectedExceptions = OpenGammaRuntimeException.class)
  public void testNullPriceIndexConvention() {
    final Map<ExternalId, Convention> map = new HashMap<>();
View Full Code Here

Examples of com.opengamma.financial.security.FinancialSecurity.accept()

      FinancialSecurityVisitor<Double> visitorAdapter = FinancialSecurityVisitorAdapter.<Double>builder()
        .equitySecurityVisitor(_equitySecurityVisitor)
        .equityOptionVisitor(_equityOptionSecurityVisitor)
        .create();
      FinancialSecurity security = (FinancialSecurity) position.getSecurityLink().resolve(_secSource);
      Double currMarketCap = security.accept(visitorAdapter);
      String classification = getCurrentMarketCapCategory(currMarketCap);
      return classification == null ? NO_CUR_MKT_CAP : classification;
    }
  }
View Full Code Here

Examples of com.opengamma.financial.security.bond.BondSecurity.accept()

  public BondFixedTransactionDefinition convert(final Trade trade) {
    Validate.notNull(trade, "trade");
    Validate.isTrue(trade.getSecurity() instanceof BondSecurity, "Can only handle trades with security type BondSecurity");
    final BondSecurity security = (BondSecurity) trade.getSecurity();
    final InstrumentDefinition<?> underlying = security.accept(_securityConverter);
    if (!(underlying instanceof BondFixedSecurityDefinition)) {
      throw new OpenGammaRuntimeException("Can only handle fixed coupon bonds");
    }
    final BondFixedSecurityDefinition bond = (BondFixedSecurityDefinition) underlying;
    final int quantity = trade.getQuantity().intValue(); // MH - 9-May-2013: changed from 1. // REVIEW: The quantity mechanism should be reviewed.
View Full Code Here

Examples of com.opengamma.financial.security.bond.CorporateBondSecurity.accept()

  }

  @Test
  public void testCorporateBondSecurity() {
    final CorporateBondSecurity security = ExposureFunctionTestHelper.getCorporateBondSecurity();
    final List<ExternalId> ids = security.accept(EXPOSURE_FUNCTION);
    assertEquals(1, ids.size());
    assertEquals(ExternalId.of(SCHEME, "BOND"), ids.get(0));
  }

  @Test
View Full Code Here

Examples of com.opengamma.financial.security.bond.GovernmentBondSecurity.accept()

  }

  @Test
  public void testGovernmentBondSecurity() {
    final GovernmentBondSecurity security = ExposureFunctionTestHelper.getGovernmentBondSecurity();
    final List<ExternalId> ids = security.accept(EXPOSURE_FUNCTION);
    assertEquals(1, ids.size());
    assertEquals(ExternalId.of(SCHEME, "BOND"), ids.get(0));
  }

  @Test
View Full Code Here

Examples of com.opengamma.financial.security.bond.MunicipalBondSecurity.accept()

  }

  @Test
  public void testMunicipalBondSecurity() {
    final MunicipalBondSecurity security = ExposureFunctionTestHelper.getMunicipalBondSecurity();
    final List<ExternalId> ids = security.accept(EXPOSURE_FUNCTION);
    assertEquals(1, ids.size());
    assertEquals(ExternalId.of(SCHEME, "BOND"), ids.get(0));
  }

  @Test
View Full Code Here

Examples of com.opengamma.financial.security.capfloor.CapFloorCMSSpreadSecurity.accept()

  }

  @Test
  public void testCapFloorCMSSpreadSecurity() {
    final CapFloorCMSSpreadSecurity security = ExposureFunctionTestHelper.getCapFloorCMSSpreadSecurity();
    final List<ExternalId> ids = security.accept(EXPOSURE_FUNCTION);
    assertEquals(1, ids.size());
    assertEquals(ExternalId.of(SCHEME, "CAP-FLOOR CMS SPREAD"), ids.get(0));
  }

  @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.