|
[OCP 17 book] | [OCP 11 book] | [OCA 8 book] [OCP 8 book] [Practice tests book] [Blog] [JavaRanch FAQ] [How To Ask Questions] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Originally posted by s penumudi:
Originally posted by s penumudi:
There is one more thing. If I am not able to test the this method out of application server, then I will end up testing all my other class that makes use of this class to be tested in Application server. I cannot write test cases for them. These classes are simple POJO which I am using as utility classes that gets decode table data from the database.
Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Sure you can. What makes you think that it couldn't be done? Would you like to post a code snippet again?Originally posted by s penumudi:
I guess I cannot use the same strategy for some of the queries where I want to run them in a loop where I will be using prepared statements.
Originally posted by s penumudi:
I also want to test all possible SqlExceptions. Do you have any reference where I can get all the possible errorcodes for SQL like Duplicate record, connection cannot be established, too many parameters, etc.,
Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Destroy anything that stands in your way. Except this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
|