test case « junit « Java Testing Q&A

Home
Java Testing Q&A
1.Development
2.FindBugs
3.HTMLUnit
4.hudson
5.junit
6.performance
7.plugin
8.profile
9.selenium
10.Tools
11.unit test
Java Testing Q&A » junit » test case 

1. Can I test (junit) default case of switch-case statement ?    forums.oracle.com

Hi, I have a class which has switch-case statements and I am trying to junit test with 100% coverage. My switch-case workes based on enum values. say my enum values are 1, 2. switch(getEnumValues) { case 1: return "some value"; case 2: return "some value"; default: throw new UnsupportedOperationException("No such enum value supported."); } I have test case to test the ...

java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.