@@ -0,0 +1,2450 @@
+/**%0A * Copyright (C) 2011 Akiban Technologies Inc.%0A * This program is free software: you can redistribute it and/or modify%0A * it under the terms of the GNU Affero General Public License, version 3,%0A * as published by the Free Software Foundation.%0A *%0A * This program is distributed in the hope that it will be useful,%0A * but WITHOUT ANY WARRANTY; without even the implied warranty of%0A * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the%0A * GNU Affero General Public License for more details.%0A *%0A * You should have received a copy of the GNU Affero General Public License%0A * along with this program.  If not, see http://www.gnu.org/licenses.%0A */%0A%0Apackage com.akiban.server.expression.std;%0A%0Aimport com.akiban.server.expression.Expression;%0Aimport com.akiban.server.expression.ExpressionEvaluation;%0Aimport com.akiban.server.types.AkType;%0Aimport com.akiban.server.types.NullValueSource;%0Aimport com.akiban.server.types.ValueSource;%0Aimport com.akiban.server.types.util.ValueHolder;%0Aimport org.junit.Test;%0A%0Aimport static org.junit.Assert.assertEquals;%0Aimport static org.junit.Assert.assertTrue;%0A%0Aimport java.math.BigDecimal;%0A%0Apublic final class CastExpressionTest %7B%0A    protected ValueSource cast(ValueSource source, AkType to) %7B%0A        Expression expression = new CastExpression(to, new LiteralExpression(source));%0A        return expression.evaluation().eval();%0A    %7D%0A%0A    @Test%0A    public void testNull() %7B%0A        assertTrue(%22result is null%22, %0A                   cast(NullValueSource.only(), AkType.VARCHAR).isNull());%0A    %7D%0A%0A    @Test%0A    public void testSame() %7B%0A        ValueSource value;%0A%0A        value = new ValueHolder(AkType.INT, 1);%0A        assertEquals(value, cast(value, AkType.INT));%0A%0A        value = new ValueHolder(AkType.VARCHAR, %22test%22);%0A        assertEquals(value, cast(value, AkType.VARCHAR));%0A    %7D%0A%0A    @Test%0A    public void testConvert() %7B%0A        ValueSource value, expected;%0A%0A        value = new ValueHolder(AkType.INT, 20);%0A        expected = new ValueHolder(AkType.VARCHAR, %2220%22);%0A        assertEquals(expected, cast(value, AkType.VARCHAR));%0A%0A        value = new ValueHolder(AkType.VARCHAR, %22-123%22);%0A        expected = new ValueHolder(AkType.LONG, -123L);%0A        assertEquals(expected, cast(value, AkType.LONG));%0A%0A        value = new ValueHolder(AkType.VARCHAR, %2298.76%22);%0A        expected = new ValueHolder(AkType.DECIMAL, new BigDecimal(%2298.76%22));%0A        assertEquals(expected, cast(value, AkType.DECIMAL));%0A    %7D%0A%7D%0A

Add unit test for that.