@Test public void testRewriteCrit_formatDouble() throws Exception {
String original = "formatDouble(convert(pm1.g1.e4, double), '$#,##0.00') = '$1,234.50'"; //$NON-NLS-1$
String expected = "pm1.g1.e4 = '1234.5'"; //$NON-NLS-1$
FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
Criteria origCrit = parseCriteria(original, metadata);
Criteria expectedCrit = parseCriteria(expected, metadata);
((CompareCriteria)expectedCrit).setRightExpression(new Constant(new Double(1234.5)));
// rewrite
Criteria actual = QueryRewriter.rewriteCriteria(origCrit, null, null, null);
assertEquals("Did not rewrite correctly: ", expectedCrit, actual); //$NON-NLS-1$
}