Return-Path: Delivered-To: apmail-struts-user-archive@www.apache.org Received: (qmail 24447 invoked from network); 21 Nov 2006 23:00:59 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 21 Nov 2006 23:00:59 -0000 Received: (qmail 13404 invoked by uid 500); 21 Nov 2006 23:00:59 -0000 Delivered-To: apmail-struts-user-archive@struts.apache.org Received: (qmail 13366 invoked by uid 500); 21 Nov 2006 23:00:59 -0000 Mailing-List: contact user-help@struts.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Struts Users Mailing List" Reply-To: "Struts Users Mailing List" Delivered-To: mailing list user@struts.apache.org Received: (qmail 13355 invoked by uid 99); 21 Nov 2006 23:00:59 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Nov 2006 15:00:59 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of niall.pemberton@gmail.com designates 66.249.82.225 as permitted sender) Received: from [66.249.82.225] (HELO wx-out-0506.google.com) (66.249.82.225) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Nov 2006 15:00:46 -0800 Received: by wx-out-0506.google.com with SMTP id t11so15457wxc for ; Tue, 21 Nov 2006 15:00:25 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=Ds7C35Zp4tMnCaxd8qn2rFjEyss4ta4hcuUIioljmz+R7qnNFG7WmwgwAKWIZsuaQKP1/vX8UZuqmOhgPIn6f2Q2ZuVVmk1mGO4SWiJk7A98W7GOHhei2MU8KXrzCGwNNBDSNLDbxZKSePF2U961sPu/YRaTrq6XMqkuzUUg1nE= Received: by 10.90.27.6 with SMTP id a6mr6176128aga.1164150025634; Tue, 21 Nov 2006 15:00:25 -0800 (PST) Received: by 10.90.65.9 with HTTP; Tue, 21 Nov 2006 15:00:25 -0800 (PST) Message-ID: <55afdc850611211500o55d6b4b5h2773560567e5e504@mail.gmail.com> Date: Tue, 21 Nov 2006 23:00:25 +0000 From: "Niall Pemberton" To: "Struts Users Mailing List" Subject: Re: problems using httpunit / rhino with struts validator In-Reply-To: <456363B6.2020503@codeczar.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <456363B6.2020503@codeczar.com> X-Virus-Checked: Checked by ClamAV on apache.org The tags generate functions based on the form's name - looks like it isn't finding the form's name resulting in your "undefined_required". I've not used httpunit, but I guess you need to get http unit to generate the html as a jsp would do and have it parse the form and set up the dom as the browser would - quite how I'm not sure and I guess its easier said than done. Niall On 11/21/06, Nathan Coast wrote: > Hi, > > First off, thanks for the validator - saved me countless hours of > writing js. > > I've started trying to introduce httpunit integration tests to my > applications and unfortunately with both js and validator enabled, it > barfs in fine style. > > httpunit 1.6.2, validator 1.3.0, rhino js-1.6R3.jar > > The errors come when trying to execute js created by the validator > resulting in either "undefined_required" or "undefined_maxlength" > > Is anyone else seeing these types of errors or can suggest a workaround? > I can disable js by removing the dependency to the rhino js.jar, > however this prevents me from httpunit testing a number of areas of my app. > > exception e.g. > > Running com.codeczar.security.user.httpunit.SearchUserTest > org.mozilla.javascript.EcmaError: ReferenceError: "undefined_required" > is not defined. (httpunit#762 (eval)#1) > at > org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3226) > at > org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3216) > at > org.mozilla.javascript.ScriptRuntime.notFoundError(ScriptRuntime.java:3289) > at > org.mozilla.javascript.ScriptRuntime.nameOrFunction(ScriptRuntime.java:1633) > at > org.mozilla.javascript.ScriptRuntime.name(ScriptRuntime.java:1572) > at > org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:3159) > at script(httpunit#762(eval):1) > at > org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2248) > at > org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:158) > at > org.mozilla.javascript.ScriptRuntime.evalSpecial(ScriptRuntime.java:2213) > at > org.mozilla.javascript.ScriptRuntime.callSpecial(ScriptRuntime.java:2078) > at > org.mozilla.javascript.optimizer.OptRuntime.callSpecial(OptRuntime.java:156) > at org.mozilla.javascript.gen.c7._c17(httpunit:762) > at org.mozilla.javascript.gen.c7.call(httpunit) > at > org.mozilla.javascript.optimizer.OptRuntime.callName(OptRuntime.java:95) > at org.mozilla.javascript.gen.c9._c1(httpunit:9) > at org.mozilla.javascript.gen.c9.call(httpunit) > at > org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:3082) > at script.x(httpunit) > at > org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2248) > at > org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:158) > at > org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:337) > at > org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:2755) > at > org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:156) > at > com.meterware.httpunit.javascript.JavaScript$JavaScriptEngine.performEvent(JavaScript.jav > a:172) > at > com.meterware.httpunit.scripting.ScriptableDelegate.doEvent(ScriptableDelegate.java:56) > at > com.meterware.httpunit.WebRequestSource.submitRequest(WebRequestSource.java:232) > at com.meterware.httpunit.WebForm.submitRequest(WebForm.java:96) > at com.meterware.httpunit.WebForm.doFormSubmit(WebForm.java:107) > at com.meterware.httpunit.WebForm.submit(WebForm.java:69) > at com.meterware.httpunit.WebForm.submit(WebForm.java:58) > at > com.codeczar.security.user.httpunit.CreateUserTest.getResponse(CreateUserTest.java:77) > at > com.codeczar.security.user.httpunit.CreateUserTest.doCreate(CreateUserTest.java:50) > > cheers > Nathan > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org > For additional commands, e-mail: user-help@struts.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@struts.apache.org For additional commands, e-mail: user-help@struts.apache.org