Groovy
  1. Groovy
  2. GROOVY-3720

MockFor and StubFor call unsupported method in ProxyGenerator for creation of instances of Abstract classes

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.7-beta-1
    • Fix Version/s: 1.6.5, 1.7-beta-2
    • Component/s: None
    • Labels:
      None
    • Environment:
      Windows XP Professional Version 5.1.2600 Service Pack 2 Build 2600

      Description

      public abstract class MyNode {

      }

      @Test
      public void testCreateStubNode()

      { def stubNodeContext = new StubFor(MyNode) assertNotNull(stubNodeContext.proxyInstance()) }

      @Test
      public void testCreateStubNodeDelegate()

      { def stubNodeContext = new StubFor(MyNode) assertNotNull(stubNodeContext.proxyDelegateInstance()) }

      @Test
      public void testCreateMockNode()

      { def mockNodeContext = new MockFor(MyNode) assertNotNull(mockNodeContext.proxyInstance()) }

      @Test
      public void testCreateMockNodeDelegate()

      { def mockNodeContext = new MockFor(MyNode) assertNotNull(mockNodeContext.proxyDelegateInstance()) }

      In any case (and with a non-empty Abstract class such as import javax.media.j3d.Node) the result is:

      groovy.lang.MissingMethodException: No signature of method: groovy.util.ProxyGenerator.instantiateAggregateFromBaseClass() is applicable for argument types: (java.lang.Class, null) values: [class MyNode, null]

      Which appears to be absolutely true: the ProxyGenerator only has these 3 method signatures, none of which have the Class as the 1st argument (save the single parameter version)...

      instantiateAggregateFromBaseClass(Class)
      instantiateAggregateFromBaseClass(Map, Class)
      instantiateAggregateFromBaseClass(Closure, Class)

        Activity

        No work has yet been logged on this issue.

          People

          • Assignee:
            Roshan Dawrani
            Reporter:
            Geoff Sindel
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development