final XNameReplace events = UnoRuntime.queryInterface( XNameReplace.class, eventSupplier.getEvents() );
final NamedValue[] scriptDescriptor = new NamedValue[] {
new NamedValue( "EventType", "Script" ),
new NamedValue( "Script", scriptURI )
};
events.replaceByName( "OnViewCreated", scriptDescriptor );
// The below doesn't work: event notification is broken in m96, see http://www.openoffice.org/issues/show_bug.cgi?id=116313
m_callbackCalled = false;
m_currentDocument.getCurrentView().dispatch( ".uno:NewWindow" );
assertTrue( "triggering an event did not work as expected - basic script not called", m_callbackCalled );