Search in sources :

Example 1 with SystemTestExpression

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

the class ExpressionTests method testSystemTestExpressionHashCode.

public void testSystemTestExpressionHashCode() throws Exception {
    SystemTestExpression expression1 = new SystemTestExpression("prop", "value");
    SystemTestExpression expression2 = new SystemTestExpression("prop", "value");
    assertEquals("Equal expressions should have the same hash code", expression1.hashCode(), expression2.hashCode());
}
Also used : SystemTestExpression(org.eclipse.core.internal.expressions.SystemTestExpression)

Example 2 with SystemTestExpression

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

the class ExpressionTests method testSystemProperty.

public void testSystemProperty() throws Exception {
    // $NON-NLS-1$ //$NON-NLS-2$
    SystemTestExpression expression = new SystemTestExpression("os.name", System.getProperty("os.name"));
    EvaluationResult result = expression.evaluate(new EvaluationContext(null, new Object()));
    assertTrue(result == EvaluationResult.TRUE);
}
Also used : SystemTestExpression(org.eclipse.core.internal.expressions.SystemTestExpression) IEvaluationContext(org.eclipse.core.expressions.IEvaluationContext) EvaluationContext(org.eclipse.core.expressions.EvaluationContext) EvaluationResult(org.eclipse.core.expressions.EvaluationResult)

Example 3 with SystemTestExpression

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

the class ExpressionTests method testSystemTestExpressionNotEqual.

public void testSystemTestExpressionNotEqual() throws Exception {
    SystemTestExpression expression1 = new SystemTestExpression("prop", "value1");
    SystemTestExpression expression2 = new SystemTestExpression("prop", "value2");
    assertTrue("These system test expressions should not be equal", !expression1.equals(expression2));
}
Also used : SystemTestExpression(org.eclipse.core.internal.expressions.SystemTestExpression)

Aggregations

SystemTestExpression (org.eclipse.core.internal.expressions.SystemTestExpression)3 EvaluationContext (org.eclipse.core.expressions.EvaluationContext)1 EvaluationResult (org.eclipse.core.expressions.EvaluationResult)1 IEvaluationContext (org.eclipse.core.expressions.IEvaluationContext)1