/** * Clears the accumulated script error messages. */ public static void clearScriptErrorMessages() { getScriptingEngine().clearErrorMessages(); }
/** * Returns the delegate which supports scripting this element. */ public ScriptingHandler getScriptingHandler() { if (_scriptable == null) { _scriptable = HttpUnitOptions.getScriptingEngine().createHandler( this ); } return _scriptable; }
/** * Returns the accumulated script error messages encountered. Error messages are accumulated only * if 'throwExceptionsOnError' is disabled. */ public static String[] getScriptErrorMessages() { return getScriptingEngine().getErrorMessages(); }
public static ScriptingEngineFactory getScriptingEngine() { if (_scriptingEngine == null) { try { Class factoryClass = Class.forName( _scriptEngineClassName ); final ScriptingEngineFactory factory = (ScriptingEngineFactory) factoryClass.newInstance(); _scriptingEngine = factory.isEnabled() ? factory : NULL_SCRIPTING_ENGINE_FACTORY; _scriptingEngine.setThrowExceptionsOnError( _exceptionsThrownOnScriptError ); } catch (ClassNotFoundException e) { disableScripting( e, "Unable to find scripting engine factory class " ); } catch (InstantiationException e) { disableScripting( e, "Unable to instantiate scripting engine factory class " ); } catch (IllegalAccessException e) { disableScripting( e, "Unable to create scripting engine factory class " ); } } return _scriptingEngine; }
FrameHolder( WebWindow window ) { _window = window; _topFrame = FrameSelector.newTopFrame( window ); DefaultWebResponse blankResponse = new DefaultWebResponse( window.getClient(), null, WebResponse.BLANK_HTML ); _contents.put( _topFrame, blankResponse ); HttpUnitOptions.getScriptingEngine().associate( blankResponse ); }
/** * Determines whether script errors result in exceptions or warning messages. */ public static void setExceptionsThrownOnScriptError( boolean throwExceptions ) { _exceptionsThrownOnScriptError = throwExceptions; getScriptingEngine().setThrowExceptionsOnError( throwExceptions ); }
void runScripts() throws SAXException { for (Iterator iterator = _newResponses.iterator(); iterator.hasNext();) { WebResponse response = (WebResponse) iterator.next(); HttpUnitOptions.getScriptingEngine().load( response ); } } }
public static ScriptingEngineFactory getScriptingEngine() { if (_scriptingEngine == null) { try { Class factoryClass = Class.forName( _scriptEngineClassName ); final ScriptingEngineFactory factory = (ScriptingEngineFactory) factoryClass.newInstance(); _scriptingEngine = factory.isEnabled() ? factory : NULL_SCRIPTING_ENGINE_FACTORY; _scriptingEngine.setThrowExceptionsOnError( _exceptionsThrownOnScriptError ); } catch (ClassNotFoundException e) { disableScripting( e, "Unable to find scripting engine factory class " ); } catch (InstantiationException e) { disableScripting( e, "Unable to instantiate scripting engine factory class " ); } catch (IllegalAccessException e) { disableScripting( e, "Unable to create scripting engine factory class " ); } } return _scriptingEngine; }
FrameHolder( WebWindow window ) { _window = window; _topFrame = FrameSelector.newTopFrame( window ); DefaultWebResponse blankResponse = new DefaultWebResponse( window.getClient(), null, WebResponse.BLANK_HTML ); _contents.put( _topFrame, blankResponse ); HttpUnitOptions.getScriptingEngine().associate( blankResponse ); }
/** * Determines whether script errors result in exceptions or warning messages. */ public static void setExceptionsThrownOnScriptError( boolean throwExceptions ) { _exceptionsThrownOnScriptError = throwExceptions; getScriptingEngine().setThrowExceptionsOnError( throwExceptions ); }
void runScripts() throws SAXException { for (Iterator iterator = _newResponses.iterator(); iterator.hasNext();) { WebResponse response = (WebResponse) iterator.next(); HttpUnitOptions.getScriptingEngine().load( response ); } } }
/** * Returns the scriptable delegate. */ public ScriptingHandler getScriptingHandler() { if (_scriptable == null) { _scriptable = HttpUnitOptions.getScriptingEngine().createHandler( this ); } return _scriptable; }
public static ScriptingEngineFactory getScriptingEngine() { if (_scriptingEngine == null) { try { Class factoryClass = Class.forName( _scriptEngineClassName ); final ScriptingEngineFactory factory = (ScriptingEngineFactory) factoryClass.newInstance(); _scriptingEngine = factory.isEnabled() ? factory : NULL_SCRIPTING_ENGINE_FACTORY; _scriptingEngine.setThrowExceptionsOnError( _exceptionsThrownOnScriptError ); } catch (ClassNotFoundException e) { disableScripting( e, "Unable to find scripting engine factory class " ); } catch (InstantiationException e) { disableScripting( e, "Unable to instantiate scripting engine factory class " ); } catch (IllegalAccessException e) { disableScripting( e, "Unable to create scripting engine factory class " ); } } return _scriptingEngine; }
FrameHolder( WebWindow window ) { _window = window; _topFrame = FrameSelector.newTopFrame( window ); DefaultWebResponse blankResponse = new DefaultWebResponse( window.getClient(), null, WebResponse.BLANK_HTML ); _contents.put( _topFrame, blankResponse ); HttpUnitOptions.getScriptingEngine().associate( blankResponse ); }
/** * Determines whether script errors result in exceptions or warning messages. */ public static void setExceptionsThrownOnScriptError( boolean throwExceptions ) { _exceptionsThrownOnScriptError = throwExceptions; getScriptingEngine().setThrowExceptionsOnError( throwExceptions ); }
/** * Clears the accumulated script error messages. */ public static void clearScriptErrorMessages() { getScriptingEngine().clearErrorMessages(); }
void runScripts() throws SAXException { for (Iterator iterator = _newResponses.iterator(); iterator.hasNext();) { WebResponse response = (WebResponse) iterator.next(); HttpUnitOptions.getScriptingEngine().load( response ); } } }
/** * Returns the accumulated script error messages encountered. Error messages are accumulated only * if 'throwExceptionsOnError' is disabled. */ public static String[] getScriptErrorMessages() { return getScriptingEngine().getErrorMessages(); }
/** * Returns a scriptable object which can act as a proxy for this control. */ public ScriptingHandler getScriptingHandler() { if (_scriptable == null) { _scriptable = HttpUnitOptions.getScriptingEngine().createHandler( this ); } return _scriptable; }
void updateFrames( WebResponse response, FrameSelector frame, RequestContext requestContext ) throws MalformedURLException, IOException, SAXException { removeSubFrames( frame ); _contents.put( frame, response ); if (response.isHTML()) { HttpUnitOptions.getScriptingEngine().associate( response ); requestContext.addNewResponse( response ); WebRequest[] requests = response.getFrameRequests(); if (requests.length > 0) { createSubFrames( frame, response.getFrameSelectors() ); for (int i = 0; i < requests.length; i++) { if (requests[i].getURLString().length() != 0) { response.getWindow().getSubframeResponse( requests[i], requestContext ); } } } } }