httpunit-commit Mailing List for httpunit (Page 9)
Brought to you by:
russgold
You can subscribe to this list here.
2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(5) |
Sep
(31) |
Oct
(39) |
Nov
(18) |
Dec
(6) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2001 |
Jan
(8) |
Feb
(5) |
Mar
(8) |
Apr
(25) |
May
(20) |
Jun
(23) |
Jul
(28) |
Aug
(10) |
Sep
(3) |
Oct
(32) |
Nov
(61) |
Dec
(24) |
2002 |
Jan
(50) |
Feb
(34) |
Mar
(35) |
Apr
(3) |
May
(25) |
Jun
(25) |
Jul
(30) |
Aug
(146) |
Sep
(49) |
Oct
(156) |
Nov
(121) |
Dec
(54) |
2003 |
Jan
(12) |
Feb
(79) |
Mar
(88) |
Apr
(26) |
May
(67) |
Jun
(29) |
Jul
(8) |
Aug
(16) |
Sep
(20) |
Oct
(17) |
Nov
|
Dec
(5) |
2004 |
Jan
|
Feb
(40) |
Mar
(30) |
Apr
(5) |
May
|
Jun
(83) |
Jul
(34) |
Aug
(20) |
Sep
(44) |
Oct
(46) |
Nov
|
Dec
(14) |
2005 |
Jan
(4) |
Feb
|
Mar
(5) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(4) |
Oct
|
Nov
|
Dec
(1) |
2006 |
Jan
|
Feb
|
Mar
(26) |
Apr
(8) |
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(5) |
Nov
|
Dec
|
2008 |
Jan
|
Feb
|
Mar
|
Apr
(36) |
May
(38) |
Jun
(1) |
Jul
(1) |
Aug
|
Sep
(4) |
Oct
|
Nov
(18) |
Dec
(4) |
2009 |
Jan
|
Feb
(2) |
Mar
(3) |
Apr
|
May
|
Jun
(2) |
Jul
|
Aug
(35) |
Sep
(1) |
Oct
|
Nov
|
Dec
(1) |
2010 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(3) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2011 |
Jan
(9) |
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
2012 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(21) |
Oct
(18) |
Nov
(1) |
Dec
|
From: Russell G. <rus...@us...> - 2006-10-09 03:16:36
|
Update of /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/parsing In directory sc8-pr-cvs5.sourceforge.net:/tmp/cvs-serv13025/src/com/meterware/httpunit/parsing Modified Files: NekoDOMParser.java Log Message: refactor to allow dom-based-scripting Index: NekoDOMParser.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/parsing/NekoDOMParser.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- NekoDOMParser.java 28 Mar 2006 00:52:15 -0000 1.4 +++ NekoDOMParser.java 9 Oct 2006 03:16:26 -0000 1.5 @@ -121,7 +121,7 @@ public boolean supportsScriptLanguage( String language ) { - return getScriptableDelegate().supportsScript( language ); + return getScriptableDelegate().supportsScriptLanguage( language ); } |
From: Russell G. <rus...@us...> - 2006-10-09 03:16:35
|
Update of /cvsroot/httpunit/httpunit/test/com/meterware/httpunit/dom In directory sc8-pr-cvs5.sourceforge.net:/tmp/cvs-serv13025/test/com/meterware/httpunit/dom Modified Files: DomScriptingTest.java Log Message: refactor to allow dom-based-scripting Index: DomScriptingTest.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/test/com/meterware/httpunit/dom/DomScriptingTest.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- DomScriptingTest.java 6 Jul 2006 04:02:07 -0000 1.1 +++ DomScriptingTest.java 9 Oct 2006 03:16:26 -0000 1.2 @@ -1,14 +1,36 @@ package com.meterware.httpunit.dom; - +/******************************************************************************************************************** + * $Id$ + * + * Copyright (c) 2006, Russell Gold + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated + * documentation files (the "Software"), to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and + * to permit persons to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO + * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF + * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + *******************************************************************************************************************/ import org.w3c.dom.Element; import org.w3c.dom.Node; import org.w3c.dom.html.HTMLBodyElement; import org.w3c.dom.html.HTMLAnchorElement; import org.mozilla.javascript.Scriptable; +import org.mozilla.javascript.Context; /** * Tests basic scripting via the DOM. - */ + * + * @author <a href="mailto:rus...@ht...">Russell Gold</a> + **/ public class DomScriptingTest extends AbstractHTMLElementTest { @@ -23,7 +45,7 @@ assertEquals( "title", "something", _htmlDocument.get( "title", null ) ); Node body = createElement( "body" ); - assertEquals( "title", "something", ScriptingSupport.evaluateExpression( body, "document.title" ) ); + assertEquals( "title", "something", evaluateExpression( body, "document.title" ) ); } @@ -32,7 +54,7 @@ assertEquals( "title after put", "right here", _htmlDocument.getTitle() ); Node body = createElement( "body" ); - ScriptingSupport.evaluateExpression( body, "document.title='new value'" ); + evaluateExpression( body, "document.title='new value'" ); assertEquals( "title after script", "new value", _htmlDocument.getTitle() ); } @@ -44,7 +66,7 @@ scriptableBody.put( "title", scriptableBody, "right here" ); assertEquals( "title after put", "right here", body.getTitle() ); - ScriptingSupport.evaluateExpression( body, "title='new value'" ); + evaluateExpression( body, "title='new value'" ); assertEquals( "title after script", "new value", body.getTitle() ); } @@ -53,9 +75,9 @@ HTMLBodyElement body = addBodyElement(); body.setBgColor( "red" ); - assertEquals( "initial background color", "red", ScriptingSupport.evaluateExpression( _htmlDocument, "body.bgcolor" ) ); + assertEquals( "initial background color", "red", evaluateExpression( _htmlDocument, "body.bgcolor" ) ); - ScriptingSupport.evaluateExpression( _htmlDocument, "body.id='blue'" ); + evaluateExpression( _htmlDocument, "body.id='blue'" ); assertEquals( "revised foreground color", "blue", body.getId() ); } @@ -66,12 +88,13 @@ body.appendChild( anchor ); anchor.setTabIndex( 4 ); - assertEquals( "initial tab index", new Integer(4), ScriptingSupport.evaluateExpression( anchor, "tabindex" ) ); + assertEquals( "initial tab index", new Integer(4), evaluateExpression( anchor, "tabindex" ) ); - ScriptingSupport.evaluateExpression( anchor, "tabindex=6" ); + evaluateExpression( anchor, "tabindex=6" ); assertEquals( "revised tab index", 6, anchor.getTabIndex() ); } + private HTMLBodyElement addBodyElement() { HTMLBodyElement body = (HTMLBodyElement) createElement( "body" ); _htmlDocument.setBody( body ); @@ -80,7 +103,7 @@ public void testCreateElement() throws Exception { - Object node = ScriptingSupport.evaluateExpression( _htmlDocument, "createElement( 'a' )" ); + Object node = evaluateExpression( _htmlDocument, "createElement( 'a' )" ); assertNotNull( "No node returned", node ); assertTrue( "Node is not an anchor element", node instanceof HTMLAnchorElement ); } @@ -91,13 +114,13 @@ appendLink( body, "red", "red.html" ); appendLink( body, "blue", "blue.html" ); - assertEquals( "number of links", new Integer(2), ScriptingSupport.evaluateExpression( _htmlDocument, "links.length" ) ); - Object second = ScriptingSupport.evaluateExpression( _htmlDocument, "links[1]" ); + assertEquals( "number of links", new Integer(2), evaluateExpression( _htmlDocument, "links.length" ) ); + Object second = evaluateExpression( _htmlDocument, "links[1]" ); assertNotNull( "Did not obtain any link object", second ); assertTrue( "Object is not a link element", second instanceof HTMLAnchorElement ); assertEquals( "Link ID", "blue", ((HTMLAnchorElement) second).getId() ); - assertEquals( "red link href", "red.html", ScriptingSupport.evaluateExpression( _htmlDocument, "links.red.href" ) ); + assertEquals( "red link href", "red.html", evaluateExpression( _htmlDocument, "links.red.href" ) ); } @@ -122,4 +145,14 @@ assertTrue( valueType.getName() + " should be convertable to " + parameterType.getName(), ScriptingSupport.isConvertableTo( valueType, parameterType ) ); } + + private Object evaluateExpression( Node node, String expression ) { + try { + Context context = Context.enter(); + context.initStandardObjects( null ); + return ((NodeImpl) node).evaluateExpression( expression ); + } finally { + Context.exit(); + } + } } |
From: Russell G. <rus...@us...> - 2006-10-09 03:16:30
|
Update of /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/scripting In directory sc8-pr-cvs5.sourceforge.net:/tmp/cvs-serv13025/src/com/meterware/httpunit/scripting Modified Files: ScriptableDelegate.java ScriptingEngine.java ScriptingEngineFactory.java Added Files: ScriptingHandler.java Log Message: refactor to allow dom-based-scripting ***** Error reading new file[Errno 2] No such file or directory: 'ScriptingHandler.java' Index: ScriptableDelegate.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/scripting/ScriptableDelegate.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- ScriptableDelegate.java 9 Mar 2004 21:49:18 -0000 1.10 +++ ScriptableDelegate.java 9 Oct 2006 03:16:26 -0000 1.11 @@ -1,11 +1,8 @@ package com.meterware.httpunit.scripting; - -import com.meterware.httpunit.HTMLElement; - /******************************************************************************************************************** * $Id$ * - * Copyright (c) 2002, Russell Gold + * Copyright (c) 2002-2006, Russell Gold * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated * documentation files (the "Software"), to deal in the Software without restriction, including without limitation @@ -22,28 +19,29 @@ * DEALINGS IN THE SOFTWARE. * *******************************************************************************************************************/ +import com.meterware.httpunit.HTMLElement; /** * An interface for objects which will be accessible via scripting. * * @author <a href="mailto:rus...@ht...">Russell Gold</a> **/ -abstract public class ScriptableDelegate { +abstract public class ScriptableDelegate implements ScriptingHandler { private ScriptingEngine _scriptEngine; private static final ScriptingEngine NULL_SCRIPT_ENGINE = new ScriptingEngine() { public boolean supportsScriptLanguage( String language ) { return false; } - public String executeScript( String language, String script ) { return ""; } - public boolean performEvent( String eventScript ) { return true; } - public String evaluateScriptExpression( String urlString ) { return null; } + public String runScript( String language, String script ) { return ""; } + public boolean doEvent( String eventScript ) { return true; } + public String evaluateExpression( String urlString ) { return null; } public ScriptingEngine newScriptingEngine( ScriptableDelegate child ) { return this; } public void clearCaches() {} }; - public boolean supportsScript( String language ) { + public boolean supportsScriptLanguage( String language ) { return getScriptEngine().supportsScriptLanguage( language ); } @@ -53,7 +51,7 @@ **/ public boolean doEvent( String eventScript ) { if (eventScript.length() == 0) return true; - return getScriptEngine().performEvent( eventScript ); + return getScriptEngine().doEvent( eventScript ); } @@ -62,7 +60,7 @@ * @return the replacement text, which may be empty. **/ public String runScript( String language, String script ) { - return (script.length() == 0) ? "" : getScriptEngine().executeScript( language, script ); + return (script.length() == 0) ? "" : getScriptEngine().runScript( language, script ); } @@ -71,7 +69,7 @@ **/ public String evaluateExpression( String urlString ) { if (urlString.length() == 0) return null; - return getScriptEngine().evaluateScriptExpression( urlString ); + return getScriptEngine().evaluateExpression( urlString ); } @@ -121,7 +119,7 @@ protected ScriptableDelegate[] getDelegates( final HTMLElement[] elements ) { ScriptableDelegate[] result = new ScriptableDelegate[ elements.length ]; for (int i = 0; i < elements.length; i++) { - result[i] = elements[i].getScriptableDelegate(); + result[i] = (ScriptableDelegate) elements[i].getScriptingHandler(); } return result; } Index: ScriptingEngine.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/scripting/ScriptingEngine.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- ScriptingEngine.java 9 Mar 2004 21:49:18 -0000 1.7 +++ ScriptingEngine.java 9 Oct 2006 03:16:26 -0000 1.8 @@ -2,7 +2,7 @@ /******************************************************************************************************************** * $Id$ * - * Copyright (c) 2002, Russell Gold + * Copyright (c) 2002-2006, Russell Gold * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated * documentation files (the "Software"), to deal in the Software without restriction, including without limitation @@ -25,31 +25,7 @@ * * @author <a href="mailto:rus...@ht...">Russell Gold</a> **/ -public interface ScriptingEngine { - - - /** - * Returns true if this engine supports the specified script. - **/ - public boolean supportsScriptLanguage( String language ); - - - /** - * Interprets the specified script, which may include global function definitions. - */ - public String executeScript( String language, String script ); - - - /** - * Interprets the specified script and returns a boolean result. - */ - public boolean performEvent( String eventScript ); - - - /** - * Evaluates the specified string as JavaScript. Will return null if the script has no return value. - */ - public String evaluateScriptExpression( String urlString ); +public interface ScriptingEngine extends ScriptingHandler { /** Index: ScriptingEngineFactory.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/scripting/ScriptingEngineFactory.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- ScriptingEngineFactory.java 8 Aug 2004 17:38:18 -0000 1.4 +++ ScriptingEngineFactory.java 9 Oct 2006 03:16:26 -0000 1.5 @@ -1,5 +1,6 @@ package com.meterware.httpunit.scripting; import com.meterware.httpunit.WebResponse; +import com.meterware.httpunit.HTMLElement; /******************************************************************************************************************** * $Id$ @@ -65,4 +66,6 @@ */ public void clearErrorMessages(); + + ScriptingHandler createHandler( HTMLElement elementBase ); } |
Update of /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/dom In directory sc8-pr-cvs5.sourceforge.net:/tmp/cvs-serv13025/src/com/meterware/httpunit/dom Modified Files: ElementImpl.java HTMLElementImpl.java NodeImpl.java ScriptingSupport.java Added Files: DomBasedScriptingEngineFactory.java Log Message: refactor to allow dom-based-scripting --- NEW FILE --- package com.meterware.httpunit.dom; import com.meterware.httpunit.scripting.ScriptingEngineFactory; import com.meterware.httpunit.scripting.ScriptingHandler; import com.meterware.httpunit.WebResponse; import com.meterware.httpunit.HTMLElement; import java.util.logging.Logger; /** * The scripting engine factory which relies directly on the DOM. */ public class DomBasedScriptingEngineFactory implements ScriptingEngineFactory { public boolean isEnabled() { try { Class.forName( "org.mozilla.javascript.Context" ); return true; } catch (Exception e) { Logger.getLogger( "httpunit.org" ).warning( "Rhino classes (js.jar) not found - Javascript disabled" ); return false; } } public void associate( WebResponse response ) { //To change body of implemented methods use File | Settings | File Templates. } public void load( WebResponse response ) { //To change body of implemented methods use File | Settings | File Templates. } public void setThrowExceptionsOnError( boolean throwExceptions ) { //To change body of implemented methods use File | Settings | File Templates. } public boolean isThrowExceptionsOnError() { return false; //To change body of implemented methods use File | Settings | File Templates. } public String[] getErrorMessages() { return new String[0]; //To change body of implemented methods use File | Settings | File Templates. } public void clearErrorMessages() { //To change body of implemented methods use File | Settings | File Templates. } public ScriptingHandler createHandler( HTMLElement elementBase ) { return (ScriptingHandler) elementBase.getNode(); } } Index: ElementImpl.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/dom/ElementImpl.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- ElementImpl.java 6 Jul 2006 04:02:06 -0000 1.2 +++ ElementImpl.java 9 Oct 2006 03:16:26 -0000 1.3 @@ -23,6 +23,9 @@ import java.util.Hashtable; +import com.meterware.httpunit.scripting.ScriptingEngine; +import com.meterware.httpunit.scripting.ScriptableDelegate; + /** * * @author <a href="mailto:rus...@ht...">Russell Gold</a> Index: HTMLElementImpl.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/dom/HTMLElementImpl.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- HTMLElementImpl.java 6 Jul 2006 04:02:06 -0000 1.2 +++ HTMLElementImpl.java 9 Oct 2006 03:16:26 -0000 1.3 @@ -118,6 +118,7 @@ return super.getElementsByTagName( ((HTMLDocumentImpl) getOwnerDocument()).toNodeCase( name ) ); } +//---------------------------------------------- protected methods ----------------------------------------------------- final protected String getAttributeWithDefault( String attributeName, String defaultValue ) { if (hasAttribute( attributeName )) return getAttribute( attributeName ); Index: NodeImpl.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/dom/NodeImpl.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- NodeImpl.java 6 Jul 2006 04:02:07 -0000 1.2 +++ NodeImpl.java 9 Oct 2006 03:16:26 -0000 1.3 @@ -2,7 +2,7 @@ /******************************************************************************************************************** * $Id$ * - * Copyright (c) 2004, Russell Gold + * Copyright (c) 2004-2006, Russell Gold * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated * documentation files (the "Software"), to deal in the Software without restriction, including without limitation @@ -20,16 +20,19 @@ * *******************************************************************************************************************/ import org.w3c.dom.*; -import org.mozilla.javascript.ScriptableObject; import java.util.ArrayList; import java.util.Hashtable; +import com.meterware.httpunit.javascript.ScriptingEngineImpl; +import com.meterware.httpunit.scripting.ScriptingEngine; +import com.meterware.httpunit.scripting.ScriptableDelegate; + /** * * @author <a href="mailto:rus...@ht...">Russell Gold</a> **/ -abstract public class NodeImpl extends ScriptableObject implements Node { +abstract public class NodeImpl extends ScriptingEngineImpl implements Node { private DocumentImpl _ownerDocument; private NodeImpl _parentNode; @@ -52,6 +55,14 @@ return getClass().getName(); } +//------------------------------------------ ScriptingEngine methods -------------------------------------------------- + + public ScriptingEngine newScriptingEngine( ScriptableDelegate child ) { + throw new UnsupportedOperationException( ); + } + + public void clearCaches() {} + //----------------------------------------------- Node methods --------------------------------------------------------- Index: ScriptingSupport.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/dom/ScriptingSupport.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- ScriptingSupport.java 6 Jul 2006 04:02:07 -0000 1.1 +++ ScriptingSupport.java 9 Oct 2006 03:16:26 -0000 1.2 @@ -1,10 +1,7 @@ package com.meterware.httpunit.dom; import org.mozilla.javascript.Scriptable; -import org.mozilla.javascript.JavaScriptException; -import org.mozilla.javascript.Context; import org.mozilla.javascript.FunctionObject; -import org.w3c.dom.Node; import java.lang.reflect.Method; import java.lang.reflect.InvocationTargetException; @@ -129,23 +126,12 @@ } - static Object evaluateExpression( Node node, String expression ) throws JavaScriptException { - try { - Context context = Context.enter(); - context.initStandardObjects( null ); - return Context.getCurrentContext().evaluateString( (Scriptable) node, expression, "httpunit", 0, null ); - } finally { - Context.exit(); - } - } - public static boolean isConvertableTo( Class valueType, Class parameterType ) { if (valueType.equals( parameterType )) return true; if (parameterType.equals( String.class )) return true; if (valueType.equals( String.class ) && isNumericParameter( parameterType )) return true; if (Number.class.isAssignableFrom( valueType ) && isNumericParameter( parameterType )) return true; - if (valueType.equals( String.class ) && parameterType.equals( Boolean.class )) return true; - return false; + return valueType.equals( String.class ) && parameterType.equals( Boolean.class ); } private static boolean isNumericParameter( Class parameterType ) { |
From: Russell G. <rus...@us...> - 2006-10-09 03:16:30
|
Update of /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/javascript In directory sc8-pr-cvs5.sourceforge.net:/tmp/cvs-serv13025/src/com/meterware/httpunit/javascript Modified Files: JavaScript.java JavaScriptEngineFactory.java Added Files: ScriptingEngineImpl.java Log Message: refactor to allow dom-based-scripting ***** Error reading new file[Errno 2] No such file or directory: 'ScriptingEngineImpl.java' Index: JavaScript.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/javascript/JavaScript.java,v retrieving revision 1.64 retrieving revision 1.65 diff -u -r1.64 -r1.65 --- JavaScript.java 6 Jul 2006 04:02:07 -0000 1.64 +++ JavaScript.java 9 Oct 2006 03:16:26 -0000 1.65 @@ -2,7 +2,7 @@ /******************************************************************************************************************** * $Id$ * - * Copyright (c) 2002-2004, Russell Gold + * Copyright (c) 2002-2006, Russell Gold * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated * documentation files (the "Software"), to deal in the Software without restriction, including without limitation @@ -24,7 +24,6 @@ import com.meterware.httpunit.scripting.*; import java.lang.reflect.InvocationTargetException; -import java.util.ArrayList; import java.io.IOException; import java.net.URL; @@ -39,12 +38,8 @@ **/ public class JavaScript { - private final static Object[] NO_ARGS = new Object[0]; - private static boolean _throwExceptionsOnError = true; - private static ArrayList _errorMessages = new ArrayList(); - static boolean isThrowExceptionsOnError() { return _throwExceptionsOnError; @@ -56,16 +51,6 @@ } - static void clearErrorMessages() { - _errorMessages.clear(); - } - - - static String[] getErrorMessages() { - return (String[]) _errorMessages.toArray( new String[ _errorMessages.size() ] ); - } - - /** * Initiates JavaScript execution for the specified web response. */ @@ -110,102 +95,12 @@ } - abstract static class JavaScriptEngine extends ScriptableObject implements ScriptingEngine { + abstract static class JavaScriptEngine extends ScriptingEngineImpl { protected ScriptableDelegate _scriptable; protected JavaScriptEngine _parent; - public boolean supportsScriptLanguage( String language ) { - return language == null || language.toLowerCase().startsWith( "javascript" ); - } - - - public String executeScript( String language, String script ) { - if (!supportsScriptLanguage( language )) return ""; - try { - script = script.trim(); - if (script.startsWith( "<!--" )) { - script = withoutFirstLine( script ); - if (script.endsWith( "-->" )) script = script.substring( 0, script.lastIndexOf( "-->" )); - } - Context.getCurrentContext().evaluateString( this, script, "httpunit", 0, null ); - StringBuffer buffer = getDocumentWriteBuffer(); - return buffer.toString(); - } catch (Exception e) { - handleScriptException( e, "Script '" + script + "'" ); - return ""; - } finally { - discardDocumentWriteBuffer(); - } - } - - - protected StringBuffer getDocumentWriteBuffer() { - throw new IllegalStateException( "may not run executeScript() from " + getClass() ); - } - - - protected void discardDocumentWriteBuffer() { - throw new IllegalStateException( "may not run executeScript() from " + getClass() ); - } - - - private String withoutFirstLine( String script ) { - for (int i=0; i < script.length(); i++) { - if (isLineTerminator( script.charAt(i) )) return script.substring( i ).trim(); - } - return ""; - } - - - private boolean isLineTerminator( char c ) { - return c == 0x0A || c == 0x0D; - } - - - public boolean performEvent( String eventScript ) { - try { - final Context context = Context.getCurrentContext(); - context.setOptimizationLevel( -1 ); - Function f = context.compileFunction( this, "function x() { " + eventScript + "}", "httpunit", 0, null ); - Object result = f.call( context, this, this, NO_ARGS ); - return (!(result instanceof Boolean)) || ((Boolean) result).booleanValue(); - } catch (Exception e) { - handleScriptException( e, "Event '" + eventScript + "'" ); - return false; - } - } - - - /** - * Evaluates the specified string as JavaScript. Will return null if the script has no return value. - */ - public String evaluateScriptExpression( String urlString ) { - try { - Object result = Context.getCurrentContext().evaluateString( this, urlString, "httpunit", 0, null ); - return (result == null || result instanceof Undefined) ? null : result.toString(); - } catch (Exception e) { - handleScriptException( e, "URL '" + urlString + "'" ); - return null; - } - } - - - private void handleScriptException( Exception e, String badScript ) { - final String errorMessage = badScript + " failed: " + e; - if (!(e instanceof EcmaError) && !(e instanceof EvaluatorException)) { - e.printStackTrace(); - throw new RuntimeException( errorMessage ); - } else if (isThrowExceptionsOnError()) { - e.printStackTrace(); - throw new ScriptException( errorMessage ); - } else { - _errorMessages.add( errorMessage ); - } - } - - void initialize( JavaScriptEngine parent, ScriptableDelegate scriptable ) throws SAXException, PropertyException, JavaScriptException, NotAFunctionException { _scriptable = scriptable; @@ -338,10 +233,10 @@ } - protected ElementArray toElementArray( ScriptableDelegate[] scriptables ) { + protected ElementArray toElementArray( ScriptingHandler[] scriptables ) { JavaScriptEngine[] elements = new JavaScriptEngine[ scriptables.length ]; for (int i = 0; i < elements.length; i++) { - elements[ i ] = (JavaScriptEngine) toScriptable( scriptables[ i ] ); + elements[ i ] = (JavaScriptEngine) toScriptable( (ScriptableDelegate) scriptables[ i ] ); } ElementArray result = ElementArray.newElementArray( this ); result.initialize( elements ); Index: JavaScriptEngineFactory.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/javascript/JavaScriptEngineFactory.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- JavaScriptEngineFactory.java 8 Aug 2004 17:38:18 -0000 1.8 +++ JavaScriptEngineFactory.java 9 Oct 2006 03:16:26 -0000 1.9 @@ -20,7 +20,10 @@ * *******************************************************************************************************************/ import com.meterware.httpunit.WebResponse; +import com.meterware.httpunit.HTMLElement; import com.meterware.httpunit.scripting.ScriptingEngineFactory; +import com.meterware.httpunit.scripting.ScriptableDelegate; +import com.meterware.httpunit.scripting.ScriptingHandler; /** @@ -76,11 +79,18 @@ public String[] getErrorMessages() { - return JavaScript.getErrorMessages(); + return ScriptingEngineImpl.getErrorMessages(); } public void clearErrorMessages() { - JavaScript.clearErrorMessages(); + ScriptingEngineImpl.clearErrorMessages(); + } + + + public ScriptingHandler createHandler( HTMLElement elementBase ) { + ScriptableDelegate delegate = elementBase.newScriptable(); + delegate.setScriptEngine( elementBase.getParentDelegate().getScriptEngine( delegate ) ); + return delegate; } } |
From: Russell G. <rus...@us...> - 2006-05-02 01:14:21
|
Update of /cvsroot/httpunit/httpunit/jars In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11018/jars Added Files: quicksite.jar Log Message: depend on quicksite jar --- NEW FILE --- PK ¡4 0à=pßáâÔB¢U±njvpêÏôJ1oßt(¸~çpN«¬hñüMó¢'[b,$°Êî¤rªûa.2`ÍLÊSÏëí×OE³Qå!l¦ÑæÞm'¢#°)C}2»yï^Vï¤(Õ«6=¿á[µaùßz_Î 0`_PK íÔ^ðºËps|û®ù¥´çÖÚÿyY^sT=깥̨F9·ÿ»cyÎ#Ø´ÛmÛ*µxºîäh"êÏ;+&6ÿ¸5ZaÙ128,¹²µ]z¾±[º÷`èĽx$×5Z$1ñº Ã\$µ<nÐ] 85U¦Ó6ÐiZÍa@ð)>e§Løi, (¢µHd=w5ÜCìG$5U!:* ¤NÞqCSãdâ7Ìÿì¿KÕ^A=]Lyâ¾K¬kÄ+TÞö¸|ë¾Êud(PßÒÈè[¹~^ËôÁÓ[$@EN±Ê}oâgûLIå3EL!qb±âúƨ#öb®Põ×bÆýñALwû{ÞûPK J³(*_ÉÀ²!sà+E0dkÇîëønÐvê2Aû-Cê@ ésRäèå* v<:u#îòfOHîl{2μÓõ]É);S?äÂ#w"ò=C3?5ÂõMc)ì3èÕ°E§ïö;M5ܦª#[£ý}7j?2êª8tí²ÖNð¨ê»½'Ïú´GÎý ê£Öi-1ÌEÄ Ì´¹ïò IHSPcdÖÃ~äñm¡6׸Ë*ÛÂ<*æpËÂ,nRÜUÌÍþá!¼°°6ðÊÂk,[¸¡â+ÿZ)6¦ØkSÃÊd:qW£Zêw=÷èVèîýÏ5ØéÛíò ÅPÊO1ì£<zt{ !¡ÚIo3¡Æ@kVÍ|Y¨O#m$oÓî½Í$¶}fHØ¥4ûôH×¾!ucI'qô h¦)íѼî8ÒÞtea)¯»ê¡}ò~GO-»F>uÚ¶õµIÃqB#i¸§½}W£VV ´L¦Z.ÌKû>çNR¿ªÛzö7î¢Aì¾ÉUH¤+íÝ©9ï®L5lq-{íÏúZm£fâú{½ußW#nåfsNºå³1Ë8Ù[23¯¹Ôkfnx;ìÁÿutÃ^ðßÈó¤§=[±¿¤çäùeo!4á¢ÿ92åÑs«¹¤bíq[ fÊ1[Ϥé ${·ci]wٲܩ¡;y¿©Ñ¬\`2(k~ü×rî×;Ö+S8Ps³¥@O=¶°Ô¦ÀçYÅ´ÉWjõèöm$·%µLgÝ58ó»7~fyaA*SÚã Þ%q\8X³Dj>5è¶Vb¶ãVÛLØîÝ¡¹j`ÕDTÏd¤ãô¤Óiéú¾N® «i5aÈgÖLwQºFîÉäýî±í3TÛêØ¤gPajÃy ÝØ§áe$4Øp4¸XÖp+´¶NÒc(U k àU¼&ÐY%}yÙt¬Ô2ùÔ À¾)+QîvRf°Y¹ Õ£Èò.>Òð1óOÂøTÃgø\ÃjøRùJÃ=\`cKiøß¨ß ì¨ñ>`¸«T¦çoÑ.ôvµmX©é fôl/¢9SÒ1ÜwÝ« »Ò{ ±ÿuJt¢o³ð?HüÅ×¼½¬çY!}iIYïRGîTj%âZe¬öZ7Ãûþ½[I¿ê*ãRϪ(ÞØç«ý=PU:bµAá³B)Ñ{Õ`쯣ﱵTÛüiº>BHgÎp·pÖÕ;º¥?ÝüÐéâç+OÕW×,-ûùt³àÜØ¿G\4 c3Ð NâB8CÐ>à8%ÕYÓcúÎ=²´o O^ûÿÊýËÀïhÊàUrt$æ,ý*6-¸0î3¬åÅ¥Ù¥Ôf :¥íµ@v'NÔ@¼ Í ÝéQîolcÇÁ.v,xVÑ`Øüÿ]`ظÙÉ4¦ËU 4ErÒ¤¯qSUr¸¬!vº_3Û}`K£GO©L¯Ë|E0Óôçf¤ËÍo`g´)À&YI5TI:Ò·HÓíÀR> U2¶«ÀõØf@³»7=§Yâ.!Ìn÷ÒVq?ûÈÒ}¶÷¼yâwʸ¤±Sð¬OQ¹T.Öð ¥r/¨\<Ä£ªÆyüPK Ü!eÒÊddc0S&¯LÁ@Ñ@ÉÀðÏu}xõÀúll·T±Û²,ya;¶ÿR`*}þ*³+ o¸ )0Yµ¹yÔ©IïUkódºêÖö®åÙ*>9ÔývW S»RGúÒëY,õdkû2@ݶZòt¤gù®Gv}¨ÊlÈ&)Ôí++'RÚÓ*íøí´Ê£'JàD:|Ûu¤rÃu|éø¦7m%Tköfϵ»çQ¢R{ý¥.d×ÀCÆ;îW p~¤¢1Àª8&Éø?ªºxdb M<ÁSåT9S&á¹u¬²ûKO qÖñVí@Ö9ºÔøâ 3ÿd¼Ý:mW V#M]Øñ¿Úþ68D:3²YO Ûë¸ï¹=Õ®ÀÜ«Ãõ¶ÛXär M¯Ñçh§Uk|Dzlî´oAÎm Kb³æÙ£À»FTÁßu$y§0¿²"Ìwî¡ýìwh¹ôÍBá>"{Ç0öL¬ëI=ßG4©÷;#½m³$ÉayRkCèS9VÜ$½ònÑÓXy·)*ÄZþåÜå½Î¬E>÷®Ô_PK neÝUyo;ÃúGØ\!¨¦ªRKµé*ÚuOËÔrËUéëµ6 ëöåæ[`2<~jįÉçÌdV¹½e©W@ç© ïVI¯OÉ2URCE`êØ\M7¢z?±è{gÈ&Þ'ñjúJG|ÂãoUý}Ñl¡Ò¾{5h¨\ðLã"Î.Fð±38ë` ·,#çàòçGÌÁyLX¸ëàÉÃggd®4|íUåüó¬i/ðö`®Q*I¶g,Ä÷º/Êç©/*®xEq£0îà>V¬bÂ_c©UÎÔeÍU® ÖñÐÁ)è0Àìã»Od®[,²Eïg÷(ü3[÷~qg«C¼Uº|?øì]qBù´áVêfk5é³ÎtÇ9èÜ©`k¨Sæú»e·8¾UþmÈó jRé-^æ±Jf£ühó{ÔÅ`¹³ÍpÐZfV¸~· =1¹ ñªpk¤åüàì Q ,Ìd´ì8&hÃflxÃ$Ú Wbrb¯Ñ5ÙDèá°Mk¾QV> )¤¥ÕÄP¥pS¢¼¯Ý©ëÊhc·ßÅ>BÌ:&AEnó°ëÙÙ9çÌÅûë÷ ڡܤýâùwT*³×s̾dßùGÁ)Øx\Á)ØxǹB+çÙþPK 1ì$¡`W=û*ÊÉé_86C®52Ý4ì¡Þö]aOb=ás!~&lá7¢ÕZA9wî8C¦%l~3¶úÜí}Kò3»+ä}VTü{á1´¥[ÜçîÄp¹>á}Üõkn;;ä> LSjý0嫵0ª´÷»©P]îùn*¹^¨Þ÷Inj;cwÀ/ $ÍÌYÒSC i *H0ÿ[!;¹íøJpU É-nûJ þLô¡¡B>É Ë:qPÔè¦Sf²Z{¢C+ãA±UÚ´d)3¬!·$~FäqA|*^G~&nlÔ]?zAd>:Tk¤©Åi×ÌA ´\.4BA6ÂA¢ Ǥ9ùds²h¶¿ fäã¼ÌÊð´dxF/׳2<'Ãex^/iøC /hø²AÓqQæ¯èø#¿*Ã~ÔcVÃ×t|]tý±?Õñg2¿¤ã2SÃË~¬Á·Dé· úïÊÇ÷t|_Çëø©ã:~¨ã¯tü¨¿Ññ·~ü?ñã§øöw~îÇõ8§áþÞÍ¢óü,þ£ÿ¤ãkñ/ø×Zü~©ãßuü¯Ôâ?ñ_räõ?2ü¯ØöB½*¯Õ((ÅOUU«ªñK^ÑGW^2*®tkdðËP«+Cæ:]-Ññ _-UêýÔ¤KÔ2ù\Ψ¬ÏjÐT£v8ÎgF- `ÿQó¸K©±Ø\&Ûª ¶¦rs4§à=I§9/qøéXo"iÇ×H%rÛª[×íSðt§ãT·´?²ó#Vf¯9´HÉ}f&!ßî¢'7È*\Õ?MX9+sÂÌX±ÖH6³bCæÕ1Ç&¬TGiY+7l[Qß:ßûdÇ@m¬Èh]w±fv/¯¤°¼¸7ÿÂ-®VdôMÒÎy$ä"ÿõ§3c±©d,kNÅötèµ&st¡)}»Ë×4sãcsM"{`"Ùkë¼äw(øÙ]¹"ÃR^U®St "l¯:¡æ1[fÜÊÈ^vD¡á©ù#Gì}ßMñP7/M¼Y.ßGÃJb<Cæä¤w§Sñ,YqÇëW\ê^Wó¡î>¡å?«Bm"% Ú±Ì{¸ÂË/sÔºÇMÁ¥XÒ´¨ÒnQ¹NfÖÏyJñ;j£'ÔuO:6NÞ³íÜ=0dñôhÞ^aËØ8·;Ýuq_*¹pwùÐÈÊncÿüH.cÑoÝжØ]*ë´}v°IqeÌSk£àH>ç$Ý1á/1d -qV\ØÌIrzRv2û&3ÖÄ%GÇI{FʲâÙAëD1¯:.:D/ãÇPè_ =gML2ÈкH(2ïu9iZ kÁ·vU<ñÌ=ÅJ¦jßQàf[y±Y/ú$pÔÀÆ äq7.OqXÂòyC]¦VRMºº9oïx÷¸W¨ õ¸ÙµX`0æ®1OåVÙæÊÈ`IîÉdÒfÁ,W µZ56u¥¡Öà8}_¡üDbqGt-kê*C]-2õ4ÓP-xLh&¡®QDÕ¥¥CqÌÀûð~CSaö:çä6ÆGèòTÜÌK o(QÉì±|Ú¦2%*/¹Þ2n% £¯%5ܪ©¡¢ª©ßΧâÍù55i±ÄGu¡£YSë S×jê:Cm0VÙkÞHº+¬,R_j2_BÛÊòÛ;;LgsB°ÉP׫vCÝ 6Óe#éøIMm1T¢ÑºQ±O±i¦«oRÛ5Õe¨ªÛÀÇð¡vªCõ⸡nV»ÕG ÓxLS·êVMõ«M RþÆ5:cÚ®5ÔKñë6<f¨aµMÖ÷pÉ4Ô^ ÑÔíÚ§öê:h°2Ôä¤;Õ]óòyXÝÍ.òÿwcv×98î9jI>ù¬)¥¬ý`æ¯]Ð*'im"»3¡|:s%%bÈnNVú©}C¹Ô§æ±;ö½»K;+ÎûÁ)W ì46îO°2Ý,a¢eÙýÜ8¥©¸5µûÈ"ŨO'LæEë¡nù,W~2ËH¯¥ó¹òÂe]lÑÄú9¾TÎÒ]ÖTѸPk_Å~¿¬BZ<)_IUݯã¹(Ý×λ/-NéÑ¥ÞÙÀ×"Ýsy¥u§÷$-ùÈî8¹×s®EZïòJëì"TÝo¥Æ$)aÇÂöe ÞX¸æ@¶»¬/.¼`â ùÜ{rÒ²dîÛ½RyÛte2&ÓÁÓºNÞYE9çâ-o¬I²¿õ÷ öÞ1ÜÓu«cfWYãoZhæüÖß°Ø´ÞüHÖÅó4ØÉ¹¹àKº]ÑÚWëXÞLfûÆRéåäÒÚù,°Ç0ÙGit¸9h´\òÞ]Zµî¯'dáÖÊ|C¾Ä~e;>íM3ë:+ï ¿\äÕÞ5M'!SüäÉ> 7.bÖ¥¥¬r)§fçs(´29"hóë¿1-[q%ò}5ªä©CªJg¿¼8ØÊøDâx¿bÙÝà Ï@=a³'9úìÅuàh8H!͹8æ o, ?ª9a?g`Ùo§ c¯#« ÉÞ<gQuÒdç¿#»Ëy-uʪ/¬ ¨>³ÀÐβs|®¡"}ÂVï¢-®½pásðÎÀ7-@{AYâñΪî®F#ÑêîD¸<ØV@ÍCÐ9ùe½ÈÎ öjd6ÎÈXç~-±¿¸ú<8eÁåDSp·²4>7oÕâ|¼!p>ànÞ[æíÓ½þ1\f¯Ë,ë2;¾Ú¥wÐOÝXhC¶ ãÍFîÀ-¼Qê§ä 5Ñ·QÃ0ÁÛÇÛxú4b\ÕÔ4ü¯"ß5x3ÞBêú5/¸±êD!ß?òÄvcÚÅ/áªÐTÀåÁ+ Xý¹¡=h»Âa,©«³u÷Ôõ¹êBEuÍ\ùqhixªª½«Lm¨¤6TRËG?GQû#ßrkkÜ Ö{ð·ÃSÝî yÆÊp[£'DL\môpu»wúµ/ s`]CðéYÃÔ¬§;«Í<tr,:ÌÚâUÃ4x;î§¶z´âøM )ÿNÀWá ¼ïa¢½WRüx>î]ÿ¼Lnsou»cóå§Ñ y7µûB¾@Ý'àçä !Ï)ø¦q§Ý ¶|û§QG¡p$äÁ5÷{Õôk/Ì¥ûzÔr¤öcDA®ài%("Làë ͼÁMÜï!0ä»hI yÅ·ÃBïë÷ÂÒèYÜR°«Wh4ÐI¸Û² $ß%å³è§1Ø"êg1@kôh Ydô¢Lp|Úv kT¶ÏGÛä#ìDv9ðÊINH¢ÁÝ¢¡d+Tnô²¢ÑÞØy¿GM¿ú9èîcMÎ` ëhÎb-äã:ð;Ð9PÏgÙ%°&/0&Ï0Ê_À×H¿DÀ~_Ä+x^ÕáK*3ê:xÂ.9µ|e4àã, µ®Â'ye¯fÊv`·svßǽÓÄ j±ôI"¥Z·ËGb\Ä©OÛJ(ATM}VÉ¿ìÝrú ]|!zï¶þHp¸=§`D<¶'ÜÕ§Tc¯'^ÀíÎú¾ö?ÆHðM"Á6±°Sí7ËWiéXIoÄðõ²®5TBùsÁéUZHoÇÑó8dí<Þ4m£=wÇ]|_þ ü,VwO£V¾ÚÎÃ<³àüxþ7Hþ}Ù>?ìh.¿ÁÍ2/ºäV¹ñY|6s+ÀìRø}|ÞõÞ6·Yû§à]øvüu}¿ì®¾ÒY>ü}WELUÔux¡®P×Ñõ«ë¬-óä¯ Â@D«ã'~²=uãÀAp?mÑÇÏÙ\x Úø ä¡&¹þùPÜ&4;O ÝA)vqÙBm'+Î%M® %³¯qqNÅq+×5ÜÔpK@}åïx2ÈÕ6ì×¶Õ²½¦U×k.ðéªÉhÝ ók¿imÊH;v ÙÝHZuZ©ïzѺ\0]Ï&§J+}UU ô×\O.mo6dðÜn´$«ò»µb.ïb¡^Uk÷Û\̧¹¨¶ì0d¹Ó§4,t`¬·)£%äíp±ÔkJØ;vòh{mMt®År{zØIGǹØi:7£·g˨$M'ã6êþvàÈ'.ÛͰê9f31Û&0(0Ú[À ûØ_~Ú¡t!oâîèGÜÌÒö,²&îaBÃ}ÂÿJ`à°ßrcC:TJÙjomIoU`¶åSæùíÀøÉp¬Iï; uS¦°9è?²!Ó:B»Eº¥P4ÊåÊ(ßbährxs´¶oab#á¤ËI¸f~!õò ï4IêÄ%ú¹a¾ÓÐ÷@i÷ºtiÌö FЦº«ì:sèÚ« óéµã\ÅÌ= hÝB>÷rµ·[ÈÂ|=AÈt,D¡)1¦ñ%è!ÜÀyPK p® ·ã]âónïÁ{¼ïWð|P?$zrÊøX3ZðqPÐÄñ)m8§Ðȧe|FA»0ÿYEû9Î2ÏyW°ÁüxDÁñ%¡ûeÑûJ3ÅWýøZ¾oøñM1þßVð<æÇã~<áÇwýxR¨\ðcÖ~\p.ûñwŧe|OÆ3Z3©T&=ÔSzÚ ¥Óº9Ôr9='¡i89hÄj=-ål{ä6¥ ò ¦61rÖV=3,½$×d÷j)]B£ÔÒñиeé8¼ÇxFÂ%ëp½PJ·tó´fê¡Óú¤0çgUµ}a#mX{×àÎĸPkÄHë{ó©IÝÐ&öÒ¨<¬»?z¬Auãþ¸Î°h¦zë:ÞÐ.#ÉQmÉ =MjVMýZ\ßí,1· ¿Ë*aeÛ®qKÿÇ襣¢È$̹)ç,U7Û/àÐsSnpX&w<XÉñÐé ÑPª;Ýß)£LGõ¬edÒ9ßqUÂ-QSç¢umïúg¤Lve½ üoÔgmáå5<¢O *ÌqÁò?1gzJ1*ÎÕb1=6^¾Í£õN[c½(üðdm\t#ÓNkIæYMtׯfGs<«EigeMµ;ôtÞ:qÝ/&ÿ|êTIÿæ\¹P{ïõ2âüûK$"ÓjÄf9Wèy i-ìéðHïNIITÚ-g<-ÕÓ1áþa¬Ùv=¶ùãÇu³^ªÚ§Ùö¢!7)aQ-+"ÈyÓä9Ç^&Í2®Ðá ~^R@Ò½6ÇØ= þGKVu\AFгëgÁNgòfÔ¥§&ao0£b'FÈ ðz C¶7âÆ0Ͱ£ÃØ3£ÂÜ)a®1â'XÏÆKõ*^Ãý<³á1ÕmÄ"¼þüw<(¬ ø; ×/ɽû&OèQfÜ"Q ¢wGÆöN¥wñWçîÆ)û&¼Ùß~J ùWÐz1¡z7ïHßcE¼s(lA¶2aÛGÏ Zq÷Ъ ®õ×»»ÓÊíhãvÜ2ùWÑV2ì³§Êv¡Õ5(!X3í4³À6Ó^ifW3qpÍSZ`nÛTé¢bOí¡#2÷]3¢ç&÷0ªàZH\l\+q¨êÞ ¬b¦fÛf:*Í®jÞ5²Ñ1èÞJå»Ë½Eå42®ò _°ïNª{¨£ ÅWYf§XøTU @ôª@Ìê@:+ ÎÉ@r.y×Ö6n¿Xg»TîeÐEP]Û! l°yE`SEcå^uUz¯êÕiL»Êÿä:ß×Ö=KÅ 6sÙ_¹ö2VIà¨'°ß#}m6êå5kÍ%Å|_ùüÚòAù`]QZ!W÷Örõ»ìm¥©R¸Ù´w/¸ã·YÎðÜ·ã<·Úîv;.·à<f¨!Ù½û¨ÓÀþê8!8ñ ߯NÁ16c.½N0[÷öÓÁ gH¯,°é|gÑÁ×Ç2öWá9@;8ÿ »2n ;ã5°°´g5qs ú' ëßϹéØÈ@H¤R ø<zh1GöPK {Wâ¼]ÄÍ2mkU·a'j#ÇÒÊCûëY;´fvvÿCpnGÐ6oXaÜi!¾mù^jÂm·ãßø¿(²ÛÖiUðscÜIÝTìeùÓîÀßÌvûûz±íûB±°$,ݯÙGú1FpzûïPK ÍGEÔXSZ¡U4¶ÐR*?6Ém»L>êîªOÎÈ8>óO¼8þ,Ïþ2ãxînª]±3{î¹çþι¿ß¹'ýõÏ ¥æÄ:/ÌÛÂUpN d-³(¶ïï]áWðXßW0¥ ¢àùÕ¶ÜyH&{AZì48Ã`Õjóån«ÆíKfIdµS7MÛû^Prw,a¢Zï´w¹}Ó´¹q×ËåÆu×j:³ý6o®u¯¯Vf2Õëæ Óhímc͵ööìÁHö`YôU¨`½kÛ¼í^0·}z!ÐXïõÎ÷ÑîCjóp×LWÚ ¾Gá¹×sûÃèÜ îÖ·©Âà6wW{:BS!B³¡·Gºv!ºkÚ.µT ]êqζÍ/ªã*ê¸ 4o7ÔµN×®óóxçí.\ £Óð!ª (*XÒ° pa8\. «XæuÐT¤BÈÒTmi¸Â»ªa×ÿ.®ác|ÂpäÆä+µë¼NJKô~e¦-SÉÒÃìcüGZV:©øÇ2ÿ¼kZúß[TÍ^%¹»ëwo:ìmþûqg_ps;Aa(:¸q§[szaA6t ÌFCP?ëKîÿTI¨âvüÇ`Èd6C¤Ä0AÿJF þ"`b@ȾL;VFk4÷ìGrúp¬ì1NV §ýðãge4`,s<çõLòÃEª ¶Èæ2ªMóÎXÒÈF³ÂæjèHX-¢)¶a^/BÉÞgOkVû6 m5NÄ ºÑ£` :YÆ+~¼®`/謪R&Jh±¼nkYQ¶ØZÉÐüÔ zn2MÃ+L¡Ô!!Õ)xo*8C<»Ç·¼Cæ.ïð,.*xù.ýxWÁ{xQ,бÈRð!>Rð1ûR°BºaĬfQOúDÁ§øLÁçøÂ/|ÅÞ¿Æ7 ¾Åw ¾ÇÖÔ¢v÷SM7¢àG\/iM¡¦XëÇOtà:SÉ;¸DZ ua¾4[y¤¨!¨¹ÐSº«5Tnuú*ànðGÁ¶áj(i:ÿÃiÝMµ¯î°©¦Ýï'»1à YÓÂÅZ<ºmá¥êÍÍçÓrX:Cu&ûÉÛÂíymKáj.ܬ¸Èªtxd½)KW±£"xg«ÙXܨó«ã3L*u®7¹MzeY[渷jAßkêy-rüTMóáú×x£Ð{äjQ[ªdTÝ&£©·ÕäåqSMíÆÇ^l¤OúªñÂà fîQÎHÆfî^è»>E±äóôÔO(rdR¤ë<·ËíE$µd«ÂN¼äx>%ôbW /û©[ô#;Ú]¨Çî2_¾/éï¾ê¾¼¾úÉ×¾¾ö}Qk.úú¸©§±öXßÕÝSï&zv{ï"0q sP"¬ ¡y%µÞ4Íá©¿o;<ÈXAgn¿AÒ$í¦øvÒZrØ).E-åÖý8àøêÅ ñwä)_פ*E¨JñÌgäCά[ñÙîîÓgzÎìëÿúÀ,6xs>M"¹ñ Ï0ñ |©ù¸®¯ôÆÝH2õkíÞLaKnY¸-¸å)Y jGÀ^ö}©ên«%[tT£=O»£¥§în¡xõÂM¥Ü× }×=ßâÙܱԬJ¡çËv£,Õº[®3.5+n}ÃUö£ lyľ\ª4 ¤zæ*Yx&Ë-/ G²¼ä²Fzì4TQ^ãB6wråän1Õ½êw¬í¯IÎ;[Ù#jWݼÛMkªâIk\Öec»N¬ãrz ý4B4+X¢úLµ· ¦NŨAÔ_`ò4,yU:(pþ8¾îö¶ô«÷¤ß&ÃÀltÝõk µ@y~m±½¹)O9ýµáHb²ÀÙ£pµPÚJI?м¦¯Åw zä\k¶UEÞñ´4{d0««má}3<#pÞAOí»øÆÆe,[øÖÆw(Ù¸¸dã>Vm<ÀCkxhaÝï&Nì"pñð}-뮪É@àÊQî}tzÚq·Zåóï½Çûå§<E1÷ÀࡪL X[nkEþV~è¼éEgNHt4»|è®ÅÝ®Æþ_¾{¿)&ìIàÒÉr;V&ÛàUó P¶Z%´Ú׳ô§çCä_"öø9âÂø±Æ¹2Ì7è áÎѳ»5ø ¸ÊÚë~¢~ÂI漡4ÄPK :ÐÉÐärA(#¢`?ÚB·cb¡aÏ¿W»·ð¶S1lqÏ[Æ; ÞÅ]ïá÷ññûøXÆ' >¡?÷ñ¹/Ð-ãK_áëÆ«a[1ÒH>chi^²¹y@׳zë®Ä¡UCkðýPáq|«àô+Äo6V÷}qâcªNWÓºB-Yµ:3Sv× Ç¯óÑ+î§ .Æ·Mð:ÃÕN~å¿[¥½ÂfáQ·ß¶®Pj j3׿ÐPûÚ¨ ÕÜ¿i^¬.Eìö>¬l:6pu¿;ù,Ê >12ÐvvÔ¹B»ÐÉ a|FÖZaØ»Ë:nÏÒ;U¬öm.Y¹·w[M¬O¬Â ³n°>EöÞ¨¦Ïºè«©J\æLÍ íÓ-Bcýë#KFs}x ,¼ªÉ%T?ç¡Ò(>VxÈëOöxÏÒÌpݶ¯(ÍbÏþÞ¹Ø^ö:àC.à%Håà.Wðaq²¨2YJáÈ#x˹$L·éaee{OGI#øCäE U#c'# ¯NÉò{ü+ñÛhûõÒGbí·Ç×ply_9Ç>B=¿ÇçH<á«,Ö*íû¡L¬®bÑEim"MËðÓibäÄ) f"R̰ê8Ð@5Ù.}¨Á &Âíü ôÐìG::YJy¢Ã¼`º[N¢~â´ÉÚOLk? >k(½¬lp>Ú[\Æ&â_Ûãíz;ÃQçAõa©YùPÿ=Ââ©Y* áwø{ä 7(i§±¦°Æ»{ð÷6¾Ùp[z¤ ç vÚÞ ©>ZÀSArÔTÀÖ)^zz`5`ww-6 q;íd±¿=4sºG/Ëm¶=$¯ÊOï°&L`^"E&IÌ Êû F1Eÿ®â¦ 'ä5zï©*a*7KZ ä9BÈt,qtÈßÒö"Á$5ø D¸íäoÖH1GëEGëEGëE[kñt°Ú'FÖÁNÙÛÐé$v ¥£ÕòNÒÝ0WrÀ NÐ3V6PêmæO:ÝÜo¨bì¦ÂÜS"Eç.)ÉÒºl7Þóò?PK [ZÖ6mÊhÝÍIÀqJI¡¥3Óe:P¦3Ði§Ì¾tJúûdÙV|¾ï.ç{öEo|øÓDTË#:EéWý³F¿Ö©þE§Bz_§ú@§ý«ÿ¦Ñ¿kôý§NÅôþK¾ÿí¦ÿÑ©þWÿ'ÃotÒé}þ_§ôÛbúÎ31ËPàæB`eG%Øéf³¦³äX/!ÃYNÓi2+Y)ftVf7OïËx¦³d³ç.å\'/]öøRùt¾çk¼@ã :¤ßºyý¾À.Ö¹+e¨¥_.Ü\-×h\[DÔxNô¾.uó2ë´k^ÁAÃån^YÌWðhRãæ:Y¬;ktàµ"Ú߸¹ÞÍët¾dX¯s#oиÉÍÍnÞ(ÀW-Å| o¡U67·Ëöf7_+ëëܼE¾2tºy«·¹y»Î;¸Kãë5Þéæð(t»ôÖö¦Ýë·45lbò´î í£¡X_°#ÄúV3Mmß¼»aËÆÝ MÚÖ ¥RÒ,(OÏ=Þܽǧq^¼¡¡³iwóæ-m Ls-´y ì$¢æPÚl'B<3,X ÌBA³ÐBÃTç墱t¿ó\´¸`s0DÊ{L®5X$]ÏTXYµÉÑïÁî´ÖHÌlè6¡î¨)CÑm¡dDÖö¦#ÝI1-j ÇfÚLî%ÍàhpC<<8`ÆÒæ@(ÊNg÷`$Úô¶²5ìî_öàbtõd©MÖÉxº&ç(iöFlíéH<ÖJöé¦a3!K¼]»ïî±_èòSÅdd`¶Äãéñ6Õn¦=4 Çäc¦ÒfOÅS[å$¿9µM`n²E.X{¼GxlmêLxN vgI¸,²=Þ1î·àrq^.³fx0IÌ=³jLð\ë®Å½[,ƤºfOÙúÁÞ^3)n8K§Ré3µWþÁâÈï£F"£Ye¨cKË=@Æòø¤§ò?>%óÚ¶PtÏé=f*$Òñ$Ó¥¹¨3DlȬÎ!¶ó`BÝ5Ø{"´À)fÙnC²O¹sC27W×Ô2TæME¢Hf c"ººò"RuAîÜ,VÝFLpäÛyÁ«¥ Ézg²+óølÏ=IÀ³fj0 q§M¤E¤¦$Bɹ!©3q"6G¢æ8¹(¸*#)Ip¦¾pÞHß`R¥\sôF$µMÿÆ7iRZ¸dîhkeZS'ómkü(ñßöþüü_ôm xg¥nûøùpèÊüSq·?öÀb¹AÖE*§$ÍØÛyÑØ<0¥&QY¡ifF.ÄùÞ¢þÔqÙ ,e?ñ =nÆÆ îKðÔpÔ®§ôø`2l6+k9©ªwÓ{ð¼¡gº$7w( f¯LÆ¹Ç ²n7è3ôY¢¿Gt6½e93óÒ"ÂM¾8òeê¡:Á½´@fýå÷2éô<EÁQº]ãc×8aðÍSúã¯?òÅâ¾$¼Ä'QÓà4tna*¬µµÖ ?½Kïi¼Ïàý|Àà|Æ1øV¾ÍàòíL¤w2ø½D#} ¤ÂEnÐ1:®ñ|ßmð=|¯Æ÷ü þ¤0ô)Ùþ´AÏ¥(mðýüiÆ5ø~çù©ü<Ù_We~^¥×4~Èàù¶_¡ÓÝ:wKG?oïçd|éØ~Ô×g& ºM¦*DÒ)ÔZÚÊFP64þÁ_ä#P/뢴/5HÄðg¿dðcü¸ÁO¶Éà'A2í'(á(? >ckLb/÷Á}Ƚ¾LV¨óiü´Á_æ¯<Ä_ÕøkÞdªýý: ±g,úB>릯vP5×T¾fûö3î¯XZ»¤Â·®Þ âù>ý@ãg~¦ÂÏñó¿Àðïµ}Î èT|L.X4ø¸@àQ%û|@^Dt0aÖ¦LPBÚÓø%Q«HdB,ȸdÞFQ*¶¶¶øiÁE´a¨Cs²<T§0ñËH-ѨÙ6Ãf*2[R®<*:väMϤÎÍ9»Dmåºn¶P3*󿯲|Z o+2U_T¯-|=xsR´5îíÎþd|¿ØÉê ØÏYÃd±»ÓñL=-/ª¤Pxog2ó'Hé ¥9L¥.L§å+¸g2³ÊS4î0(ÙtDº£·´ M¯ÌÚfåµ)ÁÿúlÏ·ê¼õ¬µQ·:µxlȦ¹yß#Î>×Jc`j5c}é~Å1ºW 1¼rËÉ29Ã^ÙÅuÉDMJÍ -äæ^ Fà/Bó²gV¶´ä5SW¸?lH[Ç%´FÂiÉÅéøVm²1_M*´ó4jù,R¾cµ"WåqÉ¿Lå¢Ô¡Î>×X LØkN0 ó}b¢óDûÊêÇ[:$®1þ@Õüʪ÷UX§²Sq-f¨'«^;Ð/´ Ìæßs´Sc&â¬ßÌdsHÙ¢8fîo¥Ò¡©j[îs×*Ø÷O8¢ú"p¬¶3Ðyê8/ª °i\#Rzì¾ ¬²*oO1ýÂD4]9G ºÞ,Ù¢¬oÂMö[¥÷Sª_Ì÷KÀÅvI¹Që 0Ðe "ÒhÔ&ÍêS}Q{â«Kµ ¯[JcbúZÝ:nu[Ϊ3ô?U_Tnäô$×1L è.µYCwb4, f³±9töWØw +WhÏÊÓ£äÔ §×y½NÃ' \rRÅ]fﺧ©öT{5~Oå(UÉÖlÁ0töô5ÕÓ4-PÃ5à~TÑJÕÔµS3m¢Ú¨¶@Ì0ÔNXØVú"m£§°÷u)Im!¯G $¶¥Ïãj¢ÏcÏ)RÒ#5;¬Ôé¤gèÀYw yô<UIÆ66<W¤UaVôÛ~%úíPgLî3}ìø¶xæ"\.9c²ÐóJöÓpöìGdÛ²¡¡Úòåd+Å¿,_(µ§Úãä¢R?üÅqc2§p}sÌ)æ(eÞNSðÀbì,1+°¾ a6µÜc"+xÔHÍDj¬f'pZ f/|K~.ìXýؼ3 ª:þb±Õ¯ãLÖÀíe]çò:kFimæuù½jûѨHt/Æû¨Qk.âÖÎ ¾þþßý}Dü%ýmB;ì¨:WÔ¨Çé¼°êÙ<J»ÆQëÅïP t=3Ô¹0ƿƷ¯gÂç÷éÖ+»ÁªXç ¯d B5¦T¤>E»ÚW:Ê50ßU5eeuÎÔ7À%æûK|¸áuVC#RxÀçºe0í3`êÉ/ËÏ_R/IÁ¯nn÷{Lhæ]uf1»}°>±ÎU¸R+Cä7y]eÚ²:wÀë>E}( Wêeº·gõÞ¢2}Y]q"ûÍï-¶U¨êÙ~+@túê! ãcê¦ßÁaùJ<ç&s,ßHL°¥°¦r¨zÔ¢WBÁ[±Þ ß ôB {¡ýÑåGhþiøoáæoÁÚß}þ±ôXçßÁ0~ È¿Ä?ÐÏè=úÞa½Å:ý§Ñ/øRú%×Ó¯Òï)à)R¯8AËZÀQ8öCäk¨r=o\Id Ó¨p~×PÝê# åm F¼N©ÙO Õì3Êy!h|x#hü)þàîÇ 5©å» Øò«vÛ¤=,,UØ+v$§åB Æõ9×d Ù3ýý£ÚõÐÏ÷f¨_d¦Ê P<yöÒÞtCá+=AKñi8AË_¦.Oì$ÅOÐu¢2Î)ý@´Qu)[R*ýåï 5ñLèù YMëK3d¦5í |>2¾)$hìÂYÌÍ{9÷¾»ùú\aâ,D_ ²»²$p1â zWÒ¨<3Wê<»0wçxJ<Y \£y{®«ñêÍèTï-þËF/¼çä U^ô¨¶íywÛ1ÓÂJKÊU\Y#JíH%ãu9ò¾ÈÝ6¬3+eJÚp»«ÇÈ߸þW¼@_m,(u@þm´ÖCµ8ªõx7wÐõÄsì<å¿ Þ7PK Ä ¸v# Í\Ï{ÎýÆ3óãço Ã+Ñú==ã=2ónØçÞd2×IC½1CÛí¾ã%¢·<Îï9Ï#©DRõbÇÝö/õÇb¡6jS©HöJt¹/È¡aÙûî!ÃgVÕÖe¼}ôÚ}y"Iªÿ®µ_2ÌðqÛ9DzAí»"Vâ@ciZ6O¹¼FûíZUÄIQ0P#ëËΣ3U¸EüÃî=TÒs\«ÿélx$`8µ`(ïè/ËäüþqJDVÅ4Êä¥dXÃD»UÜ®b krz{âët ïiïPôi׳§7M#ïEzÃ5~ÓFu;'g4aÒã!½$"ý+4s(2¥Ög°OôQ@Æ©4y34VGÅEâD-+.~EácFÜÌÏ£®Å÷(ñ!£\I£UL¾ÐH.NÐÎ8óZ|_$âbV|g¡ô¡á".iUÍP`Y»c ¡4 |
From: Russell G. <rus...@us...> - 2006-05-02 01:14:20
|
Update of /cvsroot/httpunit/httpunit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11018 Modified Files: build.xml Log Message: depend on quicksite jar Index: build.xml =================================================================== RCS file: /cvsroot/httpunit/httpunit/build.xml,v retrieving revision 1.83 retrieving revision 1.84 diff -u -r1.83 -r1.84 --- build.xml 4 Apr 2006 22:58:36 -0000 1.83 +++ build.xml 2 May 2006 01:14:17 -0000 1.84 @@ -23,7 +23,6 @@ <property name="build.dir" value="build" /> <property name="build.classes" value="${build.dir}/classes" /> <property name="test.classes" value="${build.dir}/testclasses" /> - <property name="quicksite.classes" value="${build.dir}/qsclasses" /> <property name="website.classes" value="${build.dir}/siteclasses" /> <property name="example.classes" value="${build.dir}/examples" /> <property name="javadoc.dir" value="${docs.dir}/api" /> @@ -314,28 +313,14 @@ <!-- =================================================================== --> - <!-- Compiles quicksite library --> + <!-- Compiles the website generator --> <!-- =================================================================== --> - <target name="compile-quicksite" depends="prepare"> - <mkdir dir="${quicksite.classes}" /> - <javac srcdir="${quicksite.dir}" destdir="${quicksite.classes}" - debug="${debug}" deprecation="${deprecation}" optimize="${optimize}"> - <classpath> - <path refid="base.classpath" /> - </classpath> - </javac> - </target> - - - <!-- =================================================================== --> - <!-- Compiles the website generator --> - <!-- =================================================================== --> - <target name="compile-site" depends="compile-quicksite"> + <target name="compile-site"> <mkdir dir="${website.classes}" /> <javac srcdir="${website.dir}" destdir="${website.classes}" debug="${debug}" deprecation="${deprecation}" optimize="${optimize}"> <classpath> - <pathelement location="${quicksite.classes}" /> + <pathelement location="${jars.dir}/quicksite.jar" /> <path refid="base.classpath" /> </classpath> </javac> @@ -353,7 +338,7 @@ <classpath> <path refid="base.classpath" /> <pathelement location="${website.classes}" /> - <pathelement location="${quicksite.classes}" /> + <pathelement location="${jars.dir}/quicksite.jar" /> </classpath> <arg path="${web.dir}"/> </java> |
From: Russell G. <rus...@us...> - 2006-04-04 23:08:21
|
Update of /cvsroot/httpunit/httpunit/src/com/meterware/pseudoserver In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21513/src/com/meterware/pseudoserver Modified Files: WebResource.java Log Message: support response w/o content-type header Index: WebResource.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/pseudoserver/WebResource.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- WebResource.java 6 Mar 2005 20:20:10 -0000 1.10 +++ WebResource.java 4 Apr 2006 23:08:10 -0000 1.11 @@ -82,6 +82,11 @@ } + public void suppressAutomaticContentTypeHeader() { + _hasExplicitContentTypeHeader = true; + } + + public WebResource( String contents, int responseCode ) { this( contents, DEFAULT_CONTENT_TYPE, responseCode ); } |
From: Russell G. <rus...@us...> - 2006-04-04 23:08:21
|
Update of /cvsroot/httpunit/httpunit/test/com/meterware/pseudoserver In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21513/test/com/meterware/pseudoserver Modified Files: PseudoServerTest.java Log Message: support response w/o content-type header Index: PseudoServerTest.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/test/com/meterware/pseudoserver/PseudoServerTest.java,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- PseudoServerTest.java 16 Jun 2004 00:10:53 -0000 1.15 +++ PseudoServerTest.java 4 Apr 2006 23:08:10 -0000 1.16 @@ -200,6 +200,27 @@ } + /** + * Verifies that it is possible to disable the content-type header. + * @throws Exception + */ + public void testDisableContentTypeHeader() throws Exception { + defineResource( "simple", new PseudoServlet() { + public WebResource getGetResponse() { + WebResource resource = new WebResource( "a string" ); + resource.suppressAutomaticContentTypeHeader(); + return resource; + } + } ); + + SocketConnection conn = new SocketConnection( "localhost", getHostPort() ); + SocketConnection.SocketResponse response = conn.getResponse( "GET", "/simple" ); + assertEquals( "Response code", 200, response.getResponseCode() ); + assertEquals( "Response", "a string", new String( response.getBody() ) ); + assertNull( "Found a content type header", response.getHeader( "Content-Type" ) ); + } + + public void testChunkedRequest() throws Exception { super.defineResource( "/chunkedServlet", new PseudoServlet() { public WebResource getPostResponse() { |
From: Russell G. <rus...@us...> - 2006-04-04 23:08:20
|
Update of /cvsroot/httpunit/httpunit/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21513/doc Modified Files: release_notes.txt Log Message: support response w/o content-type header Index: release_notes.txt =================================================================== RCS file: /cvsroot/httpunit/httpunit/doc/release_notes.txt,v retrieving revision 1.401 retrieving revision 1.402 diff -u -r1.401 -r1.402 --- release_notes.txt 29 Mar 2006 02:53:49 -0000 1.401 +++ release_notes.txt 4 Apr 2006 23:08:08 -0000 1.402 @@ -14,6 +14,12 @@ Revision History: +31-Mar-2006: + Additions: + PseudoServer: + 1. Added WebResource.suppressAutomaticContentTypeHeader to permit generation of responses without the + Content-Type header. + 28-Mar-2006: Notes: 1. The build now uses the ant-dependencies task (see http://www.httpunit.org/doc/dependencies.html) rather than |
From: Russell G. <rus...@us...> - 2006-04-04 23:00:21
|
Update of /cvsroot/httpunit/httpunit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15683 Modified Files: .cvsignore Log Message: ignore web directory and archive Index: .cvsignore =================================================================== RCS file: /cvsroot/httpunit/httpunit/.cvsignore,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- .cvsignore 13 Aug 2002 17:57:47 -0000 1.4 +++ .cvsignore 4 Apr 2006 23:00:16 -0000 1.5 @@ -1,9 +1,12 @@ build *.ipr +*.iml *.iws savejars dist lib bin +web .project -.classpath \ No newline at end of file +.classpath +*.zip \ No newline at end of file |
From: Russell G. <rus...@us...> - 2006-04-04 22:58:44
|
Update of /cvsroot/httpunit/httpunit/site/com/meterware/httpunit/site In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14236/site/com/meterware/httpunit/site Modified Files: WebSite.java Added Files: SourceForgeSiteTemplate.java SourceForgeWebPage.java Log Message: restore website format ***** Error reading new file[Errno 2] No such file or directory: 'SourceForgeSiteTemplate.java' ***** Error reading new file[Errno 2] No such file or directory: 'SourceForgeWebPage.java' Index: WebSite.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/site/com/meterware/httpunit/site/WebSite.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- WebSite.java 29 Mar 2006 01:27:26 -0000 1.2 +++ WebSite.java 4 Apr 2006 22:58:36 -0000 1.3 @@ -2,7 +2,7 @@ /******************************************************************************************************************** * $Id$ * - * Copyright (c) 2003, Russell Gold + * Copyright (c) 2003,2006, Russell Gold * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated * documentation files (the "Software"), to deal in the Software without restriction, including without limitation @@ -19,11 +19,7 @@ * DEALINGS IN THE SOFTWARE. * *******************************************************************************************************************/ -import com.meterware.website.FragmentTemplate; -import com.meterware.website.Site; -import com.meterware.website.FilePageGenerator; -import com.meterware.website.PageGenerator; -import com.meterware.website.BasicSiteTemplate; +import com.meterware.website.*; import java.io.File; import java.io.IOException; @@ -36,6 +32,8 @@ **/ public class WebSite extends Site { + private int _groupId; + public static void main( String[] args ) { try { @@ -62,7 +60,7 @@ public static void generate( File siteFile, PageGenerator generator ) throws SAXException, IOException { Site site = new WebSite(); - BasicSiteTemplate template = new BasicSiteTemplate(); + BasicSiteTemplate template = new SourceForgeSiteTemplate(); generate( site, siteFile, template, generator ); } @@ -72,4 +70,74 @@ System.out.println( "Usage: " + WebSite.class.getName() + " <target-directory>" ); } + + public WebPage createPage() { + return (WebPage) addedSiteElement( new SourceForgeWebPage() ); + } + + + public ProjectPage createProjectPage() { + return (ProjectPage) addedSiteElement( new ProjectPage() ); + } + + + public void setProject( String project ) { + setSiteName( project ); + } + + + private String getBugEntryURL() { + return getTrackerURL( 100000 ); + } + + + private String getFeatureEntryURL() { + return getTrackerURL( 350000 ); + } + + + private String getTrackerURL( int trackerType ) { + return "http://sourceforge.net/tracker/?group_id=" + _groupId + "&atid=" + (trackerType + _groupId); + } + + + public int getGroupId() { + return _groupId; + } + + + public void setGroupId( int groupId ) { + _groupId = groupId; + } + + + public void appendSourceForgeHostingNotice( StringBuffer sb ) { + if (_groupId != 0) { + sb.append( " <div class='sourceforge'>Hosted by <IMG SRC='http://sourceforge.net/sflogo.php?group_id=" ); + sb.append( _groupId ).append( "&type=1' width='88' height='31' border='0' alt='SourceForge Logo' " ); + sb.append( "naturalsizeflag='0' align='TOP'></div>" ); + sb.append( "</div>" ).append( FragmentTemplate.LINE_BREAK ); + } + } + + + public class ProjectPage extends ExternalPage { + + public void setType( String type ) { + if (type.equalsIgnoreCase( "bugs" )) { + super.setLocation( getBugEntryURL() ); + } else if (type.equalsIgnoreCase( "enhancements" )) { + super.setLocation( getFeatureEntryURL() ); + } else if (type.equalsIgnoreCase( "donations" )) { + // xxx link from image: http://images.sourceforge.net/images/project-support.jpg + super.setLocation( "http://sourceforge.net/project/project_donations.php?group_id=" + _groupId ); + } else if (type.equalsIgnoreCase( "cvs" )) { + super.setLocation( "http://sourceforge.net/cvs/?group_id=" + _groupId ); + } + } + + + public void setLocation( String location ) {} + + } } |
From: Russell G. <rus...@us...> - 2006-04-04 22:58:44
|
Update of /cvsroot/httpunit/httpunit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14236 Modified Files: build.xml Log Message: restore website format Index: build.xml =================================================================== RCS file: /cvsroot/httpunit/httpunit/build.xml,v retrieving revision 1.82 retrieving revision 1.83 diff -u -r1.82 -r1.83 --- build.xml 29 Mar 2006 03:00:30 -0000 1.82 +++ build.xml 4 Apr 2006 22:58:36 -0000 1.83 @@ -316,7 +316,7 @@ <!-- =================================================================== --> <!-- Compiles quicksite library --> <!-- =================================================================== --> - <target name="compile-quicksite"> + <target name="compile-quicksite" depends="prepare"> <mkdir dir="${quicksite.classes}" /> <javac srcdir="${quicksite.dir}" destdir="${quicksite.classes}" debug="${debug}" deprecation="${deprecation}" optimize="${optimize}"> |
From: Russell G. <rus...@us...> - 2006-04-04 22:58:44
|
Update of /cvsroot/httpunit/httpunit/sitedocs/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14236/sitedocs/doc Modified Files: citations.xml Log Message: restore website format Index: citations.xml =================================================================== RCS file: /cvsroot/httpunit/httpunit/sitedocs/doc/citations.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- citations.xml 13 Jun 2004 21:01:17 -0000 1.4 +++ citations.xml 4 Apr 2006 22:58:36 -0000 1.5 @@ -1,11 +1,8 @@ <?xml version='1.0' ?> <citations> <section title='HttpUnit Extensions and Wrappers'> - <citation name='Canoo WebTest' url='http://webtest.canoo.com/webtest/manual/WebTestHome.html'> - Provides an XML wrapper to simplify web testing for non-Java programmers - </citation> <citation name="WebWalker" url="http://webwalker.sourceforge.net"> - Another XML wrapper for HttpUnit + Provides an XML wrapper to simplify web testing for non-Java programmers </citation> <citation name="jWebUnit" url="http://jwebunit.sourceforge.net"> A Java wrapper for HttpUnit which simplifies common, repetitive test steps @@ -16,6 +13,10 @@ </section> <section title="Articles"> + <citation name="Test Web applications with HttpUnit" + url="http://www.javaworld.com/javaworld/jw-04-2004/jw-0419-httpunit.html"> + 19 April 2004: Balazs Fejes, javaworld.com + </citation> <citation name="Build a Java Web App Using HttpUnit and the Test-driven Methodology, Part II" url="http://www.devx.com/Java/Article/17991"> 4 December 2003: Wellie Chao, DevX.com |
From: Russell G. <rus...@us...> - 2006-04-04 22:58:42
|
Update of /cvsroot/httpunit/httpunit/src/com/meterware/httpunit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14236/src/com/meterware/httpunit Modified Files: HttpsProtocolSupport.java Log Message: restore website format Index: HttpsProtocolSupport.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/HttpsProtocolSupport.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- HttpsProtocolSupport.java 4 Feb 2003 19:17:26 -0000 1.1 +++ HttpsProtocolSupport.java 4 Apr 2006 22:58:36 -0000 1.2 @@ -28,7 +28,7 @@ * * @author <a href="mailto:rus...@ht...">Russell Gold</a> **/ -abstract public class HttpsProtocolSupport { +abstract class HttpsProtocolSupport { /** The name of the system parameter used by java.net to locate protocol handlers. **/ private final static String PROTOCOL_HANDLER_PKGS = "java.protocol.handler.pkgs"; |
From: Russell G. <rus...@us...> - 2006-03-29 03:00:35
|
Update of /cvsroot/httpunit/httpunit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17635 Modified Files: build.xml Log Message: comment out specific proxy tag Index: build.xml =================================================================== RCS file: /cvsroot/httpunit/httpunit/build.xml,v retrieving revision 1.81 retrieving revision 1.82 diff -u -r1.81 -r1.82 --- build.xml 29 Mar 2006 02:53:49 -0000 1.81 +++ build.xml 29 Mar 2006 03:00:30 -0000 1.82 @@ -74,7 +74,7 @@ <target name="prepare_repository_classpath" depends="check_jars_dir" unless="have.local.jars"> <echo message="using repository classpath"/> - <setproxy proxyhost="www-proxy.us.oracle.com" proxyport="80"/> + <!-- <setproxy proxyhost="specify your proxy host if needed" proxyport="80"/> --> <typedef classpath="${jars.dir}/ant-dependencies.jar" resource="dependencies.properties" /> <dependencies pathId="base.classpath" fileSetId="distributed.jars"> <dependency group="rhino" version="1.5R4.1" /> |
From: Russell G. <rus...@us...> - 2006-03-29 02:53:56
|
Update of /cvsroot/httpunit/httpunit/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14092/doc Modified Files: release_notes.txt Log Message: switch to ant task to obtain dependencies Index: release_notes.txt =================================================================== RCS file: /cvsroot/httpunit/httpunit/doc/release_notes.txt,v retrieving revision 1.400 retrieving revision 1.401 diff -u -r1.400 -r1.401 --- release_notes.txt 28 Mar 2006 00:52:15 -0000 1.400 +++ release_notes.txt 29 Mar 2006 02:53:49 -0000 1.401 @@ -14,6 +14,11 @@ Revision History: +28-Mar-2006: + Notes: + 1. The build now uses the ant-dependencies task (see http://www.httpunit.org/doc/dependencies.html) rather than + keeping the dependent jars in cvs. + 27-Mar-2006 Additions: Content and Parsing: |
Update of /cvsroot/httpunit/httpunit/jars In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14092/jars Modified Files: jars.txt Added Files: ant-dependencies.jar Removed Files: Tidy.jar js.jar junit.jar nekohtml.jar servlet.jar xercesImpl.jar xmlParserAPIs.jar Log Message: switch to ant task to obtain dependencies --- NEW FILE --- PK ÷GIéAdQîeÊÙÉÉr}÷Lîx-¦°iµÕ~kipvZn9kHõdrèTè³_ÑDÎÓÂïå³r±½U¼Èá2>ihÉCr1ûÚ«¢Å#ƳPK ZÖ);]0& ýw;s-ÃL3skxßÁ?%ÑÄð¡çΰHäMzÎåõ»÷÷¿ LèLAS SIL+>£È¬"¦"Es:êgH,9#Wz;ZÙ·ÃpÍñÄfû !mÞpI©ùwwxà(ùX©É]'d ÒTj~Ð4y[»Â¾ï&÷¤)y¸o/¡é·¤ã{Ü5mÑ-<Ë¡YéòsI×çö£R-.¹ø{µ=þo*÷cÉÒü𾶨Ó[±#Ãèÿ1Ø"ÇUCç#ÓÄB¿XâÔr r4 ܦrôÿF¨D©ê¡%¢I:^\"Ç tOcVe20´^áµP±KóXÂ2-¨{ÒV°j` ëJ(¨ ÍPºúÎÒÑL\î5Íw 5PUêC×e»AYîÂp¥¶ãÚ§#¥»Ç0HÛÙâðd,§ÿ¬ö`ßv0ºi!8ÍØ% ¾vÕâ!z9ÆôôÐÀEÒ}ÄéV£oòì{dÎMDÊ\#jĸ[P÷ÿ6²ä¥#ÞG¼8ÝAO½Bût¾-«MuÈj½dV#{Vé Õ:8Ë3$ÑU¢kq202òÓIT©¼¨ù8Ïq êëîFuq÷£¦tòz)Î(5<Fß8i5òÊ=å|Ä3ôe þ á'úÿPK ¦Ò¢ªbäµ¼â¸%:H¥K8ºbLË£S»[Ü.ê§ÌóÜC ÚÄ1³h©ü®æ²R»?ÍEB²8& OÂ-ôK¨C½6¤ú7$nãJhÅ9æ=F̱¢:3¤ó9n8C*/HjÛ«mܰ i9<?Zp)%²§ñÿÒ7Óýy¨J7C+{$w»uð"F5{Èpg5ÏÐúÇøÓ$ô¶T4Ó¤4"à6þD·9¤ ¢·äu´'dLdÖÁ2í«d²2¬"ôÚûªÖ:ï«Ï´~A_ ÷N¥¹ô-NOkÁBvµ³-@:M ë9í$ûÑYAhUïÎeiXðLvD> ^ò2,í|rMï! ¾,çDÛÅwªûe±.ìx¹%K±üÜjè9O<0zhîýû5eÖ .!¶ØÃuH[n´\Q*ÙW¿ÀB³*$XLبɴ(¬¨Ó£l¢"Ù*£];<$©äã#Ðîp¤HgqÜÀ)D~PK uqëðÛSñ¼Û{ßPð¢!)^ßLoøÝSðm¾ãÇwñ=)äA¾/¿?÷¾äÃË ~¨àG~4:ù±ìýDÁO}ø«ñsÙüBÁ/ýXrð+i_Ëæ7 nÀ¯È¿µo+B'~çë ~¯àkô!=Õ½1=Ùbé¦f¦ÚHèfS\K&õ¤? äµ[ê"ÍmÍ=æõmí-mîõ¶õÍnòðÚ-×ý¡vË%úW7¤¥%¬.->¬ä6· föú aé}ÈHÆx'¯Xµ1lý!mHëÐCaÄ!YZrsTïK!+f$´x(ê;ÙÎûJ<>ÇÒ3¤Y-QO_,®·ë÷xA*éX<´Ê45û4ó{¶êçl^û.6$bÁÊX"f5ÒuKºhÚ&#JÃc }Ýðà&ÝìÐ6ÅuiO£WwifLÝÉ<k FiWO[ r~ݤc¦Â¤nwí]Yw8#äÖq¨Ü¼6ãB{ʸäÉ][ÚkꥧÚNÃÔ-RDþ¨ñéã)ú6½wØ¢ûüÍÛzuû ]6ùgyúT\MÅ&ôª¸©èÍ¥¸H qzAÅíøòú«eslÞëUü¯ tN[¿lU¿à¯Rß¿)ø»à*þ Ì?r$ñ³Ê³z8Ϥ5ÿÁ%úëÿ¼)0+ûS Ð਱¨±5!k@¯é3âqc+7ÖxoZ.¥¤¼Kwbð !rT×TÇ¢"¤>J:Û T¡" UáEU¡bUÌ%¼Ø5á¤n6È´«RUr²¿aPÛ¢'B"ï©b#.a~$|SG6x³ñ1Ñ3âh:V)iÄ#èGðQ)m À)mPnªTÅ,3n7-¨â8éÙb*ªDµ*æy*>¸b>3ÞÔ¦:àéEÍ ÑAæ7åaT¶mºoì%³,ÜI».æÐÏìºÞ4ä2ë©ÞUwSèuG¦Üç´,8|NæçòÃË'& }/®¯ ¼Ò2_Ë(sÛ<ý*Ú¢ÈNh¯Jáñ-mÑ:Lc«ÌS(>gWàÚ¼] íQºè>I§MþŧhÉu¶í|áÌ ,Ërϳv Ûz½§:ºtN½±h*wdJIyjîp%h4Ñ©4DUgÿpKËòw]TM*äbɸ¨évñ¥/]åÙR éûè±-Øjo£¯slðí1PM¸ð À; à*b'WßÅõ«¹óîºçã=¬ëM;©ÌõTë[ñeJ®â ´ûxÃèz;ñr°'s'½³q{qó8{u:ÖnáXznõêº)è^ËÔ;)M[ ǵ|J§q²!ã¦*Ò¸:Ýøµ¸ §ñ¦Uø°-us£+µÊµkðnÊ3'¸RçÈC®·º6!Dú®·=x²GÈS²yªWÈeN Oc'-wK·b!nCß3qÖàN Íi¯¤®£XÒúä6WÐ.Û´T§u¾g¤pær(?+ åáÃÂåS(Ƨ1w§Ã¥ÿoÀû8ÍÑûÙÌf±ëÞrÃ% ù2pöäç=Áéi}'Ö^à>@:¯8Kø): çÚlçí:ôJ08G°vçïÇ ®ìg{éìqzê Êõ$êØáGêF|Ì~àp*¹µÍD=Y¥©¾½«^©n§´ã¡o³¢ÑqO¹ëzÇ9»/ïrεÊnn0×ÙpÐîÔ·Ü9áO³}?ËðÉày2ü>/zÞ&K#9w'å©¥ ?Á'<ý»ðIWÂ¥©Vþ«gµåaòûò#êe~i¿w8]JæßmGÐgÒ¡^k¯0¯'@×ñÀ}ÙgÑÁïB TÁ7¤0üv2§ªx§}Îþ÷?PK Ü¡à dIÒ¢ ãq¸Õ-ð>kxé}'Ht lF;HnFÄVåRS¨'è/$&:è - ¬¢¼ë@#½k{{dÔ¸û3fÂN#´n'RºM>z§X£~s=JCMà.¤-`$9ò=ªu¼bàü¸©p¼|09{ .Ç»ÂxwÚñnÞËÍû¸¹÷sónîäæ, ñawã# TÜÆ½þ ÷)hÀý2P0äþ O>ÆGyð1}³Â¡iø>ƧøÛ§¹9Æ# ÅgÂxLÆÅx\Ágñ#¬©"´qÖ}q ãiåæsa|^Á1Wð¾ à|QÁðeÏâ2¾"¡n© ¢ßê±´x×ÞH:ºeJP»MSØJÐÀm¥j{µÝZÔÐÌ¡hcëæPà3ª4ÛÑZÌØ-ì0µÁS{Ä`îÐëÆNtÛÖ¨Ðä´i\¡º³>44nè´â¤VÝ£¢7=2(ì~vý±b±]³uwÞdÀÙ¥ÆËjI-¶KDË2RQÍt¢º>.©¨å®U3¢qf\1]¤¢ë³Qr+ÎFoåu /_:»ôI´ß¥!à±1&ÖæùÈS£ÐíYräMÐëðøb¹YÆf6L¤MË9>$ÚM4»*nË2¥43,dg74¬dóà°9´T%ý¯ÃeÄùìj4pý °uSG£%xÏ??t+Êcú¨Ú"i¥tDzuÎÞµ×¼*[³ NO7=doqi¸uiÝÈ×»!lÛ²7ûÚ©Í}YK'Âîñ-HOu¹µ°°á[lËVãÕü¤7pÞé É!áôäéªÉ&@°$Oü-³¾³±TµOO¤fkÄKlf#Åú^O̳º2TýÓò5ÒMWµ$ô[õå ,e/¯®ôÂI ©(Y´Ë#Âtd|&¶ä'$´NQ_ NpÕYÇ>AÖe_Ì«ÞDV§þLT¹>+mÇÄê<Ým̲õè¢írX³U¬@åܬäf7«¹Yµ*Öñ['7×âA2ÓºzH®:F#î¦Ñê`ÚTRÄô.â2Wñu|ýù¦ÆjþfWJQ ´oáÛæ.ÚÌ6Xi3Qñ|WÅ÷°_BsD7#îfÉUýh[dnÓr"qkÉ[YDwÚT|ûUü ¿¦),\¿aÊ~Q»±EG®¤TìãeÞà:Ö&ã%§ð{PñGüIÅñUñ7üCÆ¿Tô£Gª©yOÛJñ¡Bêäç×rúÒɤe;¢0·ÎËl4#aÙ#"NG\@ó+¨J:÷§z¼Ð®àïù ´ÄÌPq^Zâz0o!±WO9)÷CzÈÛO$´ºm;?h/ÊÞÂå}#HâvN ¤n6]G:[ÅåNËÎÆ³p^¾ªtÊ#xGCaz=r.!½;K3LïRÇg.`jáen0Õµ×6¹¿ò_¶)®v´Wçîªàå= Âvò%g^*¹| µè*{FXHÿÓor|¯ · ¾d¸ýJ¿_å÷«ýîn¿Îwºý,H|S¡vVÒ¼Dý´¦qHMµGP9æ o¤v*©] c-'¬2X¯÷±¶Æ c&¬5e°ú|¬þÒXr1ÖzÂê*µÍÇÚ¥°ÂÅXÝue¬«(Ikgi¿ª±z ks¬«}¿®)¥cõV¬7¸X¾!Ó7ƺØ@RuÚc9¨;yUAr}z4sõ=é~ª!fN5=ÀIÌ< ugíôæf£ú8MNb.urö[ }é~Gí¦fÝú棽suµs2x ÍÍ¥®v5Ìe°`Îél¾ֺÀÅÍ-lJB9°§p^cËuÀuÇD7£Ö?Èòм[ÓÁÂ$>ùóBµÐ2XÄFë©Ùqw6Í#ÃóDZäø!TÞêÇþï¶1b@ÇÛñbÇc¬ö ZýÜá à- ðrbp0[³ãq´yÉTläöÇ[s·b/F]ÇéÇÃ77èoíË8ÓN@áîZ²Æ) 9¹Z=kQ¶~Y¥-(XÞ²ÜònÈÙk'ùÊÙ]ÓZ3ÁÒb; 0ÔÆ9~Ï" çsðdfªê®¨Y¹ãè͸Éê'iøªÄ7µpñfpIñávE÷^LÇ}.ZÄÓÈÑ:o¡¨J$Æ[qKèíxoa#IsªÉÂ¥~ZdpYñ.w`*Zu¾Ú-KÚ;]x-õó v1±¹ÞoÁ3T6Å?ñwHÿPK µmxi@À@¤JÐÄ;®w¬Ý1U $0R+õ+? õÎÚlÇ'¬¹sgæÜsïþòÏ ÃðËP´eä)n¿}rT·ø+îB¹/V«³æ]/ðÔà ÝSÅu㾬ªNkCÏùO\UÖ¸¿ÎCOûNCmzC¥*æËÛ¼¶)\%¥¹<P®âÑ_uÑ\ÙV¸ïÖE[uÔ<¹j¯&\ØÑ=ÌÍH¨Ñì£ âÞlNÐܪhI%*_Á·qµÉ°ÕOÏçAÓ]S¡4g¿g {ñMMÄiF)¢µCáïÂ7Õ¨20èÓð¤»äù⻥r@rZÃÂáY3d}-M:Qã×$ÒÍPvÚZ_ûxhÛmÚdóPy ^SËuë# J³oÑìPGKÃ^°&zQÆvkkZC;8%998 <Ä2ÃøÞÀFCG*òuàK^õ ðØBÕÁ¬"'¡l÷GµðÔÁ3¬8ø]7«X£ºþBÚw=ÝØ5Å0÷-¸gÝ>á~C-Q''â¥jôñÏöØ n ¡ï®Ò9D_Mç&©rÎë:@(5Ù&××¹}¯F. ®ãå`TïVßGtUôRÇ~Ch§ðä1"qã]Sú¢'Z*N¦ê¸@cÄêèþܬÒÜSºö¼µY{·u!Ô¡Ñ(¡NÆ4'<õòµû -¨jLþ 0Ú`«HƧߴbÛC"ð ¶²34»?K]JWõÙ6Ø¥4§NF4; -õPK Ã0Ð=Oþ [èý_S[(ôïK;Ïéx÷¸$Èám±ñºBµ8±û3áá¤Y ¥nCsÆ¡ò25zmïSäòEî1};U6Cûûë5ܸbùqPK Index: jars.txt =================================================================== RCS file: /cvsroot/httpunit/httpunit/jars/jars.txt,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- jars.txt 9 Mar 2004 20:32:31 -0000 1.12 +++ jars.txt 29 Mar 2006 02:53:49 -0000 1.13 @@ -1,13 +1,5 @@ Jars used: -(runtime) -junit 3.8 -servlet 2.3 -xerces 2.5 -jtidy 04aug2000r7 -rhino 1.5R4.1 -NekoHTML 0.9.1 - (for testing HttpUnit only) mail (javamail 1.2) activation (jaf 1.0.1) |
From: Russell G. <rus...@us...> - 2006-03-29 02:53:54
|
Update of /cvsroot/httpunit/httpunit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14092 Modified Files: build.xml Log Message: switch to ant task to obtain dependencies Index: build.xml =================================================================== RCS file: /cvsroot/httpunit/httpunit/build.xml,v retrieving revision 1.80 retrieving revision 1.81 diff -u -r1.80 -r1.81 --- build.xml 29 Mar 2006 01:27:26 -0000 1.80 +++ build.xml 29 Mar 2006 02:53:49 -0000 1.81 @@ -37,16 +37,62 @@ <property name="servlet.test.class" value="com.meterware.servletunit.ServletUnitSuite" /> <!-- =================================================================== --> -<!-- Defines the classpath used for compilation and test. --> +<!-- Defines the classpath used for testing. --> <!-- =================================================================== --> -<path id="base.classpath"> +<path id="test.classpath"> <fileset dir="${jars.dir}"> - <include name="*.jar"/> - <exclude name="nekohtml.jar" if="use.jtidy" /> + <include name="activation.jar"/> + <include name="mailapi.jar" /> </fileset> </path> + + +<!-- =================================================================== --> +<!-- Prepares the build directory --> +<!-- =================================================================== --> + + <target name="check_jars_dir"> + <path id="check.path"> + <fileset dir="${jars.dir}"/> + </path> + <condition property="have.local.jars"> + <or> + <available classname="org.cyberneko.html.HTMLConfiguration" classpathref="check.path"/> + <available classname="org.w3c.tidy.Tidy" classpathref="check.path"/> + </or> + </condition> + </target> + + <target name="prepare_local_classpath" depends="check_jars_dir" if="have.local.jars"> + <echo message="using local classpath"/> + <path id="base.classpath"> + <fileset id="distributed.jars" dir="${jars.dir}"/> + </path> + </target> + + <target name="prepare_repository_classpath" depends="check_jars_dir" unless="have.local.jars"> + <echo message="using repository classpath"/> + <setproxy proxyhost="www-proxy.us.oracle.com" proxyport="80"/> + <typedef classpath="${jars.dir}/ant-dependencies.jar" resource="dependencies.properties" /> + <dependencies pathId="base.classpath" fileSetId="distributed.jars"> + <dependency group="rhino" version="1.5R4.1" /> + <dependency group="junit" version="3.8.1" /> + <dependency group="nekohtml" version="0.9.1" unless="use.jtidy"/> + <dependency group="servletapi" version="2.4" /> + <dependency group="jtidy" version="4aug2000r7-dev"/> + <dependency group="xerces" version="2.6.1" artifact="xercesImpl"/> + <dependency group="xerces" version="2.6.1" artifact="xmlParserAPIs"/> + </dependencies> + </target> + +<target name="prepare" depends="prepare_local_classpath,prepare_repository_classpath"> + <tstamp /> + <mkdir dir="${build.dir}" /> +</target> + + <!-- =================================================================== --> <!-- Check to see what optional dependencies are available --> <!-- =================================================================== --> @@ -54,7 +100,7 @@ <available property="jsdk.present" classname="javax.servlet.http.HttpServlet" classpathref="base.classpath" /> <available property="javamail.present" classname="javax.mail.internet.MimeMultipart" - classpathref="base.classpath" /> + classpathref="test.classpath" /> <available property="jaxp.present" classname="javax.xml.parsers.DocumentBuilderFactory" classpathref="base.classpath" /> <available property="rhino.present" classname="org.mozilla.javascript.Context" @@ -69,15 +115,6 @@ <!-- =================================================================== --> -<!-- Prepares the build directory --> -<!-- =================================================================== --> -<target name="prepare"> - <tstamp /> - <mkdir dir="${build.dir}" /> -</target> - - -<!-- =================================================================== --> <!-- Compiles the source code --> <!-- =================================================================== --> <target name="compile" depends="prepare,check_for_optional_packages"> @@ -134,6 +171,7 @@ debug="on" deprecation="off" optimize="off"> <classpath> <path refid="base.classpath" /> + <path refid="test.classpath" /> <pathelement location="${build.classes}" /> </classpath> <exclude name="**/servletunit/*" unless="jsdk.present" /> @@ -152,6 +190,7 @@ <java classname="${test.class}" fork="yes" > <classpath> <path refid="base.classpath" /> + <path refid="test.classpath" /> <pathelement location="${build.classes}" /> <pathelement location="META-INF" /> <pathelement location="${test.classes}" /> @@ -240,13 +279,17 @@ <include name="test/**" /> <include name="examples/**" /> <include name="lib/*.*" /> - <include name="jars/*.*" /> <exclude name="**/activation.jar"/> <exclude name="**/mailapi.jar" /> <include name="doc/**/*.*" /> <include name="doc/api/package-list" /> </fileset> </copy> + <mkdir dir="${archive.dir}/jars"/> + <copy todir="${archive.dir}/jars"> + <mapper type="flatten"/> + <fileset refid="distributed.jars" /> + </copy> </target> |
From: Russell G. <rus...@us...> - 2006-03-29 01:27:35
|
Update of /cvsroot/httpunit/httpunit/sitedocs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2404/sitedocs Modified Files: news.xml site.xml Log Message: finish preparing for 1.6.2 Index: news.xml =================================================================== RCS file: /cvsroot/httpunit/httpunit/sitedocs/news.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- news.xml 23 Jun 2004 09:53:45 -0000 1.3 +++ news.xml 29 Mar 2006 01:27:26 -0000 1.4 @@ -1,11 +1,8 @@ <?xml version='1.0' ?> <news> - <item date="16-June-2004" url="http://www.httpunit.org/prerelease/httpunit-1.5.5-d-16Jun.zip"> -Prerelease: Massive reworking of target functionality, PseudoServer handles large messages</item> - <item date="29-Apr-2004" url="http://www.httpunit.org/prerelease/httpunit-1.5.5-d-29Apr.zip"> -Prerelease: ServletUnit now supports filters and listeners, PseudoServer emulates proxy server</item> - <item date="19-Sep-2003" url="http://www.httpunit.org/prerelease/httpunit-1.5.5-d-19Sep.zip"> -Prerelease: Added attributes for HTMLElement, improved PseudoServer</item> + <item date="27-Mar-2006">HttpUnit 1.6.2 released</item> + <item date="6-Mar-2005">HttpUnit 1.6.1 released</item> + <item date="3-Oct-2004">HttpUnit 1.6 released</item> <item date="21-Aug-2003">HttpUnit 1.5.4 released</item> <item date="16-May-2003">New web site format created</item> <item date="4-Apr-2003">HttpUnit 1.5.3 released</item> Index: site.xml =================================================================== RCS file: /cvsroot/httpunit/httpunit/sitedocs/site.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- site.xml 3 Oct 2004 14:03:32 -0000 1.4 +++ site.xml 29 Mar 2006 01:27:26 -0000 1.5 @@ -1,6 +1,6 @@ <?xml version='1.0' ?> <site project="HttpUnit" group-id="6550" logo="doc/images/HttpUnit.jpg"> - <copyright owner="Russell Gold" dates="2000-2004"/> + <copyright owner="Russell Gold" dates="2000-2006"/> <page location="index.html" title="Home" mainPage="true"> <fragment source="sitedocs/welcome.html"/> @@ -11,7 +11,7 @@ <fragment source="sitedocs/doc/license.html"/> </page> - <external location="http://prdownloads.sourceforge.net/httpunit/httpunit-1.6.zip?download" item="Download 1.6"/> + <external location="http://prdownloads.sourceforge.net/httpunit/httpunit-1.6.2.zip?download" item="Download 1.6.2"/> <space/> <page location="doc/cookbook.html" title="Cookbook"> |
From: Russell G. <rus...@us...> - 2006-03-29 01:27:35
|
Update of /cvsroot/httpunit/httpunit/site/com/meterware/httpunit/site In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2404/site/com/meterware/httpunit/site Modified Files: WebSite.java Log Message: finish preparing for 1.6.2 Index: WebSite.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/site/com/meterware/httpunit/site/WebSite.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- WebSite.java 18 May 2003 05:20:47 -0000 1.1 +++ WebSite.java 29 Mar 2006 01:27:26 -0000 1.2 @@ -21,14 +21,20 @@ *******************************************************************************************************************/ import com.meterware.website.FragmentTemplate; import com.meterware.website.Site; +import com.meterware.website.FilePageGenerator; +import com.meterware.website.PageGenerator; +import com.meterware.website.BasicSiteTemplate; import java.io.File; +import java.io.IOException; + +import org.xml.sax.SAXException; /** * * @author <a href="mailto:rus...@ht...">Russell Gold</a> **/ -public class WebSite { +public class WebSite extends Site { public static void main( String[] args ) { @@ -40,7 +46,7 @@ FragmentTemplate.registerTemplate( new News() ); FragmentTemplate.registerTemplate( new Citations() ); FragmentTemplate.registerTemplate( new Developers() ); - Site.generate( new File( "sitedocs/site.xml" ), new File( args[0] ) ); + generate( new File( "sitedocs/site.xml" ), new File( args[0] ) ); } } catch (Throwable e) { e.printStackTrace(); @@ -48,6 +54,20 @@ } + + public static void generate( File siteFile, File directory ) throws SAXException, IOException { + generate( siteFile, new FilePageGenerator( directory ) ); + } + + + public static void generate( File siteFile, PageGenerator generator ) throws SAXException, IOException { + Site site = new WebSite(); + BasicSiteTemplate template = new BasicSiteTemplate(); + generate( site, siteFile, template, generator ); + } + + + private static void printUsage() { System.out.println( "Usage: " + WebSite.class.getName() + " <target-directory>" ); } |
From: Russell G. <rus...@us...> - 2006-03-29 01:27:35
|
Update of /cvsroot/httpunit/httpunit/src/com/meterware/httpunit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2404/src/com/meterware/httpunit Modified Files: PutMethodWebRequest.java Log Message: finish preparing for 1.6.2 Index: PutMethodWebRequest.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/PutMethodWebRequest.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- PutMethodWebRequest.java 26 Nov 2001 14:20:12 -0000 1.3 +++ PutMethodWebRequest.java 29 Mar 2006 01:27:26 -0000 1.4 @@ -39,8 +39,8 @@ /** * Constructs a web request using a specific absolute url string and input stream. - * @param urlString the URL to which the request should be issued - * @param source an input stream which will provide the body of this request + * @param url the URL to which the request should be issued + * @param source an input stream which will provide the body of this request * @param contentType the MIME content type of the body, including any character set **/ public PutMethodWebRequest( String url, InputStream source, String contentType ) { |
From: Russell G. <rus...@us...> - 2006-03-29 01:27:34
|
Update of /cvsroot/httpunit/httpunit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2404 Modified Files: build.xml Log Message: finish preparing for 1.6.2 Index: build.xml =================================================================== RCS file: /cvsroot/httpunit/httpunit/build.xml,v retrieving revision 1.79 retrieving revision 1.80 diff -u -r1.79 -r1.80 --- build.xml 6 Mar 2005 20:30:44 -0000 1.79 +++ build.xml 29 Mar 2006 01:27:26 -0000 1.80 @@ -5,7 +5,7 @@ <project name="httpunit" default="jar" basedir="."> <property name="name" value="httpunit" /> <property name="Name" value="HttpUnit" /> - <property name="version" value="1.6.1" /> + <property name="version" value="1.6.2" /> <property name="debug" value="on" /> <property name="deprecation" value="off" /> @@ -200,7 +200,7 @@ <javadoc packagenames="${packages}" sourcepath="${basedir}/${src.dir}" destdir="${javadoc.dir}" author="true" version="true" windowtitle="${Name} ${version} API" doctitle="${Name}" - footer="Copyright &copy; 2000-2004 Russell Gold. See <a target="_top" href="../license.html">license agreement</A> for rights granted." > + footer="Copyright &copy; 2000-2006 Russell Gold. See <a target="_top" href="../license.html">license agreement</A> for rights granted." > <classpath refid="base.classpath"/> </javadoc> </target> |
From: Russell G. <rus...@us...> - 2006-03-28 00:52:20
|
Update of /cvsroot/httpunit/httpunit/src/com/meterware/httpunit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11573/src/com/meterware/httpunit Modified Files: FixedURLWebRequestSource.java FormControl.java HTMLPage.java ParsedHTML.java WebForm.java WebImage.java WebLink.java WebRequestSource.java Log Message: Created custom DOM Index: FixedURLWebRequestSource.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/FixedURLWebRequestSource.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- FixedURLWebRequestSource.java 23 Jul 2004 01:31:04 -0000 1.5 +++ FixedURLWebRequestSource.java 28 Mar 2006 00:52:15 -0000 1.6 @@ -39,8 +39,8 @@ private String _characterSet; - public FixedURLWebRequestSource( WebResponse response, Node node, URL baseURL, String destination, FrameSelector frame, String defaultTarget, String characterSet ) { - super( response, node, baseURL, destination, frame, defaultTarget ); + public FixedURLWebRequestSource( WebResponse response, Node node, URL baseURL, String attribute, FrameSelector frame, String defaultTarget, String characterSet ) { + super( response, node, baseURL, attribute, frame, defaultTarget ); _characterSet = characterSet; } Index: FormControl.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/FormControl.java,v retrieving revision 1.50 retrieving revision 1.51 diff -u -r1.50 -r1.51 --- FormControl.java 26 Dec 2004 20:33:34 -0000 1.50 +++ FormControl.java 28 Mar 2006 00:52:15 -0000 1.51 @@ -87,7 +87,7 @@ private static Node newEmptyNode( WebForm form ) { - return form.getNode().getOwnerDocument().createElement( "httpunit-supplied" ); + return form.getElement().getOwnerDocument().createElement( "httpunit-supplied" ); } Index: HTMLPage.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/HTMLPage.java,v retrieving revision 1.33 retrieving revision 1.34 diff -u -r1.33 -r1.34 --- HTMLPage.java 8 Aug 2004 17:38:18 -0000 1.33 +++ HTMLPage.java 28 Mar 2006 00:52:15 -0000 1.34 @@ -25,8 +25,8 @@ import com.meterware.httpunit.parsing.DocumentAdapter; import org.w3c.dom.Document; import org.w3c.dom.Element; -import org.w3c.dom.Node; import org.w3c.dom.NodeList; +import org.w3c.dom.html.HTMLDocument; import org.xml.sax.SAXException; import java.io.IOException; @@ -142,8 +142,9 @@ private NamedDelegate getNamedItem( NamedDelegate[] items, String name ) { + if (name == null) return null; for (int i = 0; i < items.length; i++) { - if (items[i].getName().equals( name )) return items[i]; + if (name.equals( items[i].getName() )) return items[i]; } return null; } @@ -253,7 +254,7 @@ public void parse( String text, URL pageURL ) throws SAXException, IOException { HTMLParserFactory.getHTMLParser().parse( pageURL, text, new DocumentAdapter() { - public void setRootNode( Node rootNode ) { HTMLPage.this.setRootNode( rootNode ); } + public void setDocument( HTMLDocument document ) { HTMLPage.this.setRootNode( document ); } public String getIncludedScript( String srcAttribute ) throws IOException { return HTMLPage.this.getIncludedScript( srcAttribute ); } public ScriptableDelegate getScriptableObject() { return HTMLPage.this.getScriptableObject().getParent(); } }); Index: ParsedHTML.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/ParsedHTML.java,v retrieving revision 1.63 retrieving revision 1.64 diff -u -r1.63 -r1.64 --- ParsedHTML.java 9 Mar 2006 01:52:28 -0000 1.63 +++ ParsedHTML.java 28 Mar 2006 00:52:15 -0000 1.64 @@ -23,6 +23,7 @@ import org.w3c.dom.Node; import org.w3c.dom.NodeList; import org.w3c.dom.Document; +import org.w3c.dom.html.HTMLImageElement; import java.net.URL; import java.util.*; @@ -315,7 +316,7 @@ } - private void interpretScriptElement( Element element ) { + void interpretScriptElement( Element element ) { String script = getScript( element ); if (script != null) { try { @@ -762,7 +763,7 @@ private WebImage toWebImage( Element child ) { - return new WebImage( _response, this, _baseURL, child, _frame, _baseTarget, _characterSet ); + return new WebImage( _response, this, _baseURL, (HTMLImageElement) child, _frame, _baseTarget, _characterSet ); } @@ -988,7 +989,8 @@ /** - * Specifies the root node for this HTML fragment. + * Specifies the root node for this HTML fragment. It will be either an HTMLDocument or an HTMLElement + * representing a page fragment. */ void setRootNode( Node rootNode ) { if (_rootNode != null && rootNode != _rootNode ) Index: WebForm.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/WebForm.java,v retrieving revision 1.102 retrieving revision 1.103 diff -u -r1.102 -r1.103 --- WebForm.java 26 Dec 2004 20:33:34 -0000 1.102 +++ WebForm.java 28 Mar 2006 00:52:15 -0000 1.103 @@ -765,7 +765,7 @@ public ScriptableDelegate[] getElementsByTagName( String name ) throws SAXException { - return getDelegates( getHTMLPage().getElementsByTagName( getNode(), name ) ); + return getDelegates( getHTMLPage().getElementsByTagName( getElement(), name ) ); } @@ -782,7 +782,7 @@ * from that page. **/ WebForm( WebResponse response, URL baseURL, Node node, FrameSelector frame, String defaultTarget, String characterSet ) { - super( response, node, baseURL, NodeUtils.getNodeAttribute( node, "action" ), frame, defaultTarget ); + super( response, node, baseURL, "action", frame, defaultTarget ); _characterSet = characterSet; } Index: WebImage.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/WebImage.java,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- WebImage.java 13 Oct 2004 15:11:51 -0000 1.13 +++ WebImage.java 28 Mar 2006 00:52:15 -0000 1.14 @@ -25,6 +25,7 @@ import java.net.URL; import org.w3c.dom.Node; +import org.w3c.dom.html.HTMLImageElement; /** @@ -34,34 +35,30 @@ **/ public class WebImage extends FixedURLWebRequestSource { - private Node _node; - private ParsedHTML _parsedHTML; - private Scriptable _scriptable; - private String _src; - private String _alt; + private HTMLImageElement _element; + private ParsedHTML _parsedHTML; + private Scriptable _scriptable; - WebImage( WebResponse response, ParsedHTML parsedHTML, URL baseURL, Node node, FrameSelector sourceFrame, String defaultTarget, String characterSet ) { - super( response, node, baseURL, NodeUtils.getNodeAttribute( node, "src" ), sourceFrame, defaultTarget, characterSet ); - _node = node; + WebImage( WebResponse response, ParsedHTML parsedHTML, URL baseURL, HTMLImageElement element, FrameSelector sourceFrame, String defaultTarget, String characterSet ) { + super( response, element, baseURL, "src", sourceFrame, defaultTarget, characterSet ); + _element = element; _parsedHTML = parsedHTML; - _src = NodeUtils.getNodeAttribute( _node, "src" ); - _alt = NodeUtils.getNodeAttribute( _node, "alt" ); } public String getName() { - return NodeUtils.getNodeAttribute( _node, "name" ); + return _element.getName(); } public String getSource() { - return _src; + return _element.getSrc(); } public String getAltText() { - return _alt; + return _element.getAlt(); } @@ -70,11 +67,11 @@ public boolean matchesCriteria( Object link, Object parentNode ) { for (Node parent = (Node) parentNode; parent != null; parent = parent.getParentNode()) { - if (parent.equals( ((WebLink) link).getNode() )) return true; + if (parent.equals( ((WebLink) link).getElement() )) return true; } return false; } - }, _node.getParentNode() ); + }, _element.getParentNode() ); } @@ -115,7 +112,7 @@ public void set( String propertyName, Object value ) { if (propertyName.equalsIgnoreCase( "src" )) { - if (value != null) _src = value.toString(); + if (value != null) _element.setSrc( value.toString() ); } else { super.set( propertyName, value ); } Index: WebLink.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/WebLink.java,v retrieving revision 1.47 retrieving revision 1.48 diff -u -r1.47 -r1.48 --- WebLink.java 29 Sep 2004 17:15:25 -0000 1.47 +++ WebLink.java 28 Mar 2006 00:52:15 -0000 1.48 @@ -70,7 +70,7 @@ * @since 1.6 **/ public String getText() { - if (getNode().getNodeName().equalsIgnoreCase( "area" )) { + if (getElement().getNodeName().equalsIgnoreCase( "area" )) { return getAttribute( "alt" ); } else { return super.getText(); @@ -167,7 +167,7 @@ * from that page. **/ WebLink( WebResponse response, URL baseURL, Node node, FrameSelector sourceFrame, String defaultTarget, String characterSet ) { - super( response, node, baseURL, NodeUtils.getNodeAttribute( node, "href" ), sourceFrame, defaultTarget, characterSet ); + super( response, node, baseURL, "href", sourceFrame, defaultTarget, characterSet ); } Index: WebRequestSource.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/WebRequestSource.java,v retrieving revision 1.43 retrieving revision 1.44 diff -u -r1.43 -r1.44 --- WebRequestSource.java 29 Oct 2004 00:41:24 -0000 1.43 +++ WebRequestSource.java 28 Mar 2006 00:52:15 -0000 1.44 @@ -39,6 +39,9 @@ private FrameSelector _frame; + /** The name of the destination attribute used to create for the request, including anchors and parameters. **/ + private String _destinationAttribute; + /** * Returns the ID associated with this request source. @@ -171,14 +174,14 @@ * @param response the response from which this request source was extracted * @param node the DOM subtree defining this request source * @param baseURL the URL on which to base all releative URL requests - * @param destination the relative URL to which requests will be directed + * @param attribute the attribute which defines the relative URL to which requests will be directed **/ - WebRequestSource( WebResponse response, Node node, URL baseURL, String destination, FrameSelector frame, String defaultTarget ) { + WebRequestSource( WebResponse response, Node node, URL baseURL, String attribute, FrameSelector frame, String defaultTarget ) { if (node == null) throw new IllegalArgumentException( "node must not be null" ); _baseResponse = response; _node = node; _baseURL = baseURL; - _destination = destination; + _destinationAttribute = attribute; _frame = frame; _defaultTarget = defaultTarget; } @@ -190,20 +193,20 @@ protected String getDestination() { - return _destination; + return getElement().getAttribute( _destinationAttribute ); } protected void setDestination( String destination ) { - _destination = destination; + getElement().setAttribute( _destinationAttribute, destination ); } /** * Returns the actual DOM for this request source, not a copy. **/ - protected Node getNode() { - return _node; + protected Element getElement() { + return (Element) _node; } @@ -321,9 +324,6 @@ /** The URL of the page containing this entity. **/ private URL _baseURL; - /** The raw destination specified for the request, including anchors and parameters. **/ - private String _destination; - /** The DOM node representing this entity. **/ private Node _node; |
From: Russell G. <rus...@us...> - 2006-03-28 00:52:20
|
Update of /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/parsing In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11573/src/com/meterware/httpunit/parsing Modified Files: DocumentAdapter.java HTMLParserFactory.java JTidyHTMLParser.java NekoDOMParser.java NekoHTMLParser.java ScriptFilter.java Added Files: ScriptHandler.java Log Message: Created custom DOM ***** Error reading new file[Errno 2] No such file or directory: 'ScriptHandler.java' Index: DocumentAdapter.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/parsing/DocumentAdapter.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- DocumentAdapter.java 25 Dec 2002 15:23:11 -0000 1.2 +++ DocumentAdapter.java 28 Mar 2006 00:52:15 -0000 1.3 @@ -2,7 +2,7 @@ /******************************************************************************************************************** * $Id$ * - * Copyright (c) 2002, Russell Gold + * Copyright (c) 2002,2004, Russell Gold * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated * documentation files (the "Software"), to deal in the Software without restriction, including without limitation @@ -21,7 +21,8 @@ *******************************************************************************************************************/ import com.meterware.httpunit.scripting.ScriptableDelegate; -import org.w3c.dom.Node; +import org.w3c.dom.Document; +import org.w3c.dom.html.HTMLDocument; import java.io.IOException; @@ -36,7 +37,7 @@ /** * Records the root (Document) node. */ - public void setRootNode( Node rootNode ); + public void setDocument( HTMLDocument document ); /** Index: HTMLParserFactory.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/parsing/HTMLParserFactory.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- HTMLParserFactory.java 26 Dec 2002 04:59:35 -0000 1.3 +++ HTMLParserFactory.java 28 Mar 2006 00:52:15 -0000 1.4 @@ -111,7 +111,6 @@ */ public static void setPreserveTagCase( boolean preserveTagCase ) { _preserveTagCase = preserveTagCase; - if (preserveTagCase) _returnHTMLDocument = false; } @@ -119,7 +118,7 @@ * Returns true if the current parser will return an HTMLDocument object rather than a Document object. */ public static boolean isReturnHTMLDocument() { - return _returnHTMLDocument && getHTMLParser().supportsReturnHTMLDocument(); + return _returnHTMLDocument && !isPreserveTagCase() && getHTMLParser().supportsReturnHTMLDocument(); } Index: JTidyHTMLParser.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/parsing/JTidyHTMLParser.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- JTidyHTMLParser.java 25 Dec 2002 15:23:11 -0000 1.2 +++ JTidyHTMLParser.java 28 Mar 2006 00:52:15 -0000 1.3 @@ -2,7 +2,7 @@ /******************************************************************************************************************** * $Id$ * - * Copyright (c) 2002, Russell Gold + * Copyright (c) 2002,2004, Russell Gold * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated * documentation files (the "Software"), to deal in the Software without restriction, including without limitation @@ -20,6 +20,10 @@ * *******************************************************************************************************************/ import org.w3c.tidy.Tidy; +import org.w3c.dom.Document; +import org.w3c.dom.NodeList; +import org.w3c.dom.Node; +import org.w3c.dom.html.HTMLDocument; import org.xml.sax.SAXException; import java.net.URL; @@ -27,6 +31,8 @@ import java.io.ByteArrayInputStream; import java.io.UnsupportedEncodingException; +import com.meterware.httpunit.dom.HTMLDocumentImpl; + /** * @@ -37,7 +43,14 @@ public void parse( URL pageURL, String pageText, DocumentAdapter adapter ) throws IOException, SAXException { try { - adapter.setRootNode( getParser( pageURL ).parseDOM( new ByteArrayInputStream( pageText.getBytes( UTF_ENCODING ) ), null ) ); + Document jtidyDocument = getParser( pageURL ).parseDOM( new ByteArrayInputStream( pageText.getBytes( UTF_ENCODING ) ), null ); + HTMLDocument htmlDocument = new HTMLDocumentImpl(); + NodeList nl = jtidyDocument.getChildNodes(); + for (int i = 0; i < nl.getLength(); i++) { + Node importedNode = nl.item(i); + if (importedNode.getNodeType() != Node.DOCUMENT_TYPE_NODE) htmlDocument.appendChild( htmlDocument.importNode( importedNode, true ) ); + } + adapter.setDocument( htmlDocument ); } catch (UnsupportedEncodingException e) { throw new RuntimeException( "UTF-8 encoding failed" ); } @@ -55,7 +68,7 @@ public boolean supportsReturnHTMLDocument() { - return false; + return true; } Index: NekoDOMParser.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/parsing/NekoDOMParser.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- NekoDOMParser.java 5 Oct 2004 11:29:52 -0000 1.3 +++ NekoDOMParser.java 28 Mar 2006 00:52:15 -0000 1.4 @@ -1,6 +1,26 @@ package com.meterware.httpunit.parsing; - +/******************************************************************************************************************** + * $Id$ + * + * Copyright (c) 2002-2004, Russell Gold + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated + * documentation files (the "Software"), to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and + * to permit persons to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO + * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF + * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + *******************************************************************************************************************/ import com.meterware.httpunit.scripting.ScriptableDelegate; +import com.meterware.httpunit.dom.HTMLDocumentImpl; import java.net.URL; import java.io.IOException; @@ -13,18 +33,18 @@ import org.apache.xerces.xni.XNIException; import org.xml.sax.SAXNotRecognizedException; import org.xml.sax.SAXNotSupportedException; -import org.w3c.dom.Node; -import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.html.HTMLDocument; /** * * - * @author <a href="rus...@ac...">Russell Gold</a> + * @author <a href="rus...@ht...">Russell Gold</a> * @author <a href="mailto:Art...@ly...">Artashes Aghajanyan</a> **/ -class NekoDOMParser extends org.apache.xerces.parsers.DOMParser { +class NekoDOMParser extends org.apache.xerces.parsers.DOMParser implements ScriptHandler { - private static final String HTML_DOCUMENT_CLASS_NAME = "org.apache.html.dom.HTMLDocumentImpl"; + // private static final String HTML_DOCUMENT_CLASS_NAME = "org.apache.html.dom.HTMLDocumentImpl"; /** Error reporting feature identifier. */ private static final String REPORT_ERRORS = "http://cyberneko.org/html/features/report-errors"; @@ -43,9 +63,6 @@ private DocumentAdapter _documentAdapter; - /** The node representing the document. **/ - private Node _documentNode; - static NekoDOMParser newParser( DocumentAdapter adapter, URL url ) { final HTMLConfiguration configuration = new HTMLConfiguration(); @@ -64,8 +81,8 @@ try { final NekoDOMParser domParser = new NekoDOMParser( configuration, adapter ); domParser.setFeature( DEFER_NODE_EXPANSION, false ); - if (HTMLParserFactory.isReturnHTMLDocument()) domParser.setProperty( DOCUMENT_CLASS_NAME, HTML_DOCUMENT_CLASS_NAME ); - javaScriptFilter.setParser( domParser ); + if (HTMLParserFactory.isReturnHTMLDocument()) domParser.setProperty( DOCUMENT_CLASS_NAME, HTMLDocumentImpl.class.getName() ); + javaScriptFilter.setScriptHandler( domParser ); return domParser; } catch (SAXNotRecognizedException e) { throw new RuntimeException( e.toString() ); @@ -76,21 +93,9 @@ } - ScriptableDelegate getScriptableDelegate() { - if (_documentNode == null) { - Node node = getCurrentElementNode(); - while (!(node instanceof Document)) node = node.getParentNode(); - _documentNode = node; - } - _documentAdapter.setRootNode( _documentNode ); - return _documentAdapter.getScriptableObject(); - } - - - private Node getCurrentElementNode() { + private Element getCurrentElement() { try { - final Node node = (Node) getProperty( CURRENT_ELEMENT_NODE ); - return node; + return (Element) getProperty( CURRENT_ELEMENT_NODE ); } catch (SAXNotRecognizedException e) { throw new RuntimeException( CURRENT_ELEMENT_NODE + " property not recognized" ); } catch (SAXNotSupportedException e) { @@ -100,7 +105,13 @@ } - String getIncludedScript( String srcAttribute ) { + NekoDOMParser( HTMLConfiguration configuration, DocumentAdapter adapter ) { + super( configuration ); + _documentAdapter = adapter; + } + + + public String getIncludedScript( String srcAttribute ) { try { return _documentAdapter.getIncludedScript( srcAttribute ); } catch (IOException e) { @@ -109,9 +120,20 @@ } - NekoDOMParser( HTMLConfiguration configuration, DocumentAdapter adapter ) { - super( configuration ); - _documentAdapter = adapter; + public boolean supportsScriptLanguage( String language ) { + return getScriptableDelegate().supportsScript( language ); + } + + + public String runScript( final String language, final String scriptText ) { + getScriptableDelegate().getScriptEngine().clearCaches(); + return getScriptableDelegate().runScript( language, scriptText ); + } + + + private ScriptableDelegate getScriptableDelegate() { + _documentAdapter.setDocument( (HTMLDocument) getCurrentElement().getOwnerDocument() ); + return _documentAdapter.getScriptableObject(); } Index: NekoHTMLParser.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/parsing/NekoHTMLParser.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- NekoHTMLParser.java 9 Mar 2003 20:35:47 -0000 1.4 +++ NekoHTMLParser.java 28 Mar 2006 00:52:15 -0000 1.5 @@ -2,7 +2,7 @@ /******************************************************************************************************************** * $Id$ * - * Copyright (c) 2002-2003, Russell Gold + * Copyright (c) 2002-2004, Russell Gold * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated * documentation files (the "Software"), to deal in the Software without restriction, including without limitation @@ -21,6 +21,7 @@ *******************************************************************************************************************/ import org.xml.sax.SAXException; import org.xml.sax.InputSource; +import org.w3c.dom.html.HTMLDocument; import java.net.URL; import java.io.IOException; @@ -39,7 +40,7 @@ try { NekoDOMParser parser = NekoDOMParser.newParser( adapter, pageURL ); parser.parse( new InputSource( new StringReader( pageText ) ) ); - adapter.setRootNode( parser.getDocument() ); + adapter.setDocument( (HTMLDocument) parser.getDocument() ); } catch (NekoDOMParser.ScriptException e) { throw e.getException(); } @@ -52,7 +53,7 @@ public boolean supportsPreserveTagCase() { - return true; + return false; } Index: ScriptFilter.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/parsing/ScriptFilter.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- ScriptFilter.java 9 Mar 2004 21:49:18 -0000 1.5 +++ ScriptFilter.java 28 Mar 2006 00:52:15 -0000 1.6 @@ -56,7 +56,7 @@ private int _scriptIndex; /** The parser in which this filter is running. **/ - private NekoDOMParser _domParser; + private ScriptHandler _scriptHandler; /** Constructs a script object with the specified configuration. */ @@ -65,8 +65,8 @@ } - public void setParser( NekoDOMParser domParser ) { - _domParser = domParser; + public void setScriptHandler( ScriptHandler scriptHandler ) { + _scriptHandler = scriptHandler; } @@ -89,7 +89,7 @@ _activeScriptBlock = new StringBuffer(); _scriptLanguage = getScriptLanguage( attrs ); String srcAttribute = attrs.getValue( "src" ); - if (srcAttribute != null) _activeScriptBlock.append( _domParser.getIncludedScript( srcAttribute ) ); + if (srcAttribute != null) _activeScriptBlock.append( _scriptHandler.getIncludedScript( srcAttribute ) ); } } @@ -97,7 +97,7 @@ private boolean isSupportedScript( QName element, XMLAttributes attrs ) { if (!element.rawname.equalsIgnoreCase( "script" ) || attrs == null) return false; String value = getScriptLanguage( attrs ); - return _domParser.getScriptableDelegate().supportsScript( value ); + return _scriptHandler.supportsScriptLanguage( value ); } @@ -147,8 +147,7 @@ protected String getTranslatedScript( final String language, final String scriptText ) throws IOException { - _domParser.getScriptableDelegate().getScriptEngine().clearCaches(); - return _domParser.getScriptableDelegate().runScript( language, scriptText ); + return _scriptHandler.runScript( language, scriptText ); } |