Search in sources :

Example 1 with OrExpression

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

Example 2 with OrExpression

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

the class ExpressionTests method testOrExpressionNotEqual.

public void testOrExpressionNotEqual() throws Exception {
    OrExpression expression1 = new OrExpression();
    expression1.add(new InstanceofExpression(// $NON-NLS-1$
    "org.eclipse.core.internal.expressions.tests.Adapter1"));
    OrExpression expression2 = new OrExpression();
    expression2.add(new InstanceofExpression(// $NON-NLS-1$
    "org.eclipse.core.internal.expressions.tests.Adapter2"));
    assertTrue("These or expressions should not be equal", !expression1.equals(expression2));
}
Also used : InstanceofExpression(org.eclipse.core.internal.expressions.InstanceofExpression) OrExpression(org.eclipse.core.internal.expressions.OrExpression)

Aggregations

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