Search in sources :

Example 1 with AndExpression

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

Example 2 with AndExpression

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

Example 3 with AndExpression

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

the class ExpressionInfoTests method testAndExpression.

public void testAndExpression() throws Exception {
    AndExpression and = new AndExpression();
    assertNoAccess(and.computeExpressionInfo());
    and.add(new CountExpression("10"));
    assertDefaultAccessOnly(and.computeExpressionInfo());
}
Also used : AndExpression(org.eclipse.core.internal.expressions.AndExpression) CountExpression(org.eclipse.core.internal.expressions.CountExpression)

Aggregations

AndExpression (org.eclipse.core.internal.expressions.AndExpression)3 InstanceofExpression (org.eclipse.core.internal.expressions.InstanceofExpression)2 CountExpression (org.eclipse.core.internal.expressions.CountExpression)1