Search in sources :

Example 1 with NotExpression

use of org.eclipse.core.internal.expressions.NotExpression 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));
}
Also used : InstanceofExpression(org.eclipse.core.internal.expressions.InstanceofExpression) NotExpression(org.eclipse.core.internal.expressions.NotExpression)

Example 2 with NotExpression

use of org.eclipse.core.internal.expressions.NotExpression 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());
}
Also used : InstanceofExpression(org.eclipse.core.internal.expressions.InstanceofExpression) NotExpression(org.eclipse.core.internal.expressions.NotExpression)

Aggregations

InstanceofExpression (org.eclipse.core.internal.expressions.InstanceofExpression)2 NotExpression (org.eclipse.core.internal.expressions.NotExpression)2