OracleWriter ow = new OracleWriter(); ow.write(query); String oraResult = compare("oracle-se/" + name + ".op", ow.getSQL());   PostgresWriter pw = new PostgresWriter(); pw.write(query); String pgResult = compare("postgres/" + name + ".op", pw.getSQL());  if (oraResult != null || pgResult != null) { fail(oraResult + "\n\n" + pgResult); }
doTest(name, query);
    private void doTest(String name, String typeName, String[] properties) {        Root root = Root.getRoot();        ObjectType type = root.getObjectType(typeName);        assertTrue("No such type: " + typeName, type != null);        Signature sig = new Signature(type);        Query query = new Query(sig, null);        if (properties == null) {            sig.addDefaultProperties();        } else {            for (int i = 0; i < properties.length; i++) {                Path path = Path.get(properties[i]);                sig.addPath(path);                sig.addDefaultProperties(path);            }        }        // Test oracle specific syntax.        OracleWriter ow = new OracleWriter();        ow.write(query);        String oraResult = compare("oracle-se/" + name + ".op", ow.getSQL());        // Test pg syntax.        PostgresWriter pw = new PostgresWriter();        pw.write(query);        String pgResult = compare("postgres/" + name + ".op", pw.getSQL());        if (oraResult != null || pgResult != null) {            fail(oraResult + "\n\n" + pgResult);        }    }