diff --git a/test/adql/parser/TestADQLParser.java b/test/adql/parser/TestADQLParser.java index b6883386b203d8681111d0bb07338f415c38519e..fcf230ac263d5f725d2cfbde3bef48bace481493 100644 --- a/test/adql/parser/TestADQLParser.java +++ b/test/adql/parser/TestADQLParser.java @@ -645,25 +645,16 @@ public class TestADQLParser { for(ADQLVersion version : ADQLVersion.values()) { ADQLParser parser = new ADQLParser(version); -<<<<<<< HEAD - // CASE: Invalid UDF name => ParseException - final String[] functionsToTest = new String[]{ "_foo", "2do", "do!" }; - for(String fct : functionsToTest){ - try{ - parser.parseQuery("SELECT " + fct + "(p1,p2) FROM aTable"); - fail("A UDF name like \"" + fct + "\" is not allowed by the ADQL grammar. This query should not pass."); -======= // CASE: Valid UDF name => OK try { parser.parseQuery("SELECT foo(p1,p2) FROM aTable"); ->>>>>>> [ADQL] 4 commits in one: 1/ new syntax of ORDER and GROUP BY, 2/ fix positions } catch(Throwable t) { t.printStackTrace(); fail("Unexpected parsing error! This query should have passed. (see console for more details)"); } // CASE: Invalid UDF name => ParseException - final String[] functionsToTest = new String[]{ "_foo", "2do", "do!" }; + final String[] functionsToTest = new String[]{ "_foo", "2do", "do?" }; for(String fct : functionsToTest) { try { parser.parseQuery("SELECT " + fct + "(p1,p2) FROM aTable"); diff --git a/test/adql/translator/TestJDBCTranslator.java b/test/adql/translator/TestJDBCTranslator.java index 08504ee5dc8fa9b57e432924f68360e192efd940..3b31519206cd841d0984867952c84d9d780e44e4 100644 --- a/test/adql/translator/TestJDBCTranslator.java +++ b/test/adql/translator/TestJDBCTranslator.java @@ -1,7 +1,6 @@ package adql.translator; import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; @@ -26,8 +25,8 @@ import adql.query.ADQLQuery; import adql.query.ClauseADQL; import adql.query.IdentifierField; import adql.query.WithItem; +import adql.query.operand.ADQLColumn; import adql.query.operand.ADQLOperand; -import adql.query.operand.NumericConstant; import adql.query.operand.StringConstant; import adql.query.operand.function.DefaultUDF; import adql.query.operand.function.InUnitFunction; @@ -157,7 +156,7 @@ public class TestJDBCTranslator { * particularly, ' should be escaped otherwise it would mean the end of * a string in SQL (the way to escape a such character is by doubling * the character '): */ - try{ + try { assertEquals("'SQL''s translation'", tr.translate(new StringConstant("SQL's translation"))); } catch(TranslationException e) { e.printStackTrace(System.err);