Package com.foundationdb.ais.model.validation

Examples of com.foundationdb.ais.model.validation.AISValidationFailure.errorCode()


        }
        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


        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

       
        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();
        Assert.assertEquals(ErrorCode.JOIN_TO_MULTIPLE_PARENTS, fail.errorCode());
        // Failure 3: 3 joins to parent
        fail = fails.next();
View Full Code Here

        // 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();
        Assert.assertEquals(ErrorCode.JOIN_TO_MULTIPLE_PARENTS, fail.errorCode());
        // Failure 3: 3 joins to parent
        fail = fails.next();
        Assert.assertEquals(ErrorCode.JOIN_TO_WRONG_COLUMNS, fail.errorCode());
        Assert.assertEquals("Table `s`.`child` join reference part `nk` does not match `s`.`parent` primary key part `pk`", fail.message());
        // Failure 4: 3 joins to parent
View Full Code Here

        // Failure 2: join to non-key
        fail = fails.next();
        Assert.assertEquals(ErrorCode.JOIN_TO_MULTIPLE_PARENTS, fail.errorCode());
        // Failure 3: 3 joins to parent
        fail = fails.next();
        Assert.assertEquals(ErrorCode.JOIN_TO_WRONG_COLUMNS, fail.errorCode());
        Assert.assertEquals("Table `s`.`child` join reference part `nk` does not match `s`.`parent` primary key part `pk`", fail.message());
        // Failure 4: 3 joins to parent
        fail = fails.next();
        Assert.assertEquals(ErrorCode.JOIN_TO_WRONG_COLUMNS, fail.errorCode());
        Assert.assertEquals("Table `s`.`child` join reference part `uk` does not match `s`.`parent` primary key part `pk`", fail.message());
View Full Code Here

        fail = fails.next();
        Assert.assertEquals(ErrorCode.JOIN_TO_WRONG_COLUMNS, fail.errorCode());
        Assert.assertEquals("Table `s`.`child` join reference part `nk` does not match `s`.`parent` primary key part `pk`", fail.message());
        // Failure 4: 3 joins to parent
        fail = fails.next();
        Assert.assertEquals(ErrorCode.JOIN_TO_WRONG_COLUMNS, fail.errorCode());
        Assert.assertEquals("Table `s`.`child` join reference part `uk` does not match `s`.`parent` primary key part `pk`", fail.message());
    }

    @Test
    public void testIndexedLength()
View Full Code Here

        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());
    }

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

        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.SEQUENCE_INTERVAL_ZERO, fail.errorCode());
    }

    @Test
    public void validateIdentityMinMax1() {
        final AISBuilder builder = new AISBuilder();
View Full Code Here

       
        Assert.assertEquals(2, vResults.failures().size());
        Iterator<AISValidationFailure> errors = vResults.failures().iterator();
       
        AISValidationFailure fail = errors.next();
        assertEquals(ErrorCode.SEQUENCE_MIN_GE_MAX, fail.errorCode());
        fail = errors.next();
        assertEquals(ErrorCode.SEQUENCE_START_IN_RANGE, fail.errorCode());
    }

    @Test
View Full Code Here

        Iterator<AISValidationFailure> errors = vResults.failures().iterator();
       
        AISValidationFailure fail = errors.next();
        assertEquals(ErrorCode.SEQUENCE_MIN_GE_MAX, fail.errorCode());
        fail = errors.next();
        assertEquals(ErrorCode.SEQUENCE_START_IN_RANGE, fail.errorCode());
    }

    @Test
    public void validateIdentityMinMax2() {
        final AISBuilder builder = new AISBuilder();
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.