@@ -0,0 +1,1366 @@
+package org.apache.phoenix.expression.function;%0A%0Aimport org.apache.hadoop.hbase.io.ImmutableBytesWritable;%0Aimport org.apache.phoenix.expression.Expression;%0Aimport org.apache.phoenix.expression.LiteralExpression;%0Aimport org.apache.phoenix.schema.types.*;%0Aimport org.junit.Test;%0A%0Aimport java.util.Arrays;%0Aimport java.util.List;%0A%0Aimport static org.junit.Assert.assertEquals;%0A%0A%0A/**%0A * Created by WangLei on 2015/3/20.%0A */%0Apublic class ArrayToJsonFunctionTest %7B%0A%0A    public String testIntArrayToJson (Object%5B%5D array) throws Exception %7B%0A        LiteralExpression arrayExpr;%0A        List%3CExpression%3E children;%0A        PhoenixArray pa =new PhoenixArray.PrimitiveIntPhoenixArray( PInteger.INSTANCE,array);%0A        arrayExpr = LiteralExpression.newConstant(pa,PIntegerArray.INSTANCE );%0A        children = Arrays.%3CExpression%3EasList(arrayExpr);%0A        ArrayToJsonFunction e = new ArrayToJsonFunction(children);%0A        ImmutableBytesWritable ptr = new ImmutableBytesWritable();%0A        boolean evaluated = e.evaluate(null, ptr);%0A        String result = (String)e.getDataType().toObject(ptr);%0A        return result;%0A    %7D%0A    @Test%0A    public void testArrayToJson() throws Exception %7B%0A        Object%5B%5D testarray = new Object%5B%5D%7B1,12,32%7D;%0A        String result = testIntArrayToJson(testarray);%0A        String expected =%22%5B1,12,32%5D%22;%0A        assertEquals(result, expected);%0A    %7D%0A%7D%0A

Create ArrayToJsonFunctionTest.java