Пример #1
0
 public void testStaticMethods() throws Exception {
   XbaseScopeProvider provider = get(XbaseScopeProvider.class);
   XExpression expression = expression("'x' != 'y'", true);
   IScope scope =
       provider.getScope(expression, XbasePackage.Literals.XABSTRACT_FEATURE_CALL__FEATURE);
   final List<IEObjectDescription> allElements = newArrayList(scope.getAllElements());
   try {
     find(
         allElements,
         new Predicate<IEObjectDescription>() {
           public boolean apply(IEObjectDescription input) {
             return input.getName().toString().equals("!=");
           }
         });
   } catch (NoSuchElementException e) {
     fail("operator not found : " + allElements.toString());
   }
   try {
     find(
         allElements,
         new Predicate<IEObjectDescription>() {
           public boolean apply(IEObjectDescription input) {
             return input.getName().toString().equals("-");
           }
         });
     fail("operator + is not defined for type string");
   } catch (NoSuchElementException e) {
     // expected
   }
 }