Package com.nearinfinity.honeycomb.mysql.schema

Examples of com.nearinfinity.honeycomb.mysql.schema.ColumnSchema


     * @throws ParseException
     */
    @Test
    public void testParseEmptyValueNullableMetadataLongType()
            throws ParseException {
        ColumnSchema schema = ColumnSchema
                .builder(COLUMN_NAME, ColumnType.LONG)
                .build();

        assertNull(FieldParser.parse(EMPTY_STRING, schema));
    }
View Full Code Here


     * @throws ParseException
     */
    @Test(expected = IllegalArgumentException.class)
    public void testParseEmptyValueNonNullableSchemaLongType()
            throws ParseException {
        ColumnSchema schema = ColumnSchema
                .builder(COLUMN_NAME, ColumnType.LONG)
                .setIsNullable(false)
                .build();

        assertNull(FieldParser.parse(EMPTY_STRING, schema));
View Full Code Here

        assertNull(FieldParser.parse(EMPTY_STRING, schema));
    }

    @Test
    public void testParseLong() throws ParseException {
        ColumnSchema schema = ColumnSchema
                .builder(COLUMN_NAME, ColumnType.LONG)
                .build();

        assertEquals(ByteBuffer.wrap(Longs.toByteArray(0x00L)),
                FieldParser.parse("0", schema));
View Full Code Here

                FieldParser.parse("-9223372036854775808", schema));
    }

    @Test
    public void testParseULong() throws ParseException {
        ColumnSchema schema = ColumnSchema
                .builder(COLUMN_NAME, ColumnType.ULONG)
                .build();

        assertEquals(ByteBuffer.wrap(Longs.toByteArray(0x00L)),
                FieldParser.parse("0", schema));
View Full Code Here

                FieldParser.parse("18446744073709551615", schema));
    }

    @Test(expected = IllegalArgumentException.class)
    public void testParseULongNegativeInput() throws ParseException {
        ColumnSchema schema = ColumnSchema
                .builder(COLUMN_NAME, ColumnType.ULONG)
                .build();

        FieldParser.parse("-123", schema);
    }
View Full Code Here

        FieldParser.parse("-123", schema);
    }

    @Test
    public void testParseDoubleZeroValue() throws ParseException {
        ColumnSchema schema = ColumnSchema
                .builder(COLUMN_NAME, ColumnType.DOUBLE)
                .build();

        // Note: These values are all big endian, as per the JVM
        assertEquals(ByteBuffer.wrap(Bytes.toBytes(0x00L)),
View Full Code Here

                FieldParser.parse("-12.12", schema));
    }

    @Test
    public void testParseValidDateFormats() throws ParseException {
        ColumnSchema schema = ColumnSchema
                .builder(COLUMN_NAME, ColumnType.DATE)
                .build();

        final String expectedParsedDate = "1989-05-13";
View Full Code Here

        }
    }

    @Test(expected = ParseException.class)
    public void testParseInvalidDateFormat() throws ParseException {
        ColumnSchema schema = ColumnSchema
                .builder(COLUMN_NAME, ColumnType.DATE)
                .build();

        FieldParser.parse("1989_05_13", schema);
    }
View Full Code Here

        FieldParser.parse("1989_05_13", schema);
    }

    @Test
    public void testParseTime() throws Exception {
        ColumnSchema schema = ColumnSchema
                .builder(COLUMN_NAME, ColumnType.TIME)
                .build();

        final String expectedParsedTime = "07:32:15";
View Full Code Here

        }
    }

    @Test(expected = ParseException.class)
    public void testParseInvalidTimeFormat() throws ParseException {
        ColumnSchema schema = ColumnSchema
                .builder(COLUMN_NAME, ColumnType.TIME)
                .build();

        FieldParser.parse("07_32_15", schema);
    }
View Full Code Here

TOP

Related Classes of com.nearinfinity.honeycomb.mysql.schema.ColumnSchema

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.