fail("Not yet implemented"); // TODO
}
public void testLogicalOr() {
ExpressionParser parser = null;
Boolean boolResult = null;
parser = new ExpressionParser("var1 || var2", Boolean.class);
parser.createVariable("var1", Boolean.class, Boolean.FALSE);
parser.createVariable("var2", Boolean.class, Boolean.FALSE);
try
{
//initial state
boolResult = (Boolean)parser.evaluate();
Assert.assertNotNull(boolResult);
Assert.assertEquals(false, boolResult.booleanValue());
//evaluate (false || false)
parser.set("var1", Boolean.FALSE);
parser.set("var2", Boolean.FALSE);
boolResult = (Boolean)parser.evaluate();
Assert.assertNotNull(boolResult);
Assert.assertEquals(false, boolResult.booleanValue());
//evaluate (false || true)
parser.set("var1", Boolean.FALSE);
parser.set("var2", Boolean.TRUE);
boolResult = (Boolean)parser.evaluate();
Assert.assertNotNull(boolResult);
Assert.assertEquals(true, boolResult.booleanValue());
//evaluate (true || false)
parser.set("var1", Boolean.TRUE);
parser.set("var2", Boolean.FALSE);
boolResult = (Boolean)parser.evaluate();
Assert.assertNotNull(boolResult);
Assert.assertEquals(true, boolResult.booleanValue());
//evaluate (true || true)
parser.set("var1", Boolean.TRUE);
parser.set("var2", Boolean.TRUE);
boolResult = (Boolean)parser.evaluate();
Assert.assertNotNull(boolResult);
Assert.assertEquals(true, boolResult.booleanValue());
}
catch(Exception ex)
{