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

Examples of com.opengamma.financial.analytics.ircurve.strips.CreditSpreadNode$Meta


    assertEquals(node, cycleObject(ContinuouslyCompoundedRateNode.class, node));
  }

  @Test
  public void testCreditCurveNodeBuilder() {
    CreditSpreadNode node = new CreditSpreadNode("TEST", Tenor.EIGHT_MONTHS);
    assertEquals(node, cycleObject(CreditSpreadNode.class, node));
    node = new CreditSpreadNode("TEST", Tenor.EIGHT_MONTHS, null);
    assertEquals(node, cycleObject(CreditSpreadNode.class, node));
    node = new CreditSpreadNode("TEST", Tenor.EIGHT_MONTHS, "Name");
    assertEquals(node, cycleObject(CreditSpreadNode.class, node));
  }
View Full Code Here


    assertEquals(node, cycleObject(ZeroCouponInflationNode.class, node));
  }

  @Test
  public void testCurveNodeWithIdentifiers() {
    final CreditSpreadNode node = new CreditSpreadNode("TEST", Tenor.EIGHT_YEARS);
    final CurveNodeWithIdentifier nodeWithId = new CurveNodeWithIdentifier(node, ExternalSchemes.bloombergTickerSecurityId("AAA"), "Market_Close", DataFieldType.OUTRIGHT);
    assertEquals(nodeWithId, cycleObject(CurveNodeWithIdentifier.class, nodeWithId));
  }
View Full Code Here

    assertNull(node.accept(VISITOR));
  }

  @Test
  public void testCreditSpreadNode() {
    final CreditSpreadNode node = new CreditSpreadNode(SCHEME, Tenor.THREE_MONTHS);
    assertNull(node.accept(VISITOR));
  }
View Full Code Here

    assertEquals(new CurveNodeWithIdentifier(rate, ExternalId.of("Test", "Rate"), "CC Rate Data", DataFieldType.POINTS), rate.accept(BUILDER));
  }

  @Test
  public void testCreditSpread() {
    final CreditSpreadNode creditSpread = new CreditSpreadNode("Test", Tenor.TWO_MONTHS);
    assertEquals(new CurveNodeWithIdentifier(creditSpread, ExternalId.of("Test", "Credit spread"), "Credit Data", DataFieldType.OUTRIGHT), creditSpread.accept(BUILDER));
  }
View Full Code Here

    public CreditSpreadNode buildObject(final FudgeDeserializer deserializer, final FudgeMsg message) {
      final String curveNodeIdMapperName = message.getString(CURVE_MAPPER_ID_FIELD);
      final Tenor tenor = deserializer.fieldValueToObject(Tenor.class, message.getByName(TENOR_FIELD));
      if (message.hasField(NAME_FIELD)) {
        final String name = message.getString(NAME_FIELD);
        return new CreditSpreadNode(curveNodeIdMapperName, tenor, name);
      }
      return new CreditSpreadNode(curveNodeIdMapperName, tenor);
    }
View Full Code Here

   * Tests the construction of curve definitions.
   */
  @Test
  public void testCurveDefinition() {
    final Set<CurveNode> nodes = new TreeSet<>();
    nodes.add(new CreditSpreadNode("X", Tenor.DAY));
    nodes.add(new CreditSpreadNode("X", Tenor.EIGHT_YEARS));
    nodes.add(new CreditSpreadNode("Y", Tenor.ONE_MONTH));
    CurveDefinition definition = new CurveDefinition("NAME", nodes);
    assertEquals(definition, cycleObject(CurveDefinition.class, definition));
    definition = new CurveDefinition("NAME", nodes);
    definition.setUniqueId(UniqueId.of("test", "id"));
    assertEquals(definition, cycleObject(CurveDefinition.class, definition));
View Full Code Here

TOP

Related Classes of com.opengamma.financial.analytics.ircurve.strips.CreditSpreadNode$Meta

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.