| Summary: | Provide mock tests of exceptional flows | ||
|---|---|---|---|
| Product: | [Modeling] EMF | Reporter: | Andre Dietisheim <adietish> |
| Component: | cdo.net4j | Assignee: | Andre Dietisheim <adietish> |
| Status: | CLOSED WONTFIX | QA Contact: | |
| Severity: | enhancement | ||
| Priority: | P3 | CC: | stepper |
| Version: | 4.1 | ||
| Target Milestone: | --- | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
| Bug Depends on: | |||
| Bug Blocks: | 262875 | ||
|
Description
Andre Dietisheim
while trying implement the first test I tried to mock java.nio.Buffer. There are several problems here. 1.) The constructor has package private acces, so an instance may only be created with the tricks mock frameworks offer (serialisation, etc.). The mock framework we've chosen so far - the class extension to EasyMock - instantiates those classes flawlessly. 2.) several methods are final and easymock (which uses cglib behind the scenes) cannot override/mock them. I checked for alternatives and I suggest either: 1.) Replace direct java.nio.Buffer usage by a delegation. I'm not very fund of this approach, I thinks that the code should not adapt to testing needs. 2.) Use an alternative mocking framework. The 'problems' we have here is bringing it to orbit and maintain it. I think this should be worth it. Ok, can you choose an alternative library and check that it fulfills our needs? yes, I did some research and my favorite candidates for alternative mocking frameworks are 1.) https://jmockit.dev.java.net/ (which shall be used in addition to easymock) 2.) http://code.google.com/p/powermock/ which is uses easymock behind the scenes I'll test'em and let you know which one fits best. Any comments so far? Rebasing all unresolved enhancement requests to 3.0 Rebasing all outstanding enhancements requests to version 4.0 Moving all open enhancement requests to 4.1 No interest for years. WONTFIX. Closing. |