FPLParser parser = new FPLParser(string, env, new StubIType());
Predicate pred = parser.expression();
Assert.assertTrue("Parsed predicate should be a TestPredicate, but is " + pred.getClass().getCanonicalName(), pred instanceof TestPredicate);
TestPredicate val = (TestPredicate)pred;
Assert.assertTrue("Parsed predicate should be negative", !val.isPositive());
Assert.assertTrue("Parsed inner predicate should be negative", !val.getRelationship().isPositive());
Assert.assertEquals("Inner relationship incorrect", "Foo", val.getRelationship().getRelation().getName());
FreeVars vars = val.getFreeVariables();
Assert.assertEquals("Should only contain three free variables", 3, vars.size());
Assert.assertEquals("c should have a boolean type", "boolean", vars.getType(new SpecVar("c")));
Assert.assertEquals("a should have a Bar type", "Bar", vars.getType(new SpecVar("a")));
Assert.assertEquals("b should have a Baz type", "Baz", vars.getType(new SpecVar("b")));
}