Search in sources :

Example 1 with ResolveExpression

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

the class ExpressionTests method testResolveExpressionNotEqual.

public void testResolveExpressionNotEqual() throws Exception {
    ResolveExpression expression1 = new ResolveExpression("variable1", new Object[0]);
    expression1.add(new InstanceofExpression(// $NON-NLS-1$
    "org.eclipse.core.internal.expressions.tests.Adapter1"));
    ResolveExpression expression2 = new ResolveExpression("variable2", new Object[0]);
    expression2.add(new InstanceofExpression(// $NON-NLS-1$
    "org.eclipse.core.internal.expressions.tests.Adapter2"));
    assertTrue("These resolve expressions should not be equal", !expression1.equals(expression2));
}
Also used : ResolveExpression(org.eclipse.core.internal.expressions.ResolveExpression) InstanceofExpression(org.eclipse.core.internal.expressions.InstanceofExpression)

Example 2 with ResolveExpression

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

the class ExpressionTests method testResolveExpressionHashCode.

public void testResolveExpressionHashCode() throws Exception {
    ResolveExpression expression1 = new ResolveExpression("variable", new Object[0]);
    expression1.add(new InstanceofExpression(// $NON-NLS-1$
    "org.eclipse.core.internal.expressions.tests.Adapter"));
    ResolveExpression expression2 = new ResolveExpression("variable", new Object[0]);
    expression2.add(new InstanceofExpression(// $NON-NLS-1$
    "org.eclipse.core.internal.expressions.tests.Adapter"));
    assertEquals("Equal expressions should have the same hash code", expression1.hashCode(), expression2.hashCode());
}
Also used : ResolveExpression(org.eclipse.core.internal.expressions.ResolveExpression) InstanceofExpression(org.eclipse.core.internal.expressions.InstanceofExpression)

Example 3 with ResolveExpression

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

the class ExpressionInfoTests method testResolveExpression.

public void testResolveExpression() {
    ResolveExpression resolve = new ResolveExpression("variable", null);
    assertNoAccess(resolve.computeExpressionInfo());
    resolve.add(new CountExpression("10"));
    assertVariableAccess(resolve.computeExpressionInfo(), "variable");
}
Also used : ResolveExpression(org.eclipse.core.internal.expressions.ResolveExpression) CountExpression(org.eclipse.core.internal.expressions.CountExpression)

Aggregations

ResolveExpression (org.eclipse.core.internal.expressions.ResolveExpression)3 InstanceofExpression (org.eclipse.core.internal.expressions.InstanceofExpression)2 CountExpression (org.eclipse.core.internal.expressions.CountExpression)1