1. AppFuse
  2. APF-1088

If class name has embedded capitals, AppGen code fails UI tests, and generated hyperlinks are incorrect.


    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0.2
    • Fix Version/s: 2.1.0
    • Component/s: Tools - AppGen
    • Labels:
    • Environment:
      WinXP/Pro/SP2, Maven 2.0.9, Java 1.6.0_05


      Using appfuse:gen -Dentity=TestCase creates code that doesn't work, due to the embedded uppercase letter in the class name.

      (see also forum

      "mvn" fails during the UI test phase; after all the "User" UI tests complete OK, and FlushCache and FileUpload, then I get this:

      [INFO] [talledLocalContainer] [LStst4] WARN [http-8081-13] PageNotFound.noHandlerFound(1068) | No mapping found for HTTP request with URI [/LStst4-1.0-SNAPSHOT/testCases.html] in DispatcherServlet with name 'dispatcher'

      Note that /testcases.html does work; and /testcaseform.html works, also. However, the edit and Add links on testcases.html are to /testCaseform.html (capital C), so they fail. (And the main menu link is to /testCases.html, so that fails.)

      ...and poking around some more, i found in web-tests.xml:
      <webtest name="searchTestCases">
      <invoke description="click View TestCase link" url="/testCases.html"/>

      I think the problem is a conflict between the controller mapping (ControllerClassNameHandlerMapping), which lower-cases the whole name, and the names used by the gen process, which keeps embedded capitals, e.g., testCases.jsp.

      The source for
      import javax.persistence.*;
      import static javax.persistence.GenerationType.IDENTITY;

      @Table(name = "test_case")
      public class TestCase implements {
      static final long serialVersionUID = 1L;
      private Integer id;
      private String name;

      public TestCase() {
      public TestCase(String name)

      { = name; }

      @GeneratedValue(strategy = IDENTITY)
      @Column(name = "Id", unique = true, nullable = false)
      public Integer getId() { return; }
      public void setId(Integer id) { = id; }

      @Column(name = "Name", length = 50)
      public String getName() { return; }
      public void setName(String name) { = name; }


      gen added this applicationContext.xml entry:
      <bean id="testCaseManager" class="org.appfuse.service.impl.GenericManagerImpl">
      <bean class="org.appfuse.dao.hibernate.GenericDaoHibernate">
      <constructor-arg value=""/>
      <property name="sessionFactory" ref="sessionFactory"/>

      gen added this to dispatcher-servlet.xml:
      <bean id="testCaseController" class="">
      <property name="testCaseManager" ref="testCaseManager"/>

      <bean id="testCaseFormController" class="">
      <property name="validator" ref="beanValidator"/>
      <property name="successView" value="redirect:testCases.html"/>
      <property name="testCaseManager" ref="testCaseManager"/>

      gen added this menu-config.xml entry:
      <Menu name="TestCaseMenu" title="testCaseList.title" page="/testCases.html"/>

      gen added this to validation.xml:
      <form name="testCase">

      but that failed XML validation - "missing (field)+", so I added a field entry:
      <form name="testCase">
      <field property="name" depends="required">
      <arg0 key=""/>

      gen also created



          • Assignee:
            Matt Raible
            Dwight Harn
          • Votes:
            0 Vote for this issue
            1 Start watching this issue


            • Created: