public PatchedServletRunner(File webXml, String contextPath) throws IOException, SAXException { try { Field _application = getAccessibleField(getClass(), "_application"); _application.set(this, new PatchedWebApplication(HttpUnitUtils.newParser().parse(webXml), webXml .getParentFile().getParentFile(), contextPath)); Method completeInitialization = getAccessibleMethod(getClass(), "completeInitialization", new Class<?>[] { String.class }); completeInitialization.invoke(this, contextPath); } catch (RuntimeException e) { throw e; } catch (Exception e) { throw new RuntimeException(e); } patchInvocationContextFactory(); }
public PatchedServletRunner(File webXml, String contextPath) throws IOException, SAXException { try { Field _application = getAccessibleField(getClass(), "_application"); _application.set(this, new PatchedWebApplication(HttpUnitUtils.newParser().parse(webXml), webXml .getParentFile().getParentFile(), contextPath)); Method completeInitialization = getAccessibleMethod(getClass(), "completeInitialization", new Class<?>[] { String.class }); completeInitialization.invoke(this, contextPath); } catch (RuntimeException e) { throw e; } catch (Exception e) { throw new RuntimeException(e); } patchInvocationContextFactory(); }
/** * Constructor which expects a File object representing the web.xml for the * application and a context path under which to mount it. * * @param webXml the web.xml file * @param contextPath the context path * @since 1.6 */ public ServletRunner( File webXml, String contextPath ) throws IOException, SAXException { _application = new WebApplication( HttpUnitUtils.newParser().parse( webXml ), webXml.getParentFile().getParentFile(), contextPath ); completeInitialization( contextPath ); }
/** * Constructor which expects a File object representing the web.xml for the * application and a context path under which to mount it. * * @param webXml the web.xml file * @param contextPath the context path * @since 1.6 */ public ServletRunner( File webXml, String contextPath ) throws IOException, SAXException { _application = new WebApplication( HttpUnitUtils.newParser().parse( webXml ), webXml.getParentFile().getParentFile(), contextPath ); completeInitialization( contextPath ); }
/** * Constructor which expects a File object representing the web.xml for the * application and a context path under which to mount it. * * @param webXml the web.xml file * @param contextPath the context path * @since 1.6 */ public ServletRunner( File webXml, String contextPath ) throws IOException, SAXException { _application = new WebApplication( HttpUnitUtils.newParser().parse( webXml ), webXml.getParentFile().getParentFile(), contextPath ); completeInitialization( contextPath ); }
/** * parse the given inputStream with a new Parser * @param inputStream * @return the document parsed from the input Stream */ public static Document parse(InputStream inputStream) throws SAXException,IOException { DocumentBuilder db=newParser(); try { Document doc=db.parse(inputStream); return doc; } catch (java.net.MalformedURLException mue) { if (EXCEPTION_DEBUG) { String msg=mue.getMessage(); if (msg!=null) { System.err.println(msg); } InputStream is=inputStream; is.reset(); String content=parseISToString(is); System.err.println(content); } throw mue; } }
/** * Constructor which expects the full path to the web.xml for the * application. * @deprecated as of 1.6, use {@link #ServletRunner(File)} * * @param webXMLFileSpec the full path to the web.xml file */ public ServletRunner( String webXMLFileSpec ) throws IOException, SAXException { _application = new WebApplication( HttpUnitUtils.newParser().parse( webXMLFileSpec ) ); completeInitialization( null ); }
/** * parse the given inputSource with a new Parser * @param inputSource * @return the document parsed from the input Source */ public static Document parse(InputSource inputSource) throws SAXException,IOException { DocumentBuilder db=newParser(); try { Document doc=db.parse(inputSource); return doc; } catch (java.net.MalformedURLException mue) { if (EXCEPTION_DEBUG) { String msg=mue.getMessage(); if (msg!=null) { System.err.println(msg); } InputStream is=inputSource.getByteStream(); is.reset(); String content=parseISToString(is); System.err.println(content); } throw mue; } }
/** * Constructor which expects the full path to the web.xml for the * application. * @deprecated as of 1.6, use {@link #ServletRunner(File)} * * @param webXMLFileSpec the full path to the web.xml file */ public ServletRunner( String webXMLFileSpec ) throws IOException, SAXException { _application = new WebApplication( HttpUnitUtils.newParser().parse( webXMLFileSpec ) ); completeInitialization( null ); }
/** * Constructor which expects a File object representing the web.xml for the * application. * * @param webXml the web.xml file * @since 1.6 */ public ServletRunner( File webXml ) throws IOException, SAXException { _application = new WebApplication( HttpUnitUtils.newParser().parse( webXml ) ); completeInitialization( null ); }
/** * parse the given inputSource with a new Parser * @param inputSource * @return the document parsed from the input Source */ public static Document parse(InputSource inputSource) throws SAXException,IOException { DocumentBuilder db=newParser(); try { Document doc=db.parse(inputSource); return doc; } catch (java.net.MalformedURLException mue) { if (EXCEPTION_DEBUG) { String msg=mue.getMessage(); if (msg!=null) { System.err.println(msg); } InputStream is=inputSource.getByteStream(); is.reset(); String content=parseISToString(is); System.err.println(content); } throw mue; } }
/** * parse the given inputStream with a new Parser * @param inputStream * @return the document parsed from the input Stream */ public static Document parse(InputStream inputStream) throws SAXException,IOException { DocumentBuilder db=newParser(); try { Document doc=db.parse(inputStream); return doc; } catch (java.net.MalformedURLException mue) { if (EXCEPTION_DEBUG) { String msg=mue.getMessage(); if (msg!=null) { System.err.println(msg); } InputStream is=inputStream; is.reset(); String content=parseISToString(is); System.err.println(content); } throw mue; } }
/** * Constructor which expects a File object representing the web.xml for the * application. * * @param webXml the web.xml file * @since 1.6 */ public ServletRunner( File webXml ) throws IOException, SAXException { _application = new WebApplication( HttpUnitUtils.newParser().parse( webXml ) ); completeInitialization( null ); }
/** * Constructor which expects the full path to the web.xml for the * application. * @deprecated as of 1.6, use {@link #ServletRunner(File)} * * @param webXMLFileSpec the full path to the web.xml file */ public ServletRunner( String webXMLFileSpec ) throws IOException, SAXException { _application = new WebApplication( HttpUnitUtils.newParser().parse( webXMLFileSpec ) ); completeInitialization( null ); }
/** * Constructor which expects a File object representing the web.xml for the * application. * * @param webXml the web.xml file * @since 1.6 */ public ServletRunner( File webXml ) throws IOException, SAXException { _application = new WebApplication( HttpUnitUtils.newParser().parse( webXml ) ); completeInitialization( null ); }
/** * parse the given inputStream with a new Parser * @param inputStream * @return the document parsed from the input Stream */ public static Document parse(InputStream inputStream) throws SAXException,IOException { DocumentBuilder db=newParser(); try { Document doc=db.parse(inputStream); return doc; } catch (java.net.MalformedURLException mue) { if (EXCEPTION_DEBUG) { String msg=mue.getMessage(); if (msg!=null) { System.err.println(msg); } InputStream is=inputStream; is.reset(); String content=parseISToString(is); System.err.println(content); } throw mue; } }
/** * parse the given inputSource with a new Parser * @param inputSource * @return the document parsed from the input Source */ public static Document parse(InputSource inputSource) throws SAXException,IOException { DocumentBuilder db=newParser(); try { Document doc=db.parse(inputSource); return doc; } catch (java.net.MalformedURLException mue) { if (EXCEPTION_DEBUG) { String msg=mue.getMessage(); if (msg!=null) { System.err.println(msg); } InputStream is=inputSource.getByteStream(); is.reset(); String content=parseISToString(is); System.err.println(content); } throw mue; } }
/** * constructor with entity Resolver * as asked for in Bug report 1222269 by jim - jafergus * @param webXMLFileSpec * @param resolver * @throws IOException * @throws SAXException * @since 1.7 */ public ServletRunner( String webXMLFileSpec,EntityResolver resolver ) throws IOException, SAXException { DocumentBuilder parser = HttpUnitUtils.newParser(); parser.setEntityResolver(resolver); _application = new WebApplication( parser.parse( webXMLFileSpec ) ); completeInitialization( null ); }
/** * constructor with entity Resolver * as asked for in Bug report 1222269 by jim - jafergus * @param webXMLFileSpec * @param resolver * @throws IOException * @throws SAXException * @since 1.7 */ public ServletRunner( String webXMLFileSpec,EntityResolver resolver ) throws IOException, SAXException { DocumentBuilder parser = HttpUnitUtils.newParser(); parser.setEntityResolver(resolver); _application = new WebApplication( parser.parse( webXMLFileSpec ) ); completeInitialization( null ); }
/** * constructor with entity Resolver * as asked for in Bug report 1222269 by jim - jafergus * @param webXMLFileSpec * @param resolver * @throws IOException * @throws SAXException * @since 1.7 */ public ServletRunner( String webXMLFileSpec,EntityResolver resolver ) throws IOException, SAXException { DocumentBuilder parser = HttpUnitUtils.newParser(); parser.setEntityResolver(resolver); _application = new WebApplication( parser.parse( webXMLFileSpec ) ); completeInitialization( null ); }