|
Groovy example source code file (Groovy3720Bug.groovy)
The Groovy Groovy3720Bug.groovy source code
package groovy.bugs
import groovy.mock.interceptor.*
class Groovy3720Bug extends GroovyTestCase {
void testCreateStubNode() {
def stubNodeContext1 = new StubFor(AnotherNode3720)
assertNotNull stubNodeContext1.proxyInstance()
def stubNodeContext2 = new StubFor(MyNode3720)
assertNotNull stubNodeContext2.proxyInstance()
}
void testCreateStubNodeDelegate() {
def stubNodeContext1 = new StubFor(AnotherNode3720)
assertNotNull stubNodeContext1.proxyDelegateInstance()
def stubNodeContext2 = new StubFor(MyNode3720)
assertNotNull stubNodeContext2.proxyDelegateInstance()
}
void testCreateMockNode() {
def mockNodeContext1 = new MockFor(AnotherNode3720)
assertNotNull mockNodeContext1.proxyInstance()
def mockNodeContext2 = new MockFor(MyNode3720)
assertNotNull mockNodeContext2.proxyInstance()
}
void testCreateMockNodeDelegate() {
def mockNodeContext1 = new MockFor(AnotherNode3720)
assertNotNull mockNodeContext1.proxyDelegateInstance()
def mockNodeContext2 = new MockFor(MyNode3720)
assertNotNull mockNodeContext2.proxyDelegateInstance()
}
}
abstract class MyNode3720 {}
abstract class BaseNode3720 {
abstract m1()
}
abstract class AnotherNode3720 extends BaseNode3720 {
abstract m2()
}
Other Groovy examples (source code examples)Here is a short list of links related to this Groovy Groovy3720Bug.groovy source code file: |
Other websites by Alvin Alexander:
Life/living in Alaska (OneMansAlaska.com)
How I Sold My Business (HowISoldMyBusiness.com)
Copyright 1998-2011 Alvin Alexander, devdaily.com
All Rights Reserved.