Package com.foundationdb.ais.model

Examples of com.foundationdb.ais.model.TestAISBuilder.akibanInformationSchema()


        builder.indexColumn(SCHEMA, TABLE, "v", "v", 0, true, indexedLength);
        builder.createGroup(TABLE, SCHEMA);
        builder.addTableToGroup(TABLE, SCHEMA, TABLE);
        builder.basicSchemaIsComplete();
        builder.groupingIsComplete();
        return builder.akibanInformationSchema();
    }

    private static void validate(AkibanInformationSchema ais) {
        ais.validate(Collections.<AISValidation>singleton(new IndexColumnIsNotPartial())).throwIfNecessary();
    }
View Full Code Here


        builder.createGroup("customer", "schema");
        builder.addTableToGroup("customer", "schema", "customer2");
        builder.groupingIsComplete();
       
        SchemaFactory factory = new SchemaFactory ("schema");
        factory.buildRowDefs(builder.akibanInformationSchema());
        return new Schema(builder.akibanInformationSchema());
    }

    private Schema schema;
    private TypesRegistryService registry;
View Full Code Here

        builder.addTableToGroup("customer", "schema", "customer2");
        builder.groupingIsComplete();
       
        SchemaFactory factory = new SchemaFactory ("schema");
        factory.buildRowDefs(builder.akibanInformationSchema());
        return new Schema(builder.akibanInformationSchema());
    }

    private Schema schema;
    private TypesRegistryService registry;
View Full Code Here

    public void testSupportedCollation() {
        final TestAISBuilder builder = new TestAISBuilder(typesRegistry);
        builder.table("test", "t1");
        builder.column("test", "t1", "c1", 0, "MCOMPAT", "VARCHAR", 16L, true, null, "en_us");
        builder.basicSchemaIsComplete();
        Assert.assertEquals("Expect no validation failure for supported collation", 0, builder
                .akibanInformationSchema().validate(validations).failures().size());
    }

    @Test
    public void testUnsupportedCollationStrictMode() {
View Full Code Here

            AkCollatorFactory.setCollationMode(Mode.STRICT);
            final TestAISBuilder builder = new TestAISBuilder(typesRegistry);
            builder.table("test", "t1");
            builder.column("test", "t1", "c1", 0, "MCOMPAT", "VARCHAR", 16L, true, null, "fricostatic_sengalese_ci");
            builder.basicSchemaIsComplete();
            Assert.assertEquals("Expect validation failure on invalid collation", 1, builder.akibanInformationSchema()
                    .validate(validations).failures().size());
        } catch (UnsupportedCollationException ex) {
            // Okay if thrown earlier.
        } finally {
            AkCollatorFactory.setCollationMode(save);
View Full Code Here

            AkCollatorFactory.setCollationMode(Mode.LOOSE);
            final TestAISBuilder builder = new TestAISBuilder(typesRegistry);
            builder.table("test", "t1");
            builder.column("test", "t1", "c1", 0, "MCOMPAT", "VARCHAR", 16L, true, null, "fricostatic_sengalese_ci");
            builder.basicSchemaIsComplete();
            Assert.assertEquals("Expect no validation failure in loose mode", 0, builder.akibanInformationSchema()
                    .validate(validations).failures().size());
        } finally {
            AkCollatorFactory.setCollationMode(save);
        }
    }
View Full Code Here

        builder.table("s", "t");
        builder.column ("s", "t", "c1", 0, "MCOMPAT", "int", false);
        builder.pk("s", "t");
        builder.indexColumn("s", "t", "PRIMARY", "c1", 0, true, 0);
        builder.basicSchemaIsComplete();
        return builder.akibanInformationSchema();
    }
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.