Examples of accept()


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

  }

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

  @Test
View Full Code Here

Examples of com.opengamma.financial.security.cash.CashSecurity.accept()

  }

  @Test
  public void testCashSecurity() {
    final CashSecurity cash = ExposureFunctionTestHelper.getCashSecurity();
    final List<ExternalId> ids = cash.accept(EXPOSURE_FUNCTION);
    assertEquals(1, ids.size());
    assertEquals(ExternalId.of(SCHEME, "CASH"), ids.get(0));
  }

  @Test
View Full Code Here

Examples of com.opengamma.financial.security.cashflow.CashFlowSecurity.accept()

  }

  @Test
  public void testCashFlowSecurity() {
    final CashFlowSecurity security = ExposureFunctionTestHelper.getCashFlowSecurity();
    final List<ExternalId> ids = security.accept(EXPOSURE_FUNCTION);
    assertEquals(1, ids.size());
    assertEquals(ExternalId.of(SCHEME, "CASHFLOW"), ids.get(0));
  }

  @Test
View Full Code Here

Examples of com.opengamma.financial.security.cds.CDSSecurity.accept()

    final HolidaySource holidaySource = OpenGammaExecutionContext.getHolidaySource(executionContext);
    final ISDACDSSecurityConverter converter = new ISDACDSSecurityConverter(holidaySource);

    // Security being priced
    final CDSSecurity cds = (CDSSecurity) target.getSecurity();
    final ISDACDSDefinition cdsDefinition = (ISDACDSDefinition) cds.accept(converter);

    // Time point to price for
    // TODO: Supply an option for the user to specify non-standard step-in and settlement dates
    final ZonedDateTime pricingDate = ZonedDateTime.now(executionContext.getValuationClock());
    final ZonedDateTime stepinDate = pricingDate.plusDays(1);
View Full Code Here

Examples of com.opengamma.financial.security.cds.CreditDefaultSwapIndexSecurity.accept()

  }

  @Test
  public void testCreditDefaultSwapIndexSecurity() {
    final CreditDefaultSwapIndexSecurity security = ExposureFunctionTestHelper.getCreditDefaultSwapIndexSecurity();
    final List<ExternalId> ids = security.accept(EXPOSURE_FUNCTION);
    assertEquals(1, ids.size());
    assertEquals(ExternalId.of(SCHEME, "CDS_INDEX"), ids.get(0));
  }

  @Test
View Full Code Here

Examples of com.opengamma.financial.security.cds.CreditDefaultSwapSecurity.accept()

    OrganizationSource organizationSource = OpenGammaExecutionContext.getOrganizationSource(executionContext);
    final CreditDefaultSwapSecurityConverter converter = new CreditDefaultSwapSecurityConverter(holidaySource, regionSource, organizationSource);
    final ZonedDateTime valuationTime = ZonedDateTime.now(executionContext.getValuationClock());
    final CreditDefaultSwapSecurity security = (CreditDefaultSwapSecurity) target.getSecurity();
    final Calendar calendar = new HolidaySourceCalendarAdapter(holidaySource, FinancialSecurityUtils.getCurrency(security));
    final CdsRecoveryRateIdentifier recoveryRateIdentifier = security.accept(new CreditSecurityToRecoveryRateVisitor(securitySource));
    Object recoveryRateObject = inputs.getValue(new ValueRequirement(MarketDataRequirementNames.MARKET_VALUE, ComputationTargetType.PRIMITIVE, recoveryRateIdentifier.getExternalId()));
    if (recoveryRateObject == null) {
      throw new OpenGammaRuntimeException("Could not get recovery rate");
      //s_logger.warn("Could not get recovery rate, defaulting to 0.4: " + recoveryRateIdentifier);
      //recoveryRateObject = 0.4;
View Full Code Here

Examples of com.opengamma.financial.security.cds.LegacyFixedRecoveryCDSSecurity.accept()

  }

  @Test
  public void testLegacyFixedRecoveryCDSSecurity() {
    final LegacyFixedRecoveryCDSSecurity security = ExposureFunctionTestHelper.getLegacyFixedRecoveryCDSSecurity();
    final List<ExternalId> ids = security.accept(EXPOSURE_FUNCTION);
    assertEquals(1, ids.size());
    assertEquals(ExternalId.of(SCHEME, "LEGACY_FIXED_RECOVERY_CDS"), ids.get(0));
  }

  @Test
View Full Code Here

Examples of com.opengamma.financial.security.cds.LegacyRecoveryLockCDSSecurity.accept()

  }

  @Test
  public void testLegacyRecoveryLockCDSSecurity() {
    final LegacyRecoveryLockCDSSecurity security = ExposureFunctionTestHelper.getLegacyRecoveryLockCDSSecurity();
    final List<ExternalId> ids = security.accept(EXPOSURE_FUNCTION);
    assertEquals(1, ids.size());
    assertEquals(ExternalId.of(SCHEME, "LEGACY_RECOVERY_LOCK_CDS"), ids.get(0));
  }

  @Test
View Full Code Here

Examples of com.opengamma.financial.security.cds.LegacyVanillaCDSSecurity.accept()

  }

  @Test
  public void testLegacyVanillaCDSSecurity() {
    final LegacyVanillaCDSSecurity security = ExposureFunctionTestHelper.getLegacyVanillaCDSSecurity();
    final List<ExternalId> ids = security.accept(EXPOSURE_FUNCTION);
    assertEquals(1, ids.size());
    assertEquals(ExternalId.of(SCHEME, "LEGACY_VANILLA_CDS"), ids.get(0));
  }

  @Test
View Full Code Here

Examples of com.opengamma.financial.security.cds.StandardFixedRecoveryCDSSecurity.accept()

  }

  @Test
  public void testStandardFixedRecoveryCDSSecurity() {
    final StandardFixedRecoveryCDSSecurity security = ExposureFunctionTestHelper.getStandardFixedRecoveryCDSSecurity();
    final List<ExternalId> ids = security.accept(EXPOSURE_FUNCTION);
    assertEquals(1, ids.size());
    assertEquals(ExternalId.of(SCHEME, "STANDARD_FIXED_RECOVERY_CDS"), 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.