MemActivityStore implements ActivityStore { protected static boolean evaluate(ActivityType activity, QuerySpec query) { boolean ret=false; if (query.getFormat() != null && query.getFormat().equalsIgnoreCase("mvel")) { Object result=MVEL.eval(query.getExpression(), activity); if (result instanceof Boolean) { ret = ((Boolean)result).booleanValue(); } } return (ret); }  void clear(); void store(List<ActivityUnit> activities); ActivityUnit getActivityUnit(String id); List<ActivityType> getActivityTypes(Context context); List<ActivityType> getActivityTypes(Context context, long from,
            long to); List<ActivityType> query(QuerySpec query);  }
@Test public void testEvaluateField() { RequestSent activity=new RequestSent(); activity.setOperation("myOp"); if (!MemActivityStore.evaluate(activity, new QuerySpec().setFormat("mvel"). setExpression("operation == 'myOp'"))) { fail("Failed to evaluate operation"); } }
@Test public void testEvaluateProperty() { RequestSent activity=new RequestSent(); activity.getProperties().put("testKey", "testValue"); if (!MemActivityStore.evaluate(activity, new QuerySpec().setFormat("mvel"). setExpression("properties.containsKey('testKey') && " +"properties.get('testKey').equals('testValue')"))) { fail("Failed to evaluate property"); } }