<commit_before>/**
 * Copyright (C) 2012 - present by OpenGamma Inc. and the OpenGamma group of companies
 *
 * Please see distribution for license.
 */
package com.opengamma.web.analytics.blotter;

import java.util.List;
import java.util.Map;

import org.threeten.bp.LocalDate;
import org.threeten.bp.LocalDateTime;
import org.threeten.bp.ZoneOffset;
import org.threeten.bp.ZonedDateTime;

import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Maps;
import com.opengamma.OpenGammaRuntimeException;
import com.opengamma.core.id.ExternalSchemes;
import com.opengamma.financial.convention.businessday.BusinessDayConventionFactory;
import com.opengamma.financial.convention.daycount.DayCountFactory;
import com.opengamma.financial.convention.frequency.SimpleFrequencyFactory;
import com.opengamma.financial.security.equity.EquityVarianceSwapSecurity;
import com.opengamma.financial.security.fx.FXForwardSecurity;
import com.opengamma.financial.security.option.EuropeanExerciseType;
import com.opengamma.financial.security.option.SwaptionSecurity;
import com.opengamma.financial.security.swap.FixedInterestRateLeg;
import com.opengamma.financial.security.swap.FloatingInterestRateLeg;
import com.opengamma.financial.security.swap.FloatingRateType;
import com.opengamma.financial.security.swap.InterestRateNotional;
import com.opengamma.financial.security.swap.SwapLeg;
import com.opengamma.financial.security.swap.SwapSecurity;
import com.opengamma.id.ExternalId;
import com.opengamma.util.money.Currency;
import com.opengamma.util.time.Expiry;

/* package */ class BlotterTestUtils {

  /* package */ static final FXForwardSecurity FX_FORWARD;
  /* package */ static final MapBeanDataSource FX_FORWARD_DATA_SOURCE;
  /* package */ static final SwapSecurity SWAP;
  /* package */ static final MapBeanDataSource SWAP_DATA_SOURCE;
  /* package */ static final SwaptionSecurity SWAPTION;
  /* package */ static final MapBeanDataSource SWAPTION_DATA_SOURCE;
  /* package */ static final EquityVarianceSwapSecurity EQUITY_VARIANCE_SWAP;
  /* package */ static final MapBeanDataSource EQUITY_VARIANCE_SWAP_DATA_SOURCE;

  static {
    ImmutableMap<String, String> attributes = ImmutableMap.of("attr1", "attrVal1", "attr2", "attrVal2");
    String forwardDateStr = "2012-12-21";
    FX_FORWARD_DATA_SOURCE = beanData(
        "name", "TODO",
        "externalIdBundle", "",
        "type", "FXForwardSecurity",
        "payCurrency", "USD",
        "payAmount", "150",
        "receiveCurrency", "GBP",
        "receiveAmount", "100",
        "forwardDate", forwardDateStr,
        "attributes", attributes);

    ZonedDateTime forwardDate = parseDate(forwardDateStr);
    ExternalId regionId = ExternalId.of(ExternalSchemes.FINANCIAL, "GB");
    FX_FORWARD = new FXForwardSecurity(Currency.USD, 150, Currency.GBP, 100, forwardDate, regionId);
    FX_FORWARD.setName("TODO");
    FX_FORWARD.setAttributes(attributes);

    //-------------------------------------

    String tradeDateStr = "2012-12-21";
    String effectiveDateStr = "2012-12-23";
    String maturityDateStr = "2013-12-21";
    SWAP_DATA_SOURCE = beanData(
        "externalIdBundle", "",
        "name", "TODO",
        "type", "SwapSecurity",
        "attributes", attributes,
        "counterparty", "Cpty",
        "tradeDate", tradeDateStr,
        "effectiveDate", effectiveDateStr,
        "maturityDate", maturityDateStr,
        "payLeg", beanData(
          "type", "FixedInterestRateLeg",
          "rate", "1.234",
          "businessDayConvention", "Modified Following",
          "dayCount", "Act/360",
          "frequency", "3m",
          "regionId", "123",
          "eom", "true",
          "notional", beanData(
            "type", "InterestRateNotional",
            "currency", "USD",
            "amount", "222.33")),
        "receiveLeg", beanData(
          "type", "FloatingInterestRateLeg",
          "floatingReferenceRateId", "Rate~123",
          "initialFloatingRate", "321.9",
          "floatingRateType", "IBOR",
          "settlementDays", "5",
          "offsetFixing", "1m",
          "businessDayConvention", "Following",
          "dayCount", "Act/Act",
          "frequency", "6m",<commit_msg>PLAT-3995 PLAT-3996 PLAT-4008 PLAT-4526 Fixed blotter test<commit_after>/**
 * Copyright (C) 2012 - present by OpenGamma Inc. and the OpenGamma group of companies
 *
 * Please see distribution for license.
 */
package com.opengamma.web.analytics.blotter;

import java.util.List;
import java.util.Map;

import org.threeten.bp.LocalDate;
import org.threeten.bp.LocalDateTime;
import org.threeten.bp.ZoneOffset;
import org.threeten.bp.ZonedDateTime;

import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Maps;
import com.opengamma.OpenGammaRuntimeException;
import com.opengamma.core.id.ExternalSchemes;
import com.opengamma.financial.convention.businessday.BusinessDayConventionFactory;
import com.opengamma.financial.convention.daycount.DayCountFactory;
import com.opengamma.financial.convention.frequency.SimpleFrequencyFactory;
import com.opengamma.financial.security.equity.EquityVarianceSwapSecurity;
import com.opengamma.financial.security.fx.FXForwardSecurity;
import com.opengamma.financial.security.option.EuropeanExerciseType;
import com.opengamma.financial.security.option.SwaptionSecurity;
import com.opengamma.financial.security.swap.FixedInterestRateLeg;
import com.opengamma.financial.security.swap.FloatingInterestRateLeg;
import com.opengamma.financial.security.swap.FloatingRateType;
import com.opengamma.financial.security.swap.InterestRateNotional;
import com.opengamma.financial.security.swap.SwapLeg;
import com.opengamma.financial.security.swap.SwapSecurity;
import com.opengamma.id.ExternalId;
import com.opengamma.util.money.Currency;
import com.opengamma.util.time.Expiry;

/* package */ class BlotterTestUtils {

  /* package */ static final FXForwardSecurity FX_FORWARD;
  /* package */ static final MapBeanDataSource FX_FORWARD_DATA_SOURCE;
  /* package */ static final SwapSecurity SWAP;
  /* package */ static final MapBeanDataSource SWAP_DATA_SOURCE;
  /* package */ static final SwaptionSecurity SWAPTION;
  /* package */ static final MapBeanDataSource SWAPTION_DATA_SOURCE;
  /* package */ static final EquityVarianceSwapSecurity EQUITY_VARIANCE_SWAP;
  /* package */ static final MapBeanDataSource EQUITY_VARIANCE_SWAP_DATA_SOURCE;

  static {
    ImmutableMap<String, String> attributes = ImmutableMap.of("attr1", "attrVal1", "attr2", "attrVal2");
    String forwardDateStr = "2012-12-21";
    FX_FORWARD_DATA_SOURCE = beanData(
        "name", "TODO",
        "externalIdBundle", "",
        "type", "FXForwardSecurity",
        "payCurrency", "USD",
        "payAmount", "150",
        "receiveCurrency", "GBP",
        "receiveAmount", "100",
        "forwardDate", forwardDateStr,
        "attributes", attributes);

    ZonedDateTime forwardDate = parseDate(forwardDateStr);
    ExternalId regionId = ExternalId.of(ExternalSchemes.FINANCIAL, "GB");
    FX_FORWARD = new FXForwardSecurity(Currency.USD, 150, Currency.GBP, 100, forwardDate, regionId);
    FX_FORWARD.setName("TODO");
    FX_FORWARD.setAttributes(attributes);

    //-------------------------------------

    String tradeDateStr = "2012-12-21";
    String effectiveDateStr = "2012-12-23";
    String maturityDateStr = "2013-12-21";
    SWAP_DATA_SOURCE = beanData(
        "externalIdBundle", "",
        "name", "TODO",
        "type", "SwapSecurity",
        "attributes", attributes,
        "counterparty", "Cpty",
        "tradeDate", tradeDateStr,
        "effectiveDate", effectiveDateStr,
        "maturityDate", maturityDateStr,
        "exchangeInitialNotional", "false",
        "exchangeFinalNotional", "false",
        "payLeg", beanData(
          "type", "FixedInterestRateLeg",
          "rate", "1.234",
          "businessDayConvention", "Modified Following",
          "dayCount", "Act/360",
          "frequency", "3m",
          "regionId", "123",
          "eom", "true",
          "notional", beanData(
            "type", "InterestRateNotional",
            "currency", "USD",
            "amount", "222.33")),
        "receiveLeg", beanData(
          "type", "FloatingInterestRateLeg",
          "floatingReferenceRateId", "Rate~123",
          "initialFloatingRate", "321.9",
          "floatingRateType", "IBOR",
          "settlementDays", "5",
          "offsetFixing", "1m",
          "businessDayConvention", "Following",
          "dayCount", "Act/Act",
          "frequency", "6m",
{'fraction_non_alphanumeric': 0.1289568975586964, 'fraction_numerical': 0.020091110851536035, 'mean_word_length': 3.6557911908646004, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5940280', 'n_tokens_mistral': 2770, 'n_tokens_neox': 2591, 'n_words': 477}