Package com.nearinfinity.honeycomb.mysql.schema

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


        FieldParser.parse("07_32_15", schema);
    }

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

        final String expectedParsedDateTime = "1989-05-13 07:32:15";
View Full Code Here


        }
    }

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

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

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

    @Test
    public void testParseDecimal() throws Exception {
        ColumnSchema schema = ColumnSchema
                .builder(COLUMN_NAME, ColumnType.DECIMAL)
                .setPrecision(5)
                .setScale(2)
                .build();
View Full Code Here

        assertEquals(9, FieldParser.bytesFromDigits(20));
    }

    @Test
    public void testParseStringEmptyValue() throws ParseException {
        ColumnSchema schema = ColumnSchema
                .builder(COLUMN_NAME, ColumnType.STRING)
                .setMaxLength(32)
                .build();

        assertEquals(ByteBuffer.wrap(EMPTY_STRING.getBytes(Charsets.UTF_8)),
View Full Code Here

                FieldParser.parse(EMPTY_STRING, schema));
    }

    @Test
    public void testParseBinaryEmptyValue() throws ParseException {
        ColumnSchema schema = ColumnSchema
                .builder(COLUMN_NAME, ColumnType.BINARY)
                .setMaxLength(32)
                .build();

        assertEquals(ByteBuffer.wrap(EMPTY_STRING.getBytes(Charsets.UTF_8)),
View Full Code Here

    @Test
    public void testIndexRowKeyStrings() {
        String columnName = "c1";
        String indexName = "i1";
        ColumnSchema columnSchema = ColumnSchema.builder("default", ColumnType.DATETIME).build();
        IndexSchema indexSchema = new IndexSchema(indexName, ImmutableList.of(columnName), false);
        TableSchema tableSchema = new TableSchema(ImmutableList.of(columnSchema), ImmutableList.of(indexSchema));

        Generator<RowKey> rowkeysGen = RowKeyGenerator.getAscIndexRowKeyGenerator(tableSchema);
        List<RowKey> rowkeys = Lists.newArrayList(Iterables.toIterable(rowkeysGen));
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.