Exemplo n.º 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);
  }
Exemplo n.º 2
0
  @Test
  public void testEvaluateWithStrategyNotFound() throws HiveException {
    Distance distance = new Distance();

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

    }
  }
Exemplo n.º 3
0
  @Test
  public void testEvaluateWithNullValues() throws HiveException {
    Distance distance = new Distance();

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

    }
  }