Examples of ZeroCouponInflationNode


Examples of com.opengamma.financial.analytics.ircurve.strips.ZeroCouponInflationNode

      final ExternalId fixedConvention = deserializer.fieldValueToObject(ExternalId.class, message.getByName(FIXED_CONVENTION_FIELD));
      final InflationNodeType inflationNodeType = InflationNodeType.valueOf(message.getString(INFLATION_NODE_TYPE_FIELD));
      final String curveNodeIdMapperName = message.getString(CURVE_MAPPER_ID_FIELD);
      if (message.hasField(NAME_FIELD)) {
        final String name = message.getString(NAME_FIELD);
        return new ZeroCouponInflationNode(tenor, inflationConvention, fixedConvention, inflationNodeType, curveNodeIdMapperName, name);
      }
      return new ZeroCouponInflationNode(tenor, inflationConvention, fixedConvention, inflationNodeType, curveNodeIdMapperName);
    }
View Full Code Here

Examples of com.opengamma.financial.analytics.ircurve.strips.ZeroCouponInflationNode

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

  @Test
  public void testZeroCouponInflationNodeBuilder() {
    ZeroCouponInflationNode node = new ZeroCouponInflationNode(Tenor.EIGHT_MONTHS, ExternalId.of("convention", "CPI"), ExternalId.of("convention", "Fixed"), InflationNodeType.MONTHLY, "TEST");
    assertEquals(node, cycleObject(ZeroCouponInflationNode.class, node));
    node = new ZeroCouponInflationNode(Tenor.EIGHT_MONTHS, ExternalId.of("convention", "CPI"), ExternalId.of("convention", "Fixed"), InflationNodeType.MONTHLY, "TEST", null);
    assertEquals(node, cycleObject(ZeroCouponInflationNode.class, node));
    node = new ZeroCouponInflationNode(Tenor.EIGHT_MONTHS, ExternalId.of("convention", "CPI"), ExternalId.of("convention", "Fixed"), InflationNodeType.MONTHLY, "TEST", "Name");
    assertEquals(node, cycleObject(ZeroCouponInflationNode.class, node));
  }
View Full Code Here

Examples of com.opengamma.financial.analytics.ircurve.strips.ZeroCouponInflationNode

        } else {
          s_logger.info("Couldn't get time series for {}", id);
        }
      }
      if (node.getCurveNode() instanceof ZeroCouponInflationNode) {
        final ZeroCouponInflationNode inflationNode = (ZeroCouponInflationNode) node.getCurveNode();
        final ConventionSource conventionSource = OpenGammaExecutionContext.getConventionSource(executionContext);
        Convention convention = conventionSource.getConvention(inflationNode.getInflationLegConvention());
        if (convention == null) {
          throw new OpenGammaRuntimeException("Convention with id " + inflationNode.getInflationLegConvention() + " was null");
        }
        if (!(convention instanceof InflationLegConvention)) {
          throw new OpenGammaRuntimeException("Cannot handle convention type " + convention.getClass());
        }
        final InflationLegConvention inflationLegConvention = (InflationLegConvention) convention;
View Full Code Here

Examples of com.opengamma.financial.analytics.ircurve.strips.ZeroCouponInflationNode

            } else {
              s_logger.info("Could not get historical time series for {}", ids);
            }
          }
          if (node.getCurveNode() instanceof ZeroCouponInflationNode) {
            final ZeroCouponInflationNode inflationNode = (ZeroCouponInflationNode) node.getCurveNode();
            final ConventionSource conventionSource = OpenGammaExecutionContext.getConventionSource(executionContext);
            Convention convention = conventionSource.getConvention(inflationNode.getInflationLegConvention());
            if (convention == null) {
              throw new OpenGammaRuntimeException("Convention with id " + inflationNode.getInflationLegConvention() + " was null");
            }
            if (!(convention instanceof InflationLegConvention)) {
              throw new OpenGammaRuntimeException("Cannot handle convention type " + convention.getClass());
            }
            final InflationLegConvention inflationLegConvention = (InflationLegConvention) convention;
View Full Code Here

Examples of com.opengamma.financial.analytics.ircurve.strips.ZeroCouponInflationNode

    node.accept(visitor);
  }

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

Examples of com.opengamma.financial.analytics.ircurve.strips.ZeroCouponInflationNode

  @Test(expectedExceptions = OpenGammaRuntimeException.class)
  public void testNullPriceIndexConvention() {
    final Map<ExternalId, Convention> map = new HashMap<>();
    map.put(ZERO_COUPON_INFLATION_ID, INFLATION_LEG);
    final CurveNodeCurrencyVisitor visitor = new CurveNodeCurrencyVisitor(new TestConventionSource(map));
    final ZeroCouponInflationNode node = new ZeroCouponInflationNode(Tenor.EIGHT_MONTHS, ZERO_COUPON_INFLATION_ID, FIXED_LEG_ID, InflationNodeType.MONTHLY, "TEST");
    node.accept(visitor);
  }
View Full Code Here

Examples of com.opengamma.financial.analytics.ircurve.strips.ZeroCouponInflationNode

    node.accept(visitor);
  }

  @Test(expectedExceptions = OpenGammaRuntimeException.class)
  public void testWrongTypeZeroCouponInflationConvention() {
    final ZeroCouponInflationNode node = new ZeroCouponInflationNode(Tenor.EIGHT_MONTHS, SWAP_3M_IBOR_ID, FIXED_LEG_ID, InflationNodeType.INTERPOLATED, "TEST");
    node.accept(VISITOR);
  }
View Full Code Here

Examples of com.opengamma.financial.analytics.ircurve.strips.ZeroCouponInflationNode

    assertEquals(Sets.newHashSet(Currency.EUR, Currency.USD), currencies);
  }

  @Test
  public void testZeroCouponInflationNode() {
    final ZeroCouponInflationNode node = new ZeroCouponInflationNode(Tenor.EIGHT_MONTHS, ZERO_COUPON_INFLATION_ID, FIXED_LEG_ID, InflationNodeType.INTERPOLATED, "TEST");
    final Set<Currency> currencies = node.accept(VISITOR);
    assertEquals(1, currencies.size());
    assertEquals(Currency.USD, currencies.iterator().next());
  }
View Full Code Here

Examples of com.opengamma.financial.analytics.ircurve.strips.ZeroCouponInflationNode

    assertEquals(new CurveNodeWithIdentifier(swap, ExternalId.of("Test", "Swap"), "Swap Data", DataFieldType.POINTS), swap.accept(BUILDER));
  }

  @Test
  public void testZeroCouponInflation() {
    final ZeroCouponInflationNode node = new ZeroCouponInflationNode(Tenor.TWO_MONTHS, ExternalId.of("Test", "Test"), ExternalId.of("Test", "Test"), InflationNodeType.MONTHLY, "Test");
    assertEquals(new CurveNodeWithIdentifier(node, ExternalId.of("Test", "ZCI"), "ZC Data", DataFieldType.OUTRIGHT), node.accept(BUILDER));
  }
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.