This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 194809

Summary: Typing Hooks API doesn't provide API to create tests
Product: editor Reporter: Vladimir Voskresensky <vv159170>
Component: Formatting & IndentationAssignee: Dusan Balek <dbalek>
Status: RESOLVED WORKSFORME    
Severity: normal CC: issues
Priority: P2    
Version: 7.0   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:
Bug Depends on:    
Bug Blocks: 152655    

Description Vladimir Voskresensky 2011-01-28 12:45:58 UTC
we shifted to new Hooks API, but we can not migrate our unit tests, because no way to create *Context objects.

based on discussion with David, Jan, and Alexander:
Creating the Context(s) should be possible using:
org.netbeans.modules.editor.lib2.typinghooks.TypingHooksSpiAccessor.get().create*Context(...)

Please, provide access to it from tests

Thanks,
Vladimir.
Comment 1 Vladimir Voskresensky 2011-01-28 14:57:25 UTC
as Jan pointed out it should already work from test packages:
The TypingHooksSpiAccessor is a public class, and the methods are public, so these are accessible from anywhere in the unit tests (there are no module level access restrictions inside unit tests). Of course the accessor's method may change, but if that is likely to only require simple updates in the tests.