use of org.eclipse.core.internal.expressions.InstanceofExpression in project eclipse.platform.runtime by eclipse.
the class ExpressionTests method testAdaptExpressionHashCode.
public void testAdaptExpressionHashCode() throws Exception {
AdaptExpression expression1 = new AdaptExpression(// $NON-NLS-1$
"org.eclipse.core.internal.expressions.tests.Adapter");
expression1.add(new InstanceofExpression(// $NON-NLS-1$
"org.eclipse.core.internal.expressions.tests.Adapter"));
AdaptExpression expression2 = new AdaptExpression(// $NON-NLS-1$
"org.eclipse.core.internal.expressions.tests.Adapter");
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 testEnablementExpressionNotEqual.
public void testEnablementExpressionNotEqual() throws Exception {
EnablementExpression expression1 = new EnablementExpression((IConfigurationElement) null);
expression1.add(new InstanceofExpression(// $NON-NLS-1$
"org.eclipse.core.internal.expressions.tests.Adapter1"));
EnablementExpression expression2 = new EnablementExpression((IConfigurationElement) null);
expression2.add(new InstanceofExpression(// $NON-NLS-1$
"org.eclipse.core.internal.expressions.tests.Adapter2"));
assertTrue("These enablement 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 testResolveExpressionHashCode.
public void testResolveExpressionHashCode() throws Exception {
ResolveExpression expression1 = new ResolveExpression("variable", new Object[0]);
expression1.add(new InstanceofExpression(// $NON-NLS-1$
"org.eclipse.core.internal.expressions.tests.Adapter"));
ResolveExpression expression2 = new ResolveExpression("variable", new Object[0]);
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 testAdaptExpressionFail2.
public void testAdaptExpressionFail2() 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.NotExisting"));
EvaluationResult result = expression.evaluate(new EvaluationContext(null, new Adaptee()));
assertTrue(result == EvaluationResult.FALSE);
}
use of org.eclipse.core.internal.expressions.InstanceofExpression 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));
}
Aggregations