use of org.eclipse.core.internal.expressions.InstanceofExpression in project eclipse.platform.runtime by eclipse.
the class ExpressionTests method testAdaptExpressionAdaptable.
public void testAdaptExpressionAdaptable() throws Exception {
// $NON-NLS-1$
AdaptExpression expression = new AdaptExpression("org.eclipse.core.internal.expressions.tests.Adapter");
// $NON-NLS-1$
expression.add(new InstanceofExpression("org.eclipse.core.internal.expressions.tests.Adapter"));
EvaluationResult result = expression.evaluate(new EvaluationContext(null, new AdaptableAdaptee()));
assertTrue(result == EvaluationResult.TRUE);
}
use of org.eclipse.core.internal.expressions.InstanceofExpression in project eclipse.platform.runtime by eclipse.
the class ExpressionTests method testWithExpressionHashCode.
public void testWithExpressionHashCode() throws Exception {
WithExpression expression1 = new WithExpression("variable");
expression1.add(new InstanceofExpression(// $NON-NLS-1$
"org.eclipse.core.internal.expressions.tests.Adapter"));
WithExpression expression2 = new WithExpression("variable");
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());
}
use of org.eclipse.core.internal.expressions.InstanceofExpression 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));
}
use of org.eclipse.core.internal.expressions.InstanceofExpression in project eclipse.platform.runtime by eclipse.
the class ExpressionTests method testIterateExpressionHashCode.
public void testIterateExpressionHashCode() throws Exception {
IterateExpression expression1 = new IterateExpression("and");
expression1.add(new InstanceofExpression(// $NON-NLS-1$
"org.eclipse.core.internal.expressions.tests.Adapter"));
IterateExpression expression2 = new IterateExpression("and");
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());
}
use of org.eclipse.core.internal.expressions.InstanceofExpression in project eclipse.platform.runtime by eclipse.
the class ExpressionTests method testOrExpressionHashCode.
public void testOrExpressionHashCode() throws Exception {
OrExpression expression1 = new OrExpression();
expression1.add(new InstanceofExpression(// $NON-NLS-1$
"org.eclipse.core.internal.expressions.tests.Adapter"));
OrExpression expression2 = new OrExpression();
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());
}
Aggregations