Author: tmjee Date: Sat Apr 15 07:43:12 2006 New Revision: 394295 URL: http://svn.apache.org/viewcvs?rev=394295&view=rev Log: - fixed failing test case - alter tooltip.ftl such that tooltip image id is _tt followed by number without comma (easier to work with the test)
Modified: incubator/webwork2/action/src/main/resources/template/xhtml/tooltip.ftl incubator/webwork2/action/src/test/java/org/apache/struts/action2/views/jsp/ui/TooltipTest.java incubator/webwork2/action/src/test/resources/org/apache/struts/action2/views/jsp/ui/tooltip-1.txt incubator/webwork2/action/src/test/resources/org/apache/struts/action2/views/jsp/ui/tooltip-2.txt incubator/webwork2/action/src/test/resources/org/apache/struts/action2/views/jsp/ui/tooltip-3.txt Modified: incubator/webwork2/action/src/main/resources/template/xhtml/tooltip.ftl URL: http://svn.apache.org/viewcvs/incubator/webwork2/action/src/main/resources/template/xhtml/tooltip.ftl?rev=394295&r1=394294&r2=394295&view=diff ============================================================================== --- incubator/webwork2/action/src/main/resources/template/xhtml/tooltip.ftl (original) +++ incubator/webwork2/action/src/main/resources/template/xhtml/tooltip.ftl Sat Apr 15 07:43:12 2006 @@ -1,5 +1,6 @@ <#if parameters.tooltip?exists><#t/> - <img id="_tt${parameters.tooltip.hashCode()}" + <#assign tooltipHashCode=parameters.tooltip.hashCode() /> + <img id="_tt${tooltipHashCode?string('#')}" <#if parameters.tooltipIcon?exists><#t/> src='<@saf.url value="${parameters.tooltipIcon}" />' <#else><#t/> @@ -7,8 +8,7 @@ </#if><#t/> alt="${parameters.tooltip?html}" title="${parameters.tooltip?html}" /> - - <span dojoType="tooltip" connectId="_tt${parameters.tooltip.hashCode()}" + <span dojoType="tooltip" connectId="_tt${tooltipHashCode?string('#')}" <#if parameters.tooltipToggle?exists><#t/> <#t/>toggle="${parameters.tooltipToggle}"<#t/> </#if><#t/> Modified: incubator/webwork2/action/src/test/java/org/apache/struts/action2/views/jsp/ui/TooltipTest.java URL: http://svn.apache.org/viewcvs/incubator/webwork2/action/src/test/java/org/apache/struts/action2/views/jsp/ui/TooltipTest.java?rev=394295&r1=394294&r2=394295&view=diff ============================================================================== --- incubator/webwork2/action/src/test/java/org/apache/struts/action2/views/jsp/ui/TooltipTest.java (original) +++ incubator/webwork2/action/src/test/java/org/apache/struts/action2/views/jsp/ui/TooltipTest.java Sat Apr 15 07:43:12 2006 @@ -22,6 +22,8 @@ import org.apache.struts.action2.views.jsp.AbstractUITagTest; import org.apache.struts.action2.views.jsp.ParamTag; import org.apache.struts.action2.views.jsp.StrutsMockBodyContent; + +import com.opensymphony.xwork.ObjectFactory; import com.opensymphony.xwork.config.ConfigurationManager; /** @@ -33,8 +35,10 @@ public class TooltipTest extends AbstractUITagTest { public void testWithoutFormOverriding() throws Exception { + ConfigurationManager.clearConfigurationProviders(); ConfigurationManager.addConfigurationProvider(new TestConfigurationProvider()); + ObjectFactory.setObjectFactory(new MyObjectFactory()); // we test it on textfield component, but since the tooltip are common to @@ -374,5 +378,8 @@ verify(TooltipTest.class.getResource("tooltip-3.txt")); } - + + static class MyObjectFactory extends ObjectFactory { + + } } Modified: incubator/webwork2/action/src/test/resources/org/apache/struts/action2/views/jsp/ui/tooltip-1.txt URL: http://svn.apache.org/viewcvs/incubator/webwork2/action/src/test/resources/org/apache/struts/action2/views/jsp/ui/tooltip-1.txt?rev=394295&r1=394294&r2=394295&view=diff ============================================================================== --- incubator/webwork2/action/src/test/resources/org/apache/struts/action2/views/jsp/ui/tooltip-1.txt (original) +++ incubator/webwork2/action/src/test/resources/org/apache/struts/action2/views/jsp/ui/tooltip-1.txt Sat Apr 15 07:43:12 2006 @@ -2,11 +2,14 @@ <table class="wwFormTable"> <tr> <td class="tdLabel"><label for="myId" class="label">MyLabel: - <img - src='/struts/tooltip/myTooltip.gif' + <img id="_tt1507188919" + src='/struts/tooltip/myTooltip.gif' alt="myTooltip" - title="myTooltip" - onmouseover="this.T_ABOVE=true;this.T_BGCOLOR='#ffffff';this.T_BGIMG='/struts/tooltip/myBgImg.gif';this.T_BORDERWIDTH=10;this.T_BORDERCOLOR='#eeeeee';this.T_DELAY=2000;this.T_FIX=[300, 300];this.T_FONTCOLOR='#dddddd';this.T_FONTFACE='San-Serif,Verdana';this.T_FONTSIZE='20';this.T_FONTWEIGHT='bold';this.T_LEFT=true;this.T_OFFSETX=10;this.T_OFFSETY=20;this.T_OPACITY=90;this.T_PADDING=30;this.T_SHADOWCOLOR='#cccccc';this.T_SHADOWWIDTH=40;this.T_STATIC=true;this.T_STICKY=true;this.T_TEMP=3000;this.T_TEXTALIGN='right';this.T_TITLE='MyTitle';this.T_TITLECOLOR='#bbbbbb';this.T_WIDTH=600;return escape('myTooltip');" /></label></td> + title="myTooltip" /> + + <span dojoType="tooltip" connectId="_tt1507188919" delay="2000" + caption="myTooltip"></span> + </label></td> <td><input type="text" name="" id="myId"/></td> </tr> </table> @@ -17,4 +20,7 @@ </script> <!-- javascript that is needed for tooltips --> -<script language="JavaScript" type="text/javascript" src="/struts/tooltip/wz_tooltip.js"></script> +<script language="JavaScript" type="text/javascript">dojo.require("dojo.widget.html.Tooltip");dojo.require("dojo.fx.html");</script> + + + Modified: incubator/webwork2/action/src/test/resources/org/apache/struts/action2/views/jsp/ui/tooltip-2.txt URL: http://svn.apache.org/viewcvs/incubator/webwork2/action/src/test/resources/org/apache/struts/action2/views/jsp/ui/tooltip-2.txt?rev=394295&r1=394294&r2=394295&view=diff ============================================================================== --- incubator/webwork2/action/src/test/resources/org/apache/struts/action2/views/jsp/ui/tooltip-2.txt (original) +++ incubator/webwork2/action/src/test/resources/org/apache/struts/action2/views/jsp/ui/tooltip-2.txt Sat Apr 15 07:43:12 2006 @@ -2,11 +2,14 @@ <table class="wwFormTable"> <tr> <td class="tdLabel"><label for="myId" class="label">MyLabel: - <img - src='/struts/tooltip/formMyTooltip.gif' + <img id="_tt1507188919" + src='/struts/tooltip/formMyTooltip.gif' alt="myTooltip" - title="myTooltip" - onmouseover="this.T_ABOVE=false;this.T_BGCOLOR='#aaaaaa';this.T_BGIMG='/struts/tooltip/formMyBgImg.gif';this.T_BORDERWIDTH=11;this.T_BORDERCOLOR='#bbbbbb';this.T_DELAY=2001;this.T_FIX=[301, 301];this.T_FONTCOLOR='#cccccc';this.T_FONTFACE='Verdana,San-Serif';this.T_FONTSIZE='21';this.T_FONTWEIGHT='normal';this.T_LEFT=false;this.T_OFFSETX=11;this.T_OFFSETY=21;this.T_OPACITY=91;this.T_PADDING=31;this.T_SHADOWCOLOR='#cccccc';this.T_SHADOWWIDTH=41;this.T_STATIC=false;this.T_STICKY=false;this.T_TEMP=3001;this.T_TEXTALIGN='left';this.T_TITLE='FormMyTitle';this.T_TITLECOLOR='#dddddd';this.T_WIDTH=601;return escape('myTooltip');" /></label></td> + title="myTooltip" /> + + <span dojoType="tooltip" connectId="_tt1507188919" delay="2001" + caption="myTooltip"></span> + </label></td> <td><input type="text" name="" id="myId"/></td> </tr> </table> @@ -17,4 +20,4 @@ </script> <!-- javascript that is needed for tooltips --> -<script language="JavaScript" type="text/javascript" src="/struts/tooltip/wz_tooltip.js"></script> +<script language="JavaScript" type="text/javascript">dojo.require("dojo.widget.html.Tooltip");dojo.require("dojo.fx.html");</script> Modified: incubator/webwork2/action/src/test/resources/org/apache/struts/action2/views/jsp/ui/tooltip-3.txt URL: http://svn.apache.org/viewcvs/incubator/webwork2/action/src/test/resources/org/apache/struts/action2/views/jsp/ui/tooltip-3.txt?rev=394295&r1=394294&r2=394295&view=diff ============================================================================== --- incubator/webwork2/action/src/test/resources/org/apache/struts/action2/views/jsp/ui/tooltip-3.txt (original) +++ incubator/webwork2/action/src/test/resources/org/apache/struts/action2/views/jsp/ui/tooltip-3.txt Sat Apr 15 07:43:12 2006 @@ -2,11 +2,14 @@ <table class="wwFormTable"> <tr> <td class="tdLabel"><label for="myId" class="label">MyLabel: - <img - src='/struts/tooltip/myTooltip.gif' + <img id="_tt1507188919" + src='/struts/tooltip/myTooltip.gif' alt="myTooltip" - title="myTooltip" - onmouseover="this.T_ABOVE=true;this.T_BGCOLOR='#ffffff';this.T_BGIMG='/struts/tooltip/myBgImg.gif';this.T_BORDERWIDTH=11;this.T_BORDERCOLOR='#bbbbbb';this.T_DELAY=2001;this.T_FIX=[301, 301];this.T_FONTCOLOR='#cccccc';this.T_FONTFACE='Verdana,San-Serif';this.T_FONTSIZE='21';this.T_FONTWEIGHT='normal';this.T_LEFT=false;this.T_OFFSETX=11;this.T_OFFSETY=21;this.T_OPACITY=91;this.T_PADDING=31;this.T_SHADOWCOLOR='#cccccc';this.T_SHADOWWIDTH=41;this.T_STATIC=false;this.T_STICKY=false;this.T_TEMP=3001;this.T_TEXTALIGN='left';this.T_TITLE='FormMyTitle';this.T_TITLECOLOR='#dddddd';this.T_WIDTH=601;return escape('myTooltip');" /></label></td> + title="myTooltip" /> + + <span dojoType="tooltip" connectId="_tt1507188919" delay="2001" + caption="myTooltip"></span> + </label></td> <td><input type="text" name="" id="myId"/></td> </tr> </table> @@ -17,4 +20,5 @@ </script> <!-- javascript that is needed for tooltips --> -<script language="JavaScript" type="text/javascript" src="/struts/tooltip/wz_tooltip.js"></script> +<script language="JavaScript" type="text/javascript">dojo.require("dojo.widget.html.Tooltip");dojo.require("dojo.fx.html");</script> + --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]