Package edu.cmu.cs.fusion

Examples of edu.cmu.cs.fusion.Relation


 
  static ObjectLabel w, x, y, z;

  @BeforeClass
  static public void testRelationships() {
    tA = new Relation("A", new String[] {"Foo", "Bar"});
    tB = new Relation("B", new String[] {"Bar", "Bar"});
   
    w = new AbstractObjectLabel("w");
    x = new AbstractObjectLabel("x");
    y = new AbstractObjectLabel("y");
    z = new AbstractObjectLabel("z");
View Full Code Here


 
  @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

  static ObjectLabel w, x, y, z;

  @BeforeClass
  static public void testRelationships() {
    RelationshipDelta delta;
    tA = new Relation("A", new String[] {"Foo", "Bar"});
    tB = new Relation("B", new String[] {"Bar", "Bar"});
   
    w = new AbstractObjectLabel("w");
    x = new AbstractObjectLabel("x");
    y = new AbstractObjectLabel("y");
    z = new AbstractObjectLabel("z");
View Full Code Here

 
  @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

    aliases = new TestAliasContext[2];
   
    RelationshipDelta delta;
    TestAliasContext aliasContext;
   
    relations[0] = new Relation("A", new String[] {"Foo", "Bar"});
    relations[1] = new Relation("B", new String[] {"Bar", "Bar"});
    relations[2] = new Relation("C", new String[] {"Bar", "Bazar"});
 
    labels[0] = new AbstractObjectLabel("w", "Bar");
    labels[1] = new AbstractObjectLabel("x");
    labels[2] = new AbstractObjectLabel("y", "Foo");
    labels[3] = new AbstractObjectLabel("z");
View Full Code Here

TOP

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

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.