Examples of ExprStdLib


Examples of org.jresearch.flexess.models.expression.stdlib.ExprStdLib

  protected void tearDown() throws Exception {
    setFixture(null);
  }

  public void testOr__EList() {
    ExprStdLib tested = getFixture();
   
    // For all types
    for(EDataType type : typesAndValues.keySet()){
     
      // Test 1-1 = true
      EList args = new BasicEList();     
      args.add(createEqOperation(type, true, false));
      args.add(createNeqOperation(type, true, true));     
      assertTrue(tested.or(args));
     
      // Test 1-0 = true
      args = new BasicEList();     
      args.add(createEqOperation(type, true, false));
      args.add(createNeqOperation(type, false, true));     
      assertTrue(tested.or(args));
     
      // Test 0-1 = true
      args = new BasicEList();     
      args.add(createEqOperation(type, false, false));
      args.add(createNeqOperation(type, true, true));     
      assertTrue(tested.or(args));
     
      // Test 0-0 = false
      args = new BasicEList();     
      args.add(createEqOperation(type, false, false));
      args.add(createNeqOperation(type, false, true));     
      assertFalse(tested.or(args));     
    }
  }
View Full Code Here

Examples of org.jresearch.flexess.models.expression.stdlib.ExprStdLib

    }
  }


  public void testAnd__EList() {     
    ExprStdLib tested = getFixture();
   
    // For all types
    for(EDataType type : typesAndValues.keySet()){
     
      // Test 1-1 = true
      EList args = new BasicEList();     
      args.add(createEqOperation(type, true, false));
      args.add(createNeqOperation(type, true, true));     
      assertTrue(tested.and(args));
     
      // Test 1-0 = false
      args = new BasicEList();     
      args.add(createEqOperation(type, true, false));
      args.add(createNeqOperation(type, false, true));     
      assertFalse(tested.and(args));
     
      // Test 0-1 = false
      args = new BasicEList();     
      args.add(createEqOperation(type, false, false));
      args.add(createNeqOperation(type, true, true));     
      assertFalse(tested.and(args));
     
      // Test 0-0 = false
      args = new BasicEList();     
      args.add(createEqOperation(type, false, false));
      args.add(createNeqOperation(type, false, true));     
      assertFalse(tested.and(args));     
    }
  }
View Full Code Here

Examples of org.jresearch.flexess.models.expression.stdlib.ExprStdLib

      assertFalse(tested.and(args));     
    }
  }

  public void testEq__Object_Object() {
    ExprStdLib tested = getFixture();
   
    // For all types
    for(EDataType type : typesAndValues.keySet()){
     
      // Test a = a           
      OperationCall call = createEqOperation(type, true, false);
      assertTrue(tested.eq(ExpressionUtils.getLeftArg(call), ExpressionUtils.getRightArg(call)));
      call = createEqOperation(type, true, true);
      assertTrue(tested.eq(ExpressionUtils.getLeftArg(call), ExpressionUtils.getRightArg(call)));
     
//       Test a != b           
      call = createEqOperation(type, false, false);
      assertFalse(tested.eq(ExpressionUtils.getLeftArg(call), ExpressionUtils.getRightArg(call)));
      call = createEqOperation(type, false, true);
      assertFalse(tested.eq(ExpressionUtils.getLeftArg(call), ExpressionUtils.getRightArg(call)));     
    }
  }
View Full Code Here

Examples of org.jresearch.flexess.models.expression.stdlib.ExprStdLib

      assertFalse(tested.eq(ExpressionUtils.getLeftArg(call), ExpressionUtils.getRightArg(call)));     
    }
  }

  public void testNotEq__Object_Object() {
    ExprStdLib tested = getFixture();
   
    // For all types
    for(EDataType type : typesAndValues.keySet()){
     
      // Test a != b = true           
      OperationCall call = createNeqOperation(type, true, false);
      assertTrue(tested.notEq(ExpressionUtils.getLeftArg(call), ExpressionUtils.getRightArg(call)));
      call = createNeqOperation(type, true, true);
      assertTrue(tested.notEq(ExpressionUtils.getLeftArg(call), ExpressionUtils.getRightArg(call)));
     
      // Test a == b = false           
      call = createNeqOperation(type, false, false);
      assertFalse(tested.notEq(ExpressionUtils.getLeftArg(call), ExpressionUtils.getRightArg(call)));
      call = createNeqOperation(type, false, true);
      assertFalse(tested.notEq(ExpressionUtils.getLeftArg(call), ExpressionUtils.getRightArg(call)));     
    }
  }
View Full Code Here

Examples of org.jresearch.flexess.models.expression.stdlib.ExprStdLib

    //
    if (args.length == 0) {
      System.out.println("Enter a list of file paths or URIs that have content like this:");
      try {
        Resource resource = resourceSet.createResource(URI.createURI("http:///My.stdlib"));
        ExprStdLib root = StdlibFactory.eINSTANCE.createExprStdLib();
        resource.getContents().add(root);
        resource.save(System.out, null);
      }
      catch (IOException exception) {
        exception.printStackTrace();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.