Search in sources :

Example 6 with AdaptExpression

use of org.eclipse.core.internal.expressions.AdaptExpression in project eclipse.platform.runtime by eclipse.

the class ExpressionTests method testAdaptExpressionFail.

public void testAdaptExpressionFail() throws Exception {
    // $NON-NLS-1$
    AdaptExpression expression = new AdaptExpression("org.eclipse.core.internal.expressions.tests.NotExisting");
    EvaluationResult result = expression.evaluate(new EvaluationContext(null, new Adaptee()));
    assertTrue(result == EvaluationResult.FALSE);
}
Also used : IEvaluationContext(org.eclipse.core.expressions.IEvaluationContext) EvaluationContext(org.eclipse.core.expressions.EvaluationContext) AdaptExpression(org.eclipse.core.internal.expressions.AdaptExpression) EvaluationResult(org.eclipse.core.expressions.EvaluationResult)

Example 7 with AdaptExpression

use of org.eclipse.core.internal.expressions.AdaptExpression in project eclipse.platform.runtime by eclipse.

the class ExpressionTests method testAdaptExpressionNotEqual.

public void testAdaptExpressionNotEqual() throws Exception {
    AdaptExpression expression1 = new AdaptExpression(// $NON-NLS-1$
    "org.eclipse.core.internal.expressions.tests.Adapter");
    expression1.add(new InstanceofExpression(// $NON-NLS-1$
    "org.eclipse.core.internal.expressions.tests.Adapter1"));
    AdaptExpression expression2 = new AdaptExpression(// $NON-NLS-1$
    "org.eclipse.core.internal.expressions.tests.Adapter");
    expression2.add(new InstanceofExpression(// $NON-NLS-1$
    "org.eclipse.core.internal.expressions.tests.Adapter2"));
    assertTrue("These adapt expressions should not be equal", !expression1.equals(expression2));
}
Also used : InstanceofExpression(org.eclipse.core.internal.expressions.InstanceofExpression) AdaptExpression(org.eclipse.core.internal.expressions.AdaptExpression)

Aggregations

AdaptExpression (org.eclipse.core.internal.expressions.AdaptExpression)7 EvaluationContext (org.eclipse.core.expressions.EvaluationContext)5 EvaluationResult (org.eclipse.core.expressions.EvaluationResult)5 IEvaluationContext (org.eclipse.core.expressions.IEvaluationContext)5 InstanceofExpression (org.eclipse.core.internal.expressions.InstanceofExpression)5 IterateExpression (org.eclipse.core.internal.expressions.IterateExpression)1 WithExpression (org.eclipse.core.internal.expressions.WithExpression)1