Java Result Not Thrown. The method javaxpersistenceQuerygetSingleResult is very strict in its usage. Examples and practices described in this page dont take advantage of improvements introduced in later releases and might use technology no longer available.
Any invocation of a ResultSet method which requires a current row will result in a SQLException being thrown. However I could not find any exception class with this meaning in the standard java library. Examples and practices described in this page dont take advantage of improvements introduced in later releases and might use technology no longer available.
In JUnit 3 or more exactly in any versions of JUnit you can always use Javas try-catch structure to test exception.
3 First element value. The method javaxpersistenceQuerygetSingleResult is very strict in its usage. If the caller of that method does not handle the exception then it propagates to one level higher in the method call stack to the previous caller and similarly till it reaches base of the the method call stack which will be the javas runtime system. Thrown by the persistence provider when getSingleResult is executed on a query and there is no result to return.