Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
Adding test cases.
  • Loading branch information
arulsmv committed Apr 9, 2020
1 parent 666cf01 commit 450dca0
Showing 1 changed file with 22 additions and 0 deletions.
Expand Up @@ -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" );
Expand Down

0 comments on commit 450dca0

Please sign in to comment.