@@ -0,0 +1,1018 @@
+package org.flymine.sql.logging;%0A%0Aimport junit.framework.*;%0Aimport java.io.Writer;%0Aimport java.io.StringWriter;%0Aimport java.util.StringTokenizer;%0Aimport org.flymine.sql.query.*;%0A%0Apublic class QueryLoggerTest extends TestCase%0A%7B%0A    private Query q1;%0A%0A    public QueryLoggerTest(String arg1) %7B%0A        super(arg1);%0A    %7D%0A%0A    public void setUp() %7B%0A        q1 = new Query();%0A        Table t = new Table(%22mytable%22);%0A        Constant c = new Constant(%221%22);%0A        Field f = new Field(%22a%22, t);%0A        SelectValue sv = new SelectValue(f, null);%0A        q1.addFrom(t);%0A        q1.addSelect(sv);%0A        q1.addWhere(new Constraint(f, Constraint.EQ, c));%0A    %7D%0A%0A    public void testQuery() throws Exception %7B%0A        Writer w = new StringWriter();%0A        QueryLogger.log(q1, w);%0A        StringTokenizer st = new StringTokenizer(w.toString(), %22%5Ct%22, false);%0A        String date = st.nextToken();%0A        String query = st.nextToken();%0A%0A        assertEquals(%22SELECT mytable.a FROM mytable WHERE mytable.a = 1%22, query);%0A    %7D%0A%0A%7D%0A

Test class for QueryLogger