@Test
    public void testParse() throws ParseException, IOException {
        BufferedReader reader = new BufferedReader(new FileReader("src/tests/rankingexpression/rankingexpressionlist"));
        String line;
        int lineNumber = 0;
        while ((line = reader.readLine()) != null) {
            lineNumber++;
            if (line.length() == 0 || line.charAt(0) == '#') {
                continue;
            }
            String[] parts = line.split(";");
            // System.out.println("Parsing '" + parts[0].trim() + "'..");
            RankingExpression expression = new RankingExpression(parts[0].trim());

            String out = expression.toString();
            if (parts.length == 1) {
                assertEquals(parts[0].trim(), out);
            } else {
                boolean ok = false;
                String err = "Expression '" + out + "' not present in { ";
                for (int i = 1; i < parts.length && !ok; ++i) {
                    err += "'" + parts[i].trim() + "'";
                    if (parts[i].trim().equals(out)) {
                        ok = true;
                    }
                    if (i < parts.length - 1) {
                        err += ", ";
                    }
                }
                err += " }.";
                assertTrue("At line " + lineNumber + ": " + err, ok);
            }
        }
    }
@author Simon Thoresen Hult
@author bratseth
searchlib/src/test/java/com/yahoo/searchlib/rankingexpression/RankingExpressionTestCase.java