Package com.opengamma.financial.security.cds

Examples of com.opengamma.financial.security.cds.CreditDefaultSwapIndexSecurity


    assertEquals(ExternalId.of(SCHEME, "COMMODITY_FORWARD"), ids.get(0));
  }

  @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));
  }
View Full Code Here


    assertEquals(ExternalId.of(SCHEME, "COMMODITY_FORWARD_USD"), ids.get(0));
  }

  @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_EUR"), ids.get(0));
  }
View Full Code Here

    assertNull(ids);
  }

  @Test
  public void testCreditDefaultSwapIndexSecurity() {
    final CreditDefaultSwapIndexSecurity security = ExposureFunctionTestHelper.getCreditDefaultSwapIndexSecurity();
    final List<ExternalId> ids = security.accept(EXPOSURE_FUNCTION);
    assertNull(ids);
  }
View Full Code Here

    assertEquals(ExternalId.of(SCHEME, "USD"), ids.get(0));
  }

  @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, "EUR"), ids.get(0));
  }
View Full Code Here

    return security;
  }

  public static CreditDefaultSwapIndexSecurity getCreditDefaultSwapIndexSecurity() {
    final UniqueId underlyingId = getCreditDefaultSwapIndexDefinitionSecurity().getUniqueId();
    final CreditDefaultSwapIndexSecurity security = new CreditDefaultSwapIndexSecurity(false, ExternalId.of("Test", "A"), ExternalId.of("Test", "B"), ExternalId.of(underlyingId.getScheme(), underlyingId.getValue()),
        DateUtils.getUTCDate(2013, 1, 1), DateUtils.getUTCDate(2013, 1, 1), DateUtils.getUTCDate(2023, 1, 1), StubType.LONG_END, PeriodFrequency.SEMI_ANNUAL, DC, BDC,
        false, false, false, new InterestRateNotional(EUR, 1000), true, false, DateUtils.getUTCDate(2013, 1, 1), false, new InterestRateNotional(EUR, 1), 0.02);
    security.setUniqueId(UniqueId.of(UniqueId.EXTERNAL_SCHEME.getName(), "23165"));
    return security;
  }
View Full Code Here

      final String redCode = ((CreditDefaultSwapSecurity) underlying).getReferenceEntity().getValue();
      final Organization organisation = _organizationSource.getOrganizationByRedCode(redCode);
      return organisation.getObligor().getObligorShortName();

    } else if (security instanceof CreditDefaultSwapIndexSecurity) {
      final CreditDefaultSwapIndexSecurity cdsIndex = (CreditDefaultSwapIndexSecurity) security;
      final CreditDefaultSwapIndexDefinitionSecurity definition = (CreditDefaultSwapIndexDefinitionSecurity) _securitySource.getSingle(ExternalIdBundle.of(cdsIndex.getReferenceEntity()));
      return definition.getName();
    } else if (security instanceof CreditDefaultSwapSecurity) {
      final AbstractCreditDefaultSwapSecurity cds = (AbstractCreditDefaultSwapSecurity) security;
      final String redCode = cds.getReferenceEntity().getValue();
      final Organization organisation = _organizationSource.getOrganizationByRedCode(redCode);
View Full Code Here

    assertNull(ids);
  }

  @Test
  public void testCreditDefaultSwapIndexSecurity() {
    final CreditDefaultSwapIndexSecurity security = ExposureFunctionTestHelper.getCreditDefaultSwapIndexSecurity();
    final List<ExternalId> ids = security.accept(EXPOSURE_FUNCTION);
    assertNull(ids);
  }
View Full Code Here

    assertNull(ids);
  }

  @Test
  public void testCreditDefaultSwapIndexSecurity() {
    final CreditDefaultSwapIndexSecurity security = ExposureFunctionTestHelper.getCreditDefaultSwapIndexSecurity();
    final List<ExternalId> ids = security.accept(EXPOSURE_FUNCTION);
    assertNull(ids);
  }
View Full Code Here

  @Override
  public CreditDefaultSwapIndexSecurity createSecurity(OperationContext context,
                                                       CreditDefaultSwapIndexSecurityBean bean) {

    return new CreditDefaultSwapIndexSecurity(
        bean.getBuy(), externalIdBeanToExternalId(bean.getProtectionBuyer()), externalIdBeanToExternalId(bean.getProtectionSeller()),
        externalIdBeanToExternalId(bean.getIndex()), zonedDateTimeBeanToDateTimeWithZone(bean.getStartDate()),
        zonedDateTimeBeanToDateTimeWithZone(bean.getEffectiveDate()), zonedDateTimeBeanToDateTimeWithZone(bean.getMaturityDate()),
        stubTypeBeanToStubType(bean.getStubType()), frequencyBeanToFrequency(bean.getCouponFrequency()),
        dayCountBeanToDayCount(bean.getDayCount()), businessDayConventionBeanToBusinessDayConvention(bean.getBusinessDayConvention()),
View Full Code Here

    assertEquals(ExternalId.of(security.getUniqueId().getScheme(), security.getUniqueId().getValue()), ids.get(0));
  }

  @Test
  public void testCreditDefaultSwapIndexSecurity() {
    final CreditDefaultSwapIndexSecurity security = ExposureFunctionTestHelper.getCreditDefaultSwapIndexSecurity();
    final List<ExternalId> ids = security.accept(EXPOSURE_FUNCTION);
    assertEquals(1, ids.size());
    assertEquals(ExternalId.of(security.getUniqueId().getScheme(), security.getUniqueId().getValue()), ids.get(0));
  }
View Full Code Here

TOP

Related Classes of com.opengamma.financial.security.cds.CreditDefaultSwapIndexSecurity

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.