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

import static org.testng.AssertJUnit.assertEquals;

import java.util.HashMap;
import java.util.Map;

import org.testng.annotations.Test;

import com.opengamma.financial.analytics.volatility.cube.VolatilityDeltaCubeData;
import com.opengamma.util.time.Tenor;
import com.opengamma.util.tuple.Triple;

/**
 * 
 */
public class VolatilityDeltaCubeDataBuilderTest extends AnalyticsTestBase {
  private static final Object[] SWAP_TENORS = new Tenor[] {Tenor.SIX_MONTHS, Tenor.ONE_YEAR, Tenor.FIVE_YEARS };
  private static final Object[] SWAPTION_EXPIRY = new Tenor[] {Tenor.THREE_MONTHS, Tenor.FOUR_MONTHS, Tenor.FIVE_MONTHS, Tenor.SEVEN_MONTHS };
  private static final Object[] DELTAS = new Double[] {0.15, 0.2, 0.5, 0.75, 0.9 };
  private static final VolatilityDeltaCubeData<Object, Object, Object> DATA;

  static {
    final Map<Triple<Object, Object, Object>, Double> data = new HashMap<Triple<Object, Object, Object>, Double>();
    for (final Object element : SWAP_TENORS) {
      for (final Object element2 : SWAPTION_EXPIRY) {
        for (final Object element3 : DELTAS) {
          final Triple<Object, Object, Object> coordinate = Triple.of(element, element2, element3);
          final double vol = Math.random();
          data.put(coordinate, vol);
        }
      }
    }
    DATA = new VolatilityDeltaCubeData<Object, Object, Object>(data);
  }

  @Test
  public void test() {
    @SuppressWarnings("unchecked")
    final VolatilityDeltaCubeData<Object, Object, Object> cycled = cycleObject(VolatilityDeltaCubeData.class, DATA);
    assertEquals(cycled, DATA);
  }
}<commit_msg>Adding a test for the swaption volatility cube builder<commit_after>/**
 * Copyright (C) 2012 - present by OpenGamma Inc. and the OpenGamma group of companies
 * 
 * Please see distribution for license.
 */
package com.opengamma.financial.analytics.fudgemsg;

import static org.testng.AssertJUnit.assertEquals;

import java.util.HashMap;
import java.util.Map;

import org.testng.annotations.Test;

import com.opengamma.financial.analytics.volatility.cube.SwaptionVolatilityCubeData;
import com.opengamma.util.time.Tenor;
import com.opengamma.util.tuple.Triple;

/**
 * 
 */
public class SwaptionVolatilityCubeDataBuilderTest extends AnalyticsTestBase {
  private static final Object[] SWAP_TENORS = new Tenor[] {Tenor.SIX_MONTHS, Tenor.ONE_YEAR, Tenor.FIVE_YEARS };
  private static final Object[] SWAPTION_EXPIRY = new Tenor[] {Tenor.THREE_MONTHS, Tenor.FOUR_MONTHS, Tenor.FIVE_MONTHS, Tenor.SEVEN_MONTHS };
  private static final Object[] DELTAS = new Double[] {0.15, 0.2, 0.5, 0.75, 0.9 };
  private static final SwaptionVolatilityCubeData<Object, Object, Object> DATA;

  static {
    final Map<Triple<Object, Object, Object>, Double> data = new HashMap<Triple<Object, Object, Object>, Double>();
    for (final Object element : SWAP_TENORS) {
      for (final Object element2 : SWAPTION_EXPIRY) {
        for (final Object element3 : DELTAS) {
          final Triple<Object, Object, Object> coordinate = Triple.of(element, element2, element3);
          final double vol = Math.random();
          data.put(coordinate, vol);
        }
      }
    }
    DATA = new SwaptionVolatilityCubeData<Object, Object, Object>(data);
  }

  @Test
  public void test() {
    @SuppressWarnings("unchecked")
    final SwaptionVolatilityCubeData<Object, Object, Object> cycled = cycleObject(SwaptionVolatilityCubeData.class, DATA);
    assertEquals(cycled, DATA);
  }
}
{'fraction_non_alphanumeric': 0.10828547990155865, 'fraction_numerical': 0.010937927262783703, 'mean_word_length': 4.248206599713056, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, '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': '4946402', 'n_tokens_mistral': 1232, 'n_tokens_neox': 1181, 'n_words': 290}