use of org.teiid.query.validator.ValidatorReport in project teiid by teiid.
the class TestMetadataValidator method testMinimalDataNoColumns.
@Test
public void testMinimalDataNoColumns() throws Exception {
buildModel("pm1", true, this.vdb, this.store, "create foreign table g1;");
ValidatorReport report = new ValidatorReport();
new MetadataValidator.MinimalMetadata().execute(vdb, store, report, new MetadataValidator());
assertTrue(printError(report), report.hasItems());
}
use of org.teiid.query.validator.ValidatorReport in project teiid by teiid.
the class TestMetadataValidator method testExternalMaterializationValidateColumns.
@Test
public void testExternalMaterializationValidateColumns() throws Exception {
String ddl = "CREATE FOREIGN TABLE G1(e2 varchar);" + "create foreign table status (VDBNAME STRING, VDBVERSION STRING, " + " SCHEMANAME STRING, NAME STRING, TARGETSCHEMANAME STRING, TARGETNAME STRING, " + " VALID BOOLEAN, LOADSTATE STRING, CARDINALITY LONG, UPDATED TIMESTAMP, LOADNUMBER LONG, NODENAME STRING, STALECOUNT LONG)";
String ddl2 = "CREATE VIEW G2 (e1 integer, e2 varchar) OPTIONS (MATERIALIZED 'true', MATERIALIZED_TABLE 'pm1.G1', \"teiid_rel:MATVIEW_STATUS_TABLE\" 'pm1.status', \"teiid_rel:MATVIEW_LOAD_SCRIPT\" 'begin end') AS SELECT 1, 'a' FROM pm1.G1";
buildModel("pm1", true, this.vdb, this.store, ddl);
buildModel("vm1", false, this.vdb, this.store, ddl2);
buildTransformationMetadata();
ValidatorReport report = new ValidatorReport();
report = new MetadataValidator().validate(this.vdb, this.store);
assertTrue(printError(report), report.hasItems());
}
use of org.teiid.query.validator.ValidatorReport in project teiid by teiid.
the class TestMetadataValidator method testProcWithDuplicateParam.
@Test
public void testProcWithDuplicateParam() throws Exception {
String ddl = "create foreign procedure x (out param1 string, out param1 string); ";
buildModel("pm1", true, this.vdb, this.store, ddl);
buildTransformationMetadata();
ValidatorReport report = new MetadataValidator().validate(vdb, store);
assertTrue(printError(report), report.hasItems());
}
use of org.teiid.query.validator.ValidatorReport in project teiid by teiid.
the class TestMetadataValidator method testProcMetadataValidationError.
@Test
public void testProcMetadataValidationError() throws Exception {
String ddl = "create virtual procedure proc1(IN e1 varchar) RETURNS (e1 integer, e2 varchar(12)) AS begin create local temporary table x (e1 integer, e2 varchar not null); insert into x (e1) values (1); select * from x; end;";
buildModel("vm1", false, this.vdb, this.store, ddl);
buildTransformationMetadata();
ValidatorReport report = new ValidatorReport();
new MetadataValidator.ResolveQueryPlans().execute(vdb, store, report, new MetadataValidator());
assertEquals("TEIID31080 vm1.proc1 validation error: Element x.e2 of x is neither nullable nor has a default value. A value must be specified in the insert.", report.getItems().iterator().next().toString());
}
use of org.teiid.query.validator.ValidatorReport in project teiid by teiid.
the class TestMetadataValidator method testInvalidView.
@Test
public void testInvalidView() throws Exception {
String ddl = "create view g1 (e1 integer, e2 varchar(12)) AS select 'a';";
buildModel("vm1", false, this.vdb, this.store, ddl);
buildTransformationMetadata();
ValidatorReport report = new ValidatorReport();
new MetadataValidator.ResolveQueryPlans().execute(vdb, store, report, new MetadataValidator());
assertTrue(printError(report), report.hasItems());
}
Aggregations