use of org.eclipse.core.internal.expressions.InstanceofExpression in project eclipse.platform.runtime by eclipse.
the class ExpressionTests method testNotExpressionHashCode.
public void testNotExpressionHashCode() throws Exception {
NotExpression expression1 = new NotExpression(new InstanceofExpression("org.eclipse.core.internal.expressions.tests.Adapter"));
NotExpression expression2 = new NotExpression(new InstanceofExpression("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 testWithExpressionNotEqual.
public void testWithExpressionNotEqual() throws Exception {
WithExpression expression1 = new WithExpression("variable1");
expression1.add(new InstanceofExpression(// $NON-NLS-1$
"org.eclipse.core.internal.expressions.tests.Adapter1"));
WithExpression expression2 = new WithExpression("variable2");
expression2.add(new InstanceofExpression(// $NON-NLS-1$
"org.eclipse.core.internal.expressions.tests.Adapter2"));
assertTrue("These with 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 testAdaptExpression.
public void testAdaptExpression() 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 Adaptee()));
assertTrue(result == EvaluationResult.TRUE);
}
use of org.eclipse.core.internal.expressions.InstanceofExpression in project eclipse.platform.runtime by eclipse.
the class ExpressionTests method testAndExpressionNotEqual.
public void testAndExpressionNotEqual() throws Exception {
AndExpression expression1 = new AndExpression();
expression1.add(new InstanceofExpression(// $NON-NLS-1$
"org.eclipse.core.internal.expressions.tests.Adapter1"));
AndExpression expression2 = new AndExpression();
expression2.add(new InstanceofExpression(// $NON-NLS-1$
"org.eclipse.core.internal.expressions.tests.Adapter2"));
assertTrue("These and 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 testInstanceOfExpressionHashCode.
public void testInstanceOfExpressionHashCode() throws Exception {
InstanceofExpression expression1 = new InstanceofExpression("*");
InstanceofExpression expression2 = new InstanceofExpression("*");
assertEquals("Equal expressions should have the same hash code", expression1.hashCode(), expression2.hashCode());
}
Aggregations