Author: rich
Date: Mon Feb 14 12:19:52 2005
New Revision: 153843

URL: http://svn.apache.org/viewcvs?view=rev&rev=153843
Log:
Fix for http://issues.apache.org/jira/browse/BEEHIVE-296 : 
@Jpf.ValidateValidWhen and @Jpf.ValidateRange do not work under Struts 1.1

Also fixed the Struts 1.1 BVT, which had gotten broken (Struts 1.2 jars being 
copied into it!) somewhere along the way.

DRT: netui drt + bvt.struts11 (WinXP)
BB: self (linux)


Modified:
    
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/FormData.java
    
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/validation/ValidatorRules.java
    incubator/beehive/trunk/netui/test/webapps/drt/build.xml

Modified: 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/FormData.java
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/FormData.java?view=diff&r1=153842&r2=153843
==============================================================================
--- 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/FormData.java
 (original)
+++ 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/FormData.java
 Mon Feb 14 12:19:52 2005
@@ -121,8 +121,15 @@
         {
             try
             {
-                return ( Validator ) _legacyInitValidatorMethod.invoke( 
Resources.class, beanName, bean, context,
-                                                                        
request, errors, page );
+                Validator validator =
+                        ( Validator ) _legacyInitValidatorMethod.invoke( 
Resources.class, beanName, bean, context,
+                                                                         
request, errors, page );
+                
+                //
+                // The NetUI validator rules work on both 1.1 and 1.2.  They 
take ActionMessages instead of ActionErrors.
+                //
+                validator.addResource( 
"org.apache.struts.action.ActionMessages", errors );
+                return validator;
             }
             catch ( IllegalAccessException e )
             {

Modified: 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/validation/ValidatorRules.java
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/validation/ValidatorRules.java?view=diff&r1=153842&r2=153843
==============================================================================
--- 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/validation/ValidatorRules.java
 (original)
+++ 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/validation/ValidatorRules.java
 Mon Feb 14 12:19:52 2005
@@ -107,10 +107,9 @@
                 long min = Long.parseLong( field.getVarValue( "min" ) );
                 long max = Long.parseLong( field.getVarValue( "max" ) );
 
-                if ( !GenericValidator.isInRange( longValue, min, max ) )
+                if ( longValue < min || longValue > max )
                 {
                     errors.add( field.getKey(), Resources.getActionError( 
request, va, field ) );
-
                     return false;
                 }
             }

Modified: incubator/beehive/trunk/netui/test/webapps/drt/build.xml
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/build.xml?view=diff&r1=153842&r2=153843
==============================================================================
--- incubator/beehive/trunk/netui/test/webapps/drt/build.xml (original)
+++ incubator/beehive/trunk/netui/test/webapps/drt/build.xml Mon Feb 14 
12:19:52 2005
@@ -68,6 +68,7 @@
 
         <ant antfile="${test.dir}/ant/buildWebapp.xml" target="undeploy.netui" 
inheritAll="false">
             <property name="webapp.dir" location="${webapp.dir}"/>
+            <property name="struts.version" value="${struts.version}"/>
             <property name="include.testrecorder" value="true"/>
         </ant>
 
@@ -135,8 +136,10 @@
         </ant>
     </target>
 
-    <target name="bvt.struts11" description="Run the bvt suite using Struts 
1.1 libraries with full server start / stop support" depends="clean,build">
+    <target name="bvt.struts11" description="Run the bvt suite using Struts 
1.1 libraries with full server start / stop support">
         <property name="struts.version" value="1.1"/>
+        <antcall target="clean"/>
+        <antcall target="build"/>
         <ant antfile="${test.dir}/ant/testRecorder.xml" inheritAll="false" 
target="server.test">
             <property name="app.build.file" 
location="${app.dir}/drt/build.xml"/>
             <property name="waitfor.url" value="${server.root.url}"/>


Reply via email to