@@ -0,0 +1,1697 @@
+package parquet.hadoop.metadata;%0A%0Aimport static org.junit.Assert.assertEquals;%0Aimport static org.junit.Assert.assertTrue;%0Aimport static parquet.schema.PrimitiveType.PrimitiveTypeName.BINARY;%0A%0Aimport java.util.HashSet;%0Aimport java.util.Set;%0A%0Aimport org.junit.Assert;%0Aimport org.junit.Test;%0A%0Aimport parquet.column.Encoding;%0Aimport parquet.schema.PrimitiveType.PrimitiveTypeName;%0A%0Apublic class TestColumnChunkMetaData %7B%0A%0A%0A  @Test%0A  public void testConversionBig() %7B%0A    long big = (long)Integer.MAX_VALUE + 1;%0A%0A    ColumnChunkMetaData md = newMD(big);%0A    assertTrue(md instanceof IntColumnChunkMetaData);%0A    assertEquals(big, md.getFirstDataPageOffset());%0A  %7D%0A%0A  @Test%0A  public void testConversionSmall() %7B%0A    long small = 1;%0A%0A    ColumnChunkMetaData md = newMD(small);%0A    assertTrue(md instanceof IntColumnChunkMetaData);%0A    assertEquals(small, md.getFirstDataPageOffset());%0A  %7D%0A%0A  @Test%0A  public void testConversionVeryBig() %7B%0A    long veryBig = (long)Integer.MAX_VALUE * 3;%0A%0A    ColumnChunkMetaData md = newMD(veryBig);%0A    assertTrue(md instanceof LongColumnChunkMetaData);%0A    assertEquals(veryBig, md.getFirstDataPageOffset());%0A  %7D%0A%0A  @Test%0A  public void testConversionNeg() %7B%0A    long neg = -1;%0A%0A    ColumnChunkMetaData md = newMD(neg);%0A    assertTrue(md instanceof LongColumnChunkMetaData);%0A    assertEquals(neg, md.getFirstDataPageOffset());%0A  %7D%0A%0A  private ColumnChunkMetaData newMD(long big) %7B%0A    Set%3CEncoding%3E e = new HashSet%3CEncoding%3E();%0A    PrimitiveTypeName t = BINARY;%0A    ColumnPath p = ColumnPath.get(%22foo%22);%0A    CompressionCodecName c = CompressionCodecName.GZIP;%0A    ColumnChunkMetaData md = ColumnChunkMetaData.get(p, t, c, e,%0A        big, 0, 0, 0, 0);%0A    return md;%0A  %7D%0A%7D%0A

add unit test