prodMet.replaceMetadata("CAS.ProductName", "TestFile3");
prodMet.replaceMetadata("DataVersion", "4.6");
myCat.addMetadata(prodMet, testProduct);
// perform first query
Query query = new Query();
query
.addCriterion(SqlParser
.parseSqlWhereClause("CAS.ProductName != 'TestFile3' AND (Filename == 'test-file-1.txt' OR Filename == 'test-file-2.txt') AND CAS.ProductName != 'TestFile2'"));
System.out.println(query);
List<String> productIds = myCat.query(query, testProduct
.getProductType());
System.out.println(productIds);
assertEquals("[23]", productIds.toString());
// perform second query
query = new Query();
query
.addCriterion(SqlParser
.parseSqlWhereClause("Filename == 'test-file-1.txt' OR (Filename == 'test-file-2.txt' AND CAS.ProductName != 'TestFile2')"));
System.out.println(query);
productIds = myCat.query(query, testProduct.getProductType());
System.out.println(productIds);
assertEquals("[25, 23]", productIds.toString());
// perform second query
query = new Query();
query
.addCriterion(SqlParser
.parseSqlWhereClause("NominalDate == '2008-01-20' AND DataVersion >= '3.6' AND DataVersion <= '4.0'"));
System.out.println(query);
productIds = myCat.query(query, testProduct.getProductType());
System.out.println(productIds);