You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by Llewellyn Falco <is...@setgame.com> on 2006/04/03 23:31:28 UTC

help, odd parsing

 ran into this problem, distilled down to a test. anyone got an idea? notice
 that it just seems to remove the .TEST_CASE ?

 thanks
 llewellyn

 package com.spun.util.velocity.tests;

 import junit.framework.TestCase;
 import org.apache.velocity.context.Context;
 import com.spun.util.velocity.ContextAware;
 import com.spun.util.velocity.VelocityParser;

 public class VelocityTableNameTest extends TestCase implements ContextAware
 {
  /**********************77*************************************************/
  public void testWTF() throws Exception
  {
    String template = "$main.getObjectName()Metadata.TABLE_NAME, ";
    assertEquals("CompanyMetadata.TABLE_NAME, ",
 VelocityParser.parseString(template, this));
  }
  /***********************************************************************/
  public String getObjectName()
  {
    return "Company";
  }
  /***********************************************************************/
  public void setupContext(Context context)
  {
    context.put("main", this);
  }
  /***********************************************************************/
  /***********************************************************************/
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-dev-help@jakarta.apache.org


Re: help, odd parsing

Posted by Will Glass-Husain <wg...@forio.com>.
What does it return?

WILL

On 4/3/06, Llewellyn Falco <is...@setgame.com> wrote:
>  ran into this problem, distilled down to a test. anyone got an idea? notice
>  that it just seems to remove the .TEST_CASE ?
>
>  thanks
>  llewellyn
>
>  package com.spun.util.velocity.tests;
>
>  import junit.framework.TestCase;
>  import org.apache.velocity.context.Context;
>  import com.spun.util.velocity.ContextAware;
>  import com.spun.util.velocity.VelocityParser;
>
>  public class VelocityTableNameTest extends TestCase implements ContextAware
>  {
>   /**********************77*************************************************/
>   public void testWTF() throws Exception
>   {
>     String template = "$main.getObjectName()Metadata.TABLE_NAME, ";
>     assertEquals("CompanyMetadata.TABLE_NAME, ",
>  VelocityParser.parseString(template, this));
>   }
>   /***********************************************************************/
>   public String getObjectName()
>   {
>     return "Company";
>   }
>   /***********************************************************************/
>   public void setupContext(Context context)
>   {
>     context.put("main", this);
>   }
>   /***********************************************************************/
>   /***********************************************************************/
>  }
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-dev-help@jakarta.apache.org
>
>


--
Forio Business Simulations

Will Glass-Husain
wglass@forio.com
www.forio.com

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-dev-help@jakarta.apache.org