Package com.ebay.erl.mobius.datajoin

Source Code of com.ebay.erl.mobius.datajoin.DataJoinValueTest

package com.ebay.erl.mobius.datajoin;

import junit.framework.Assert;

import org.apache.hadoop.io.Text;
import org.junit.Test;

import com.ebay.erl.mobius.core.datajoin.DataJoinValue;

/**
* <p>
* This product is licensed under the Apache License,  Version 2.0,
* available at http://www.apache.org/licenses/LICENSE-2.0.
*
* This product contains portions derived from Apache hadoop which is
* licensed under the Apache License, Version 2.0, available at
* http://hadoop.apache.org.
*
* © 2007 – 2012 eBay Inc., Evan Chiu, Woody Zhou, Neel Sundaresan
*
*/
public class DataJoinValueTest {

  @Test
  public void testConstructor() {
    DataJoinValue djvalue = new DataJoinValue(Byte.valueOf("1"), new Text("2"));
   
    Assert.assertEquals("1", djvalue.getDatasetID());
    Assert.assertEquals(new Text("2"), djvalue.getValue());
   
  }
 
  @Test
  public void testCompare() {
    DataJoinValue djvalue1     = new DataJoinValue(Byte.valueOf("1"), new Text("1"));
    DataJoinValue djvalue1_1   = new DataJoinValue(Byte.valueOf("1"), new Text("1"));
    DataJoinValue djvalue2     = new DataJoinValue(Byte.valueOf("1"), new Text("2"));
   
    Assert.assertEquals(-1, djvalue1.compareTo(djvalue2));
    Assert.assertEquals(1, djvalue2.compareTo(djvalue1));
    Assert.assertEquals(0, djvalue1.compareTo(djvalue1_1));
    Assert.assertEquals(0, djvalue1_1.compareTo(djvalue1));
  }
}
TOP

Related Classes of com.ebay.erl.mobius.datajoin.DataJoinValueTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.