use of org.eclipse.core.internal.expressions.InstanceofExpression in project eclipse.platform.runtime by eclipse.
the class ExpressionTests method testEnablementExpressionHashCode.
public void testEnablementExpressionHashCode() throws Exception {
EnablementExpression expression1 = new EnablementExpression((IConfigurationElement) null);
expression1.add(new InstanceofExpression(// $NON-NLS-1$
"org.eclipse.core.internal.expressions.tests.Adapter"));
EnablementExpression expression2 = new EnablementExpression((IConfigurationElement) null);
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 testIterateExpressionNotEqual.
public void testIterateExpressionNotEqual() throws Exception {
IterateExpression expression1 = new IterateExpression("or");
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"));
assertTrue("These iterate 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 testNotExpressionNotEqual.
public void testNotExpressionNotEqual() throws Exception {
NotExpression expression1 = new NotExpression(new InstanceofExpression("org.eclipse.core.internal.expressions.tests.Adapter1"));
NotExpression expression2 = new NotExpression(new InstanceofExpression("org.eclipse.core.internal.expressions.tests.Adapter2"));
assertTrue("These not 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 testAndExpressionHashCode.
public void testAndExpressionHashCode() throws Exception {
AndExpression expression1 = new AndExpression();
expression1.add(new InstanceofExpression(// $NON-NLS-1$
"org.eclipse.core.internal.expressions.tests.Adapter"));
AndExpression expression2 = new AndExpression();
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 testInstanceofFalse.
public void testInstanceofFalse() throws Exception {
A a = new A();
EvaluationContext context = new EvaluationContext(null, a);
// $NON-NLS-1$
InstanceofExpression exp = new InstanceofExpression("org.eclipse.core.internal.expressions.tests.B");
assertTrue(EvaluationResult.FALSE == exp.evaluate(context));
}
Aggregations