예제 #1
0
  private void testStrategy(Strategy distanceStrategy) throws UDFArgumentException, HiveException {
    Distance distance = new Distance();

    Object result = distance.evaluate(distanceStrategy.getName(), "hello", "hello");
    Assert.assertNotNull(result);
    Float dist = (Float) result;
    Assert.assertEquals(1.0, dist, 0f);
  }
예제 #2
0
  @Test
  public void testEvaluateWithStrategyNotFound() throws HiveException {
    Distance distance = new Distance();

    try {
      distance.evaluate("dd", "dd", "dd");
      Assert.fail();
    } catch (HiveException ex) {

    }
  }
예제 #3
0
  @Test
  public void testEvaluateWithNullValues() throws HiveException {
    Distance distance = new Distance();

    try {
      distance.evaluate(null, null, null);
      Assert.fail();
    } catch (HiveException ex) {

    }
  }