Package com.asakusafw.runtime.value

Examples of com.asakusafw.runtime.value.ByteOption


        testField(list, "getCSmallintOption", DATA.DATETIME_DATETIME_FIMT1, shortOption.setNull());
        testField(list, "getCSmallintOption", DATA.DATETIME_DATETIME_FIMT2, shortOption.setNull());
        testField(list, "getCSmallintOption", DATA.STRING_DATETIME, shortOption.setNull());

        // C_TINYINTのテスト
        ByteOption byteOption = new ByteOption();
        testField(list, "getCTinyintOption", DATA.NUMERIC_0, byteOption.modify((byte) 0));
        testField(list, "getCTinyintOption", DATA.NUMERIC_1, byteOption.modify((byte) 1));
        testField(list, "getCTinyintOption", DATA.NUMERIC_MINUS1, byteOption.modify((byte) -1));
        testField(list, "getCTinyintOption", DATA.NUMERIC_MAX, byteOption.modify(Byte.MAX_VALUE));
        testField(list, "getCTinyintOption", DATA.NUMERIC_MIN, byteOption.modify(Byte.MIN_VALUE));
        testField(list, "getCTinyintOption", DATA.NUMERIC_DECIMAL, byteOption.setNull());
        testField(list, "getCTinyintOption", DATA.NUMERIC_OVER_MAX, byteOption.setNull());
        testField(list, "getCTinyintOption", DATA.NUMERIC_UNDER_MIN, byteOption.setNull());
        testField(list, "getCTinyintOption", DATA.NUMERIC_BIG_VALUE, byteOption.setNull());
        testField(list, "getCTinyintOption", DATA.STRING_0, byteOption.modify((byte) 0));
        testField(list, "getCTinyintOption", DATA.STRING_1, byteOption.modify((byte) 1));
        testField(list, "getCTinyintOption", DATA.STRING_MINUS1, byteOption.modify((byte) -1));
        testField(list, "getCTinyintOption", DATA.STRING_MAX, byteOption.modify(Byte.MAX_VALUE));
        testField(list, "getCTinyintOption", DATA.STRING_MIN, byteOption.modify(Byte.MIN_VALUE));
        testField(list, "getCTinyintOption", DATA.STRING_DECIMAL, byteOption.setNull());
        testField(list, "getCTinyintOption", DATA.STRING_OVER_MAX, byteOption.setNull());
        testField(list, "getCTinyintOption", DATA.STRING_UNDER_MIN, byteOption.setNull());
        testField(list, "getCTinyintOption", DATA.STRING_BIG_VALUE, byteOption.setNull());
        testField(list, "getCTinyintOption", DATA.BLANK, byteOption.setNull());
        testField(list, "getCTinyintOption", DATA.NULL_STRING, byteOption.setNull());
        testField(list, "getCTinyintOption", DATA.BOOL_TRUE, byteOption.modify((byte) 1));
        testField(list, "getCTinyintOption", DATA.BOOL_FALSE, byteOption.modify((byte) 0));
        testField(list, "getCTinyintOption", DATA.NUMERIC_DATE, byteOption.setNull());
        testField(list, "getCTinyintOption", DATA.DATE_DATE_FMT1, byteOption.setNull());
        testField(list, "getCTinyintOption", DATA.DATE_DATE_FMT2, byteOption.setNull());
        testField(list, "getCTinyintOption", DATA.DATE_DATETIME_FIMT1, byteOption.setNull());
        testField(list, "getCTinyintOption", DATA.DATE_DATETIME_FIMT2, byteOption.setNull());
        testField(list, "getCTinyintOption", DATA.STRING_DATE, byteOption.setNull());
        testField(list, "getCTinyintOption", DATA.NUMERIC_DATETIME, byteOption.setNull());
        testField(list, "getCTinyintOption", DATA.DATETIME_DATE_FMT1, byteOption.setNull());
        testField(list, "getCTinyintOption", DATA.DATETIME_DATE_FMT2, byteOption.setNull());
        testField(list, "getCTinyintOption", DATA.DATETIME_DATETIME_FIMT1, byteOption.setNull());
        testField(list, "getCTinyintOption", DATA.DATETIME_DATETIME_FIMT2, byteOption.setNull());
        testField(list, "getCTinyintOption", DATA.STRING_DATETIME, byteOption.setNull());

        // C_CHARのテスト
        StringOption stringOption = new StringOption();
        testField(list, "getCCharOption", DATA.NUMERIC_0, stringOption.modify("0"));
        testField(list, "getCCharOption", DATA.NUMERIC_1, stringOption.modify("1"));
View Full Code Here


     * @param cell 対象のセル
     * @return 対応する値
     */
    private ByteOption getByteOption(HSSFCell cell) {
        Long l = getLong(cell);
        ByteOption op = new ByteOption();
        if (l == null) {
            op.setNull();
        } else {
            if (l < Byte.MIN_VALUE || Byte.MAX_VALUE < l) {
                String msg = createExceptionMsg(cell, "表現可能な範囲外の数値(" + l + ")");
                throw new NumberFormatException(msg);
            }
            op.modify(l.byteValue());
        }
        return op;
    }
View Full Code Here

        testGetXXXOptionDo(excelUtils, sheet, DATA.STRING_DATETIME, TYPES.SMALLINT, new CellTypeMismatchException("数値"));
        testGetXXXOptionDo(excelUtils, sheet, DATA.ERROR, TYPES.SMALLINT,  new CellTypeMismatchException("数値"));
        testGetXXXOptionDo(excelUtils, sheet, DATA.FORMULA, TYPES.SMALLINT, new CellTypeMismatchException("数値"));

        // getByteOptionのテスト
        ByteOption byteOption = new ByteOption();
        byteOption.modify((byte) 0);
        testGetXXXOptionDo(excelUtils, sheet,  DATA.NUMERIC_0, TYPES.TINYINT, byteOption);
        byteOption.modify((byte) 1);
        testGetXXXOptionDo(excelUtils, sheet, DATA.NUMERIC_1, TYPES.TINYINT, byteOption);
        byteOption.modify((byte) -1);
        testGetXXXOptionDo(excelUtils, sheet, DATA.NUMERIC_MINUS1, TYPES.TINYINT, byteOption);
        byteOption.modify(Byte.MAX_VALUE);
        testGetXXXOptionDo(excelUtils, sheet, DATA.NUMERIC_MAX, TYPES.TINYINT, byteOption);
        byteOption.modify(Byte.MIN_VALUE);
        testGetXXXOptionDo(excelUtils, sheet, DATA.NUMERIC_MIN, TYPES.TINYINT, byteOption);
        testGetXXXOptionDo(excelUtils, sheet, DATA.NUMERIC_DECIMAL, TYPES.TINYINT, new NumberFormatException("小数部を持つ数値を整数型に変換できません"));
        testGetXXXOptionDo(excelUtils, sheet, DATA.NUMERIC_OVER_MAX, TYPES.TINYINT, new NumberFormatException("表現可能な範囲外の数値"));
        testGetXXXOptionDo(excelUtils, sheet, DATA.NUMERIC_UNDER_MIN, TYPES.TINYINT, new NumberFormatException("表現可能な範囲外の数値"));
        testGetXXXOptionDo(excelUtils, sheet, DATA.NUMERIC_BIG_VALUE, TYPES.TINYINT, new NumberFormatException("表現可能な範囲外の数値"));
        byteOption.modify((byte)0);
        testGetXXXOptionDo(excelUtils, sheet, DATA.STRING_0, TYPES.TINYINT, byteOption);
        byteOption.modify((byte)1);
        testGetXXXOptionDo(excelUtils, sheet, DATA.STRING_1, TYPES.TINYINT, byteOption);
        byteOption.modify((byte)-1);
        testGetXXXOptionDo(excelUtils, sheet, DATA.STRING_MINUS1, TYPES.TINYINT, byteOption);
        byteOption.modify(Byte.MAX_VALUE);
        testGetXXXOptionDo(excelUtils, sheet, DATA.STRING_MAX, TYPES.TINYINT, byteOption);
        byteOption.modify(Byte.MIN_VALUE);
        testGetXXXOptionDo(excelUtils, sheet, DATA.STRING_MIN, TYPES.TINYINT, byteOption);
        testGetXXXOptionDo(excelUtils, sheet, DATA.STRING_DECIMAL, TYPES.TINYINT, new CellTypeMismatchException("数値"));
        testGetXXXOptionDo(excelUtils, sheet, DATA.STRING_OVER_MAX, TYPES.TINYINT, new NumberFormatException("表現可能な範囲外の数値"));
        testGetXXXOptionDo(excelUtils, sheet, DATA.STRING_UNDER_MIN, TYPES.TINYINT, new NumberFormatException("表現可能な範囲外の数値"));
        testGetXXXOptionDo(excelUtils, sheet, DATA.STRING_BIG_VALUE, TYPES.TINYINT, new CellTypeMismatchException("数値"));
        byteOption.setNull();
        testGetXXXOptionDo(excelUtils, sheet, DATA.BLANK, TYPES.TINYINT, byteOption);
        longOption.setNull();
        testGetXXXOptionDo(excelUtils, sheet, DATA.NULL_STRING, TYPES.TINYINT, new CellTypeMismatchException("数値"));
        byteOption.modify((byte)1);
        testGetXXXOptionDo(excelUtils, sheet, DATA.BOOL_TRUE, TYPES.TINYINT, byteOption);
        byteOption.modify((byte)0);
        testGetXXXOptionDo(excelUtils, sheet, DATA.BOOL_FALSE, TYPES.TINYINT, byteOption);
        testGetXXXOptionDo(excelUtils, sheet, DATA.NUMERIC_DATE, TYPES.TINYINT, new NumberFormatException("表現可能な範囲外の数値"));
        testGetXXXOptionDo(excelUtils, sheet, DATA.DATE_DATE_FMT1, TYPES.TINYINT, new NumberFormatException("表現可能な範囲外の数値"));
        testGetXXXOptionDo(excelUtils, sheet, DATA.DATE_DATE_FMT2, TYPES.TINYINT, new NumberFormatException("表現可能な範囲外の数値"));
        testGetXXXOptionDo(excelUtils, sheet, DATA.DATE_DATETIME_FIMT1, TYPES.TINYINT, new NumberFormatException("表現可能な範囲外の数値"));
View Full Code Here

TOP

Related Classes of com.asakusafw.runtime.value.ByteOption

Copyright © 2018 www.massapicom. 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.