Package edu.cmu.cs.fusion

Examples of edu.cmu.cs.fusion.RelationsEnvironment


 
 
  @Test
  public void testRelPred() throws ParseException {
    String string = "Foo(a, b)";
    RelationsEnvironment env = new RelationsEnvironment();
    env.addRelation(new Relation("Foo", new String[] {"Bar", "Baz"}));
   
    FPLParser parser = new FPLParser(string, env, new StubIType());
    Predicate pred = parser.expression();
   
    Assert.assertTrue("Parsed predicate should be a RelationshipPredicate, but is " + pred.getClass().getCanonicalName(), pred instanceof RelationshipPredicate);
View Full Code Here


  }
 
  @Test
  public void testNegRelPred() throws ParseException {
    String string = "!Foo(a, b)";
    RelationsEnvironment env = new RelationsEnvironment();
    env.addRelation(new Relation("Foo", new String[] {"Bar", "Baz"}));

    FPLParser parser = new FPLParser(string, env, new StubIType());
    Predicate pred = parser.expression();
   
    Assert.assertTrue("Parsed predicate should be a RelationshipPredicate, but is " + pred.getClass().getCanonicalName(), pred instanceof RelationshipPredicate);
View Full Code Here

public class ParseEffect {
 
  @Test
  public void testAddEffect() throws ParseException {
    String string = "Foo(a, b)";
    RelationsEnvironment env = new RelationsEnvironment();
    env.addRelation(new Relation("Foo", new String[] {"Bar", "Baz"}));
   
    FPLParser parser = new FPLParser(string, env, new StubIType());
    RelEffect effect = parser.relEffect();
   
    Assert.assertEquals("Effect type is wrong", RelEffect.EffectType.ADD, effect.getType());
View Full Code Here

  }
 
  @Test
  public void testRemoveEffect() throws ParseException {
    String string = "!Foo(a, b)";
    RelationsEnvironment env = new RelationsEnvironment();
    env.addRelation(new Relation("Foo", new String[] {"Bar", "Baz"}));
   
    FPLParser parser = new FPLParser(string, env, new StubIType());
    RelEffect effect = parser.relEffect();
   
    Assert.assertEquals("Effect type is wrong", RelEffect.EffectType.REMOVE, effect.getType());
View Full Code Here

  }
 
  @Test
  public void testRemoveManyEffect() throws ParseException {
    String string = "!Foo(*, b)";
    RelationsEnvironment env = new RelationsEnvironment();
    env.addRelation(new Relation("Foo", new String[] {"Bar", "Baz"}));
   
    FPLParser parser = new FPLParser(string, env, new StubIType());
    RelEffect effect = parser.relEffect();
   
    Assert.assertEquals("Effect type is wrong", RelEffect.EffectType.REMOVE, effect.getType());
View Full Code Here


  @Test
  public void testTestEffect() throws ParseException {
    String string = "?Foo(a, b):c";
    RelationsEnvironment env = new RelationsEnvironment();
    env.addRelation(new Relation("Foo", new String[] {"Bar", "Baz"}));
   
    FPLParser parser = new FPLParser(string, env, new StubIType());
    RelEffect effect = parser.relEffect();
   
    Assert.assertEquals("Effect type is wrong", RelEffect.EffectType.TEST, effect.getType());
View Full Code Here

  }

  @Test
  public void testNegTestEffect() throws ParseException {
    String string = "?!Foo(a, b):c";
    RelationsEnvironment env = new RelationsEnvironment();
    env.addRelation(new Relation("Foo", new String[] {"Bar", "Baz"}));
   
    FPLParser parser = new FPLParser(string, env, new StubIType());
    RelEffect effect = parser.relEffect();
   
    Assert.assertEquals("Effect type is wrong", RelEffect.EffectType.NEG_TEST, effect.getType());
View Full Code Here

public class ParseTestPredicate
  @Test
  public void testTestPosPosPred() throws ParseException {
    String string = "?Foo(a, b) : c";
    RelationsEnvironment env = new RelationsEnvironment();
    env.addRelation(new Relation("Foo", new String[] {"Bar", "Baz"}));
   
    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);
View Full Code Here


  @Test
  public void testTestNegPosPred() throws ParseException {
    String string = "?Foo(a, b) : !c";
    RelationsEnvironment env = new RelationsEnvironment();
    env.addRelation(new Relation("Foo", new String[] {"Bar", "Baz"}));
   
    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);
View Full Code Here

  }
 
  @Test
  public void testTestPosNegPred() throws ParseException {
    String string = "?!Foo(a, b) : c";
    RelationsEnvironment env = new RelationsEnvironment();
    env.addRelation(new Relation("Foo", new String[] {"Bar", "Baz"}));
   
    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);
View Full Code Here

TOP

Related Classes of edu.cmu.cs.fusion.RelationsEnvironment

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.