Package com.foundationdb.ais.model.validation

Examples of com.foundationdb.ais.model.validation.AISValidationResults.failures()


        createTable("schema", "child", "id int not null, rid int, primary key(id)", akibanFK("rid", "root", "id"));
        ddl().renameTable(session(), tableName("schema", "child"), tableName("schema", "renamed_child"));
        createTable("schema", "child", "id int not null, rid int, primary key(id)", akibanFK("rid", "root", "id"));
        AkibanInformationSchema ais = ddl().getAIS(session());
        AISValidationResults results = ais.validate(Collections.singleton(new StorageKeysUnique()));
        assertEquals(0, results.failures().size());
    }
}
View Full Code Here


        Assert.assertEquals(1, ais.getGroups().size());
        Assert.assertEquals(2, ais.getJoins().size());

        AISValidationResults results = builder.akibanInformationSchema().validate(AISValidations.BASIC_VALIDATIONS);
       
        Assert.assertEquals(3,results.failures().size());
        Iterator<AISValidationFailure> failures = results.failures().iterator();
       
        Assert.assertEquals("Table `schema`.`customer` does not belong to any group", failures.next().message());
        Assert.assertEquals("Table `schema`.`item` does not belong to any group", failures.next().message());
        Assert.assertEquals("Table `schema`.`order` does not belong to any group", failures.next().message());
View Full Code Here

        Assert.assertEquals(2, ais.getJoins().size());

        AISValidationResults results = builder.akibanInformationSchema().validate(AISValidations.BASIC_VALIDATIONS);
       
        Assert.assertEquals(3,results.failures().size());
        Iterator<AISValidationFailure> failures = results.failures().iterator();
       
        Assert.assertEquals("Table `schema`.`customer` does not belong to any group", failures.next().message());
        Assert.assertEquals("Table `schema`.`item` does not belong to any group", failures.next().message());
        Assert.assertEquals("Table `schema`.`order` does not belong to any group", failures.next().message());
       
View Full Code Here

                Assert.fail();
            }
        }
        AISValidationResults vResults = builder.akibanInformationSchema().validate(AISValidations.BASIC_VALIDATIONS);
       
        Assert.assertEquals(1, vResults.failures().size());
        AISValidationFailure fail = vResults.failures().iterator().next();
        Assert.assertEquals(ErrorCode.JOIN_TO_MULTIPLE_PARENTS, fail.errorCode());
    }

    @Test
View Full Code Here

            }
        }
        AISValidationResults vResults = builder.akibanInformationSchema().validate(AISValidations.BASIC_VALIDATIONS);
       
        Assert.assertEquals(1, vResults.failures().size());
        AISValidationFailure fail = vResults.failures().iterator().next();
        Assert.assertEquals(ErrorCode.JOIN_TO_MULTIPLE_PARENTS, fail.errorCode());
    }

    @Test
    public void testInitialAutoInc()
View Full Code Here

        Table table = ais.getTable("s", "t");
        table.getColumns();

        AISValidationResults vResults = builder.akibanInformationSchema().validate(AISValidations.BASIC_VALIDATIONS);
       
        Assert.assertEquals(1, vResults.failures().size());
        AISValidationFailure fail = vResults.failures().iterator().next();
        Assert.assertEquals(ErrorCode.JOIN_TO_MULTIPLE_PARENTS, fail.errorCode());
    }

    @Test
View Full Code Here

        table.getColumns();

        AISValidationResults vResults = builder.akibanInformationSchema().validate(AISValidations.BASIC_VALIDATIONS);
       
        Assert.assertEquals(1, vResults.failures().size());
        AISValidationFailure fail = vResults.failures().iterator().next();
        Assert.assertEquals(ErrorCode.JOIN_TO_MULTIPLE_PARENTS, fail.errorCode());
    }

    @Test
    public void testFunnyFKs()
View Full Code Here

        // Done
        builder.groupingIsComplete();
       
        AISValidationResults vResults = builder.akibanInformationSchema().validate(AISValidations.BASIC_VALIDATIONS);
       
        Assert.assertEquals(4, vResults.failures().size());
        Iterator<AISValidationFailure> fails = vResults.failures().iterator();
        // Failure 1: join to unique key
        AISValidationFailure fail = fails.next();
        Assert.assertEquals(ErrorCode.JOIN_TO_MULTIPLE_PARENTS, fail.errorCode());
        // Failure 2: join to non-key
View Full Code Here

        builder.groupingIsComplete();
       
        AISValidationResults vResults = builder.akibanInformationSchema().validate(AISValidations.BASIC_VALIDATIONS);
       
        Assert.assertEquals(4, vResults.failures().size());
        Iterator<AISValidationFailure> fails = vResults.failures().iterator();
        // Failure 1: join to unique key
        AISValidationFailure fail = fails.next();
        Assert.assertEquals(ErrorCode.JOIN_TO_MULTIPLE_PARENTS, fail.errorCode());
        // Failure 2: join to non-key
        fail = fails.next();
View Full Code Here

        builder.basicSchemaIsComplete();
        builder.createGroup("group", "test");
        builder.addTableToGroup("group", "test", "t1");
        builder.groupingIsComplete();
        AISValidationResults vResults = builder.akibanInformationSchema().validate(AISValidations.BASIC_VALIDATIONS);
        Assert.assertEquals(1, vResults.failures().size());
        AISValidationFailure fail = vResults.failures().iterator().next();
        Assert.assertEquals(ErrorCode.MULTIPLE_IDENTITY_COLUMNS, fail.errorCode());
    }

   
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.