JBehave
  1. JBehave
  2. JBEHAVE-349

SpringStepsFactory should ignore beans with undefined type and that fail instantiation

    Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 3.0.1
    • Fix Version/s: 3.0.2
    • Component/s: Spring Support
    • Labels:
      None
    • Testcase included:
      yes
    • Patch Submitted:
      Yes
    • Number of attachments :
      1

      Description

      If you use abstract beans the annotation processor blows up.

      I've included a patch. Its basically a try catch around the getBean step. Test data enhanced to recreate problem.

        Activity

        Hide
        Mauro Talevi added a comment -

        It's not simply the abstract class bean that it complains about, those are cared for in the isNotAbstract() method (since 3.0.1), which assumes that the context is able to determine the type of the bean. This is not always the case.

        In any case, a more generic solution is to wrap the bean instantiation to catch the BeansException as you suggest.

        Show
        Mauro Talevi added a comment - It's not simply the abstract class bean that it complains about, those are cared for in the isNotAbstract() method (since 3.0.1), which assumes that the context is able to determine the type of the bean. This is not always the case. In any case, a more generic solution is to wrap the bean instantiation to catch the BeansException as you suggest.
        Mauro Talevi made changes -
        Field Original Value New Value
        Assignee Mauro Talevi [ maurotalevi ]
        Fix Version/s 3.0.2 [ 16771 ]
        Mauro Talevi made changes -
        Summary JBehave Spring doesn't work with abstract beans SpringStepsFactory should ignore beans with undefined type and that fail instantiation
        Mauro Talevi made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]

          People

          • Assignee:
            Mauro Talevi
            Reporter:
            Tom Marsh
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: