Add files via upload

Adding test cases.
This commit is contained in:
arulsmv 2020-04-09 21:47:26 +05:30 committed by GitHub
parent 666cf0186a
commit 450dca0629
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 22 additions and 0 deletions

View File

@ -270,6 +270,28 @@ public class HqlParserTest {
+ "order by account.type.sortOrder, account.accountNumber, payment.dueDate" );
}
@Test public void testJoinNoQuotePackageStartswithINThrowsException() throws Exception {
String query = "select t.firstName, t.lastName, e.numberOfClassesPending \n" +
"from in.musicmaster.db.Models.TutorData as t \n" +
"join in.musicmaster.db.Models.EnrollmentData as e on e.tutorId = t.tutorId";
HqlParser parser = HqlParser.getInstance( query );
parser.setFilter( false );
parser.statement();
assertEquals( "Invalid Token in", 1, parser.getParseErrorHandler().getErrorCount() );
}
@Test public void testJoinQuotedPackageStartswithIN() throws Exception {
parse("select t.firstName, t.lastName, e.numberOfClassesPending \n" +
"from in.musicmaster.db.Models.TutorData as t \n" +
"join 'in.musicmaster.db.Models.EnrollmentData' as e on e.tutorId = t.tutorId");
}
@Test public void testJoin() throws Exception {
parse("select t.firstName, t.lastName, e.numberOfClassesPending \n" +
"from TutorData as t \n" +
"join EnrollmentData as e on e.tutorId = t.tutorId");
}
@Test public void testExamples1() throws Exception {
parse( "select new org.hibernate.test.S(s.count, s.address)\n"
+ "from s in class Simple" );