<commit_before>package org.mwc.debrief.scripting.wrappers;

import org.eclipse.ease.modules.WrapToScript;

import MWC.GenericData.WorldArea;
import MWC.GenericData.WorldDistance;
import MWC.GenericData.WorldLocation;
import MWC.GenericData.WorldSpeed;
import MWC.GenericData.WorldVector;
import junit.framework.TestCase;

/**
 * generic position related elements
 * 
 * @author ian
 *
 */
public class Spatial
{

  public static class TestSpatial extends TestCase
  {

    static final double testDouble = 4.5;

    static final double testDouble2 = 7.3;

    static final double testDouble3 = 2.0;

    static final int testInt = WorldSpeed.Kts;

    static final WorldLocation w1 = new WorldLocation(12, 12, 0);

    static final WorldLocation w2 = new WorldLocation(10, 10, 100);
    static final WorldArea wa1 = new WorldArea(w1, w2);

    public void testCreateArea()
    {
      final WorldArea ww1 = new WorldArea(w1, w2);
      final WorldArea ww2 = new WorldArea(wa1);
      assertEquals("constructor worked", ww1.equals(wa1), true);
      assertEquals("constructor worked", ww2.equals(wa1), true);
    }

    public void testCreateDistance()
    {
      final WorldDistance distance = createDistance(testDouble, testInt);
      assertEquals("Same units for WorldDistance", testInt, distance
          .getUnits());
      assertEquals("Same value for WorldDistance", testDouble, distance
          .getValueIn(testInt), 1e-5);
    }

    public void testCreateLocation()
    {
      final WorldLocation location = createLocation(testDouble, testDouble2,
          testDouble3);
      assertEquals("Same value for lattitude", testDouble, location.getLat(),
          1e-5);
      assertEquals("Same value for longitud", testDouble2, location.getLong(),
          1e-5);
      assertEquals("Same value for depth", testDouble3, location.getDepth(),
          1e-5);
    }

    public void testCreateVector()
    {
      // TODO
    }

    public void testCreateVectorKm()
    {
      /*
       * WorldVector vectorKM = createVectorKm(testDouble, testDouble2);
       * assertEquals("Same value for vectorKM", testDouble, vectorKM.getRange(), 1e-5);
       * assertEquals("Same value for vectorKM", testDouble2, vectorKM .getBearing(), 1e-5);
       */
      // TODO
    }

    public void testCreateWorldSpeed()
    {
      final WorldSpeed worldSpeed = createWorldSpeed(testDouble, testInt);
      assertEquals("Same units for worldSpeed", testInt, worldSpeed.getUnits());
      assertEquals("Same value for worldSpeed", testDouble, worldSpeed
          .getValueIn(testInt), 1e-5);
    }
  }

  /**
   * the units for distances. Note to provide these to ease, we have to add a @WrapToScript<commit_msg>Remove unnecessary tests<commit_after>package org.mwc.debrief.scripting.wrappers;

import org.eclipse.ease.modules.WrapToScript;

import MWC.GenericData.WorldArea;
import MWC.GenericData.WorldDistance;
import MWC.GenericData.WorldLocation;
import MWC.GenericData.WorldSpeed;
import MWC.GenericData.WorldVector;
import junit.framework.TestCase;

/**
 * generic position related elements
 * 
 * @author ian
 *
 */
public class Spatial
{

  public static class TestSpatial extends TestCase
  {

    static final double testDouble = 4.5;

    static final double testDouble2 = 7.3;

    static final double testDouble3 = 2.0;

    static final int testInt = WorldSpeed.Kts;

    static final WorldLocation w1 = new WorldLocation(12, 12, 0);

    static final WorldLocation w2 = new WorldLocation(10, 10, 100);
    static final WorldArea wa1 = new WorldArea(w1, w2);

    public void testCreateArea()
    {
      final WorldArea ww1 = new WorldArea(w1, w2);
      final WorldArea ww2 = new WorldArea(wa1);
      assertEquals("constructor worked", ww1.equals(wa1), true);
      assertEquals("constructor worked", ww2.equals(wa1), true);
    }

    public void testCreateDistance()
    {
      final WorldDistance distance = createDistance(testDouble, testInt);
      assertEquals("Same units for WorldDistance", testInt, distance
          .getUnits());
      assertEquals("Same value for WorldDistance", testDouble, distance
          .getValueIn(testInt), 1e-5);
    }

    public void testCreateLocation()
    {
      final WorldLocation location = createLocation(testDouble, testDouble2,
          testDouble3);
      assertEquals("Same value for lattitude", testDouble, location.getLat(),
          1e-5);
      assertEquals("Same value for longitud", testDouble2, location.getLong(),
          1e-5);
      assertEquals("Same value for depth", testDouble3, location.getDepth(),
          1e-5);
    }

    public void testCreateWorldSpeed()
    {
      final WorldSpeed worldSpeed = createWorldSpeed(testDouble, testInt);
      assertEquals("Same units for worldSpeed", testInt, worldSpeed.getUnits());
      assertEquals("Same value for worldSpeed", testDouble, worldSpeed
          .getValueIn(testInt), 1e-5);
    }
  }

  /**
   * the units for distances. Note to provide these to ease, we have to add a @WrapToScript
{'fraction_non_alphanumeric': 0.09739614390777182, 'fraction_numerical': 0.020274299344066785, 'mean_word_length': 3.3156089193825045, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6819089', 'n_tokens_mistral': 1472, 'n_tokens_neox': 1412, 'n_words': 402}