/*
* This will test equals for string arguments.
*/
public void testEqualExpressionWithStringArguments() {
//HashMap map = new HashMap();
propertySensor1=new StringConstant("test");
propertySensor2=new StringConstant("testing");
propertySensor3=new StringConstant("test");
//SensorLookup lookup = new SensorLookupImpl(map);
try {
// Property1 != Property2
Vector v = new Vector();
v.add(propertySensor1);
v.add(propertySensor2);
Expression firstExpression = new Equal(v,true);
// Property1 == Property3
v.clear();
v.add(propertySensor1);
v.add(propertySensor3);
Expression secondExpression = new Equal(v,true);
// Property1 == StringConstant("test");
v.clear();
v.add(propertySensor1);
v.add(new StringConstant("test"));
Expression thirdExpression = new Equal(v,true);
// StringConstant("test") != StringConstant("testing")
v.clear();
v.add(new StringConstant("test"));
v.add(new StringConstant("testing"));
Expression fourthExpression = new Equal(v,true);
assertFalse(
((Boolean) firstExpression.evaluate()).booleanValue());
assertTrue(