OrdinalOrdering implements AISValidation { private static AISValidationException lowerOrdinal(Table parent, Table child) { return new AISValidationException( String.format("Table %s has ordinal %d lower than parent %s ordinal %d", child.getName(), child.getOrdinal(), parent.getName(), parent.getOrdinal()) ); }  @Override void validate(AkibanInformationSchema ais, AISValidationOutput output);  }
@Test public void lowerOrdinal() { AkibanInformationSchema ais = AISBBasedBuilder .create("test", typesTranslator) .table("p").colInt("pid").pk("pid") .table("c").colInt("cid").colInt("pid").pk("cid").joinTo("p").on("pid", "pid") .unvalidatedAIS(); ais.getTable("test", "p").setOrdinal(2); ais.getTable("test", "c").setOrdinal(1); Collection<AISValidationFailure> failures = validate(ais); assertEquals("failures", 1, failures.size()); }