UUIDPresent implements AISValidation { @Override public void validate(AkibanInformationSchema ais, AISValidationOutput output) { for(Table t : ais.getTables().values()) { if(t.getUuid() == null) { output.reportFailure(new AISValidationFailure(missingTable(t))); } for(Column c: t.getColumnsIncludingInternal()) { if(c.getUuid() == null) { output.reportFailure(new AISValidationFailure(missingColumn(t, c))); } } } }  @Override void validate(AkibanInformationSchema ais, AISValidationOutput output);  }
@Test public void missingFromTable() { AkibanInformationSchema ais = build(); Table t = ais.getTable("test", "t"); t.setUuid(null); t.getColumn("id").setUuid(UUID.randomUUID()); assertEquals("failures", 1, validate(ais).size()); }
@Test public void missingFromColumn() { AkibanInformationSchema ais = build(); Table t = ais.getTable("test", "t"); t.setUuid(UUID.randomUUID()); t.getColumn("id").setUuid(null); assertEquals("failures", 1, validate(ais).size()); }