~ubuntu-branches/ubuntu/lucid/groovy/lucid

« back to all changes in this revision

Viewing changes to src/test/groovy/ClosureListenerTest.groovy

  • Committer: Bazaar Package Importer
  • Author(s): Varun Hiremath, Torsten Werner, Varun Hiremath
  • Date: 2009-04-01 19:24:19 UTC
  • mfrom: (3.2.2 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090401192419-c5mpylqhcdkv3zuv
Tags: 1.6.0-1
[ Torsten Werner ]
* New upstream release (Closes: #521648)
* Remove Build-Depends: libclassworlds-java.
* Switch to source and target version 1.5.

[ Varun Hiremath ]
* Fix build.xml file
* Add ivy to Build-Depends
* Remove unnecessary Depends -- collections3, mx4j and xpp3 
* Add build.diff patch to fix a build error
* Use quilt to manage patches
* Update manpage (Closes: #507862)

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
import javax.swing.JButton
4
4
 
5
5
/**
6
 
 * @version $Revision: 11840 $
 
6
 * @version $Revision: 13693 $
7
7
 */
8
8
class ClosureListenerTest extends GroovySwingTestCase {
9
9
 
10
10
    void testAddingAndRemovingAClosureListener() {
11
 
        if (isHeadless()) return
 
11
      testInEDT {
12
12
 
13
13
        def b = new JButton("foo")
14
14
        b.actionPerformed = { println("Found ${it}") }
34
34
        
35
35
        size = b.actionListeners.size()
36
36
        assert size == 0
 
37
      }
37
38
    }
38
39
    
39
40
    void testGettingAListenerProperty() {
40
 
        if (headless) return
 
41
      testInEDT {
41
42
 
42
43
        def b = new JButton("foo")
43
44
        def foo = b.actionPerformed
44
45
        assert foo == null
 
46
      }
45
47
    }
46
48
    
47
49
    void testNonStandardListener() {
48
 
        if (isHeadless()) return
 
50
      testInEDT {
49
51
        def myWhat = null
50
52
        def myWhere = null
51
53
 
55
57
    
56
58
        assert myWhat == '?'
57
59
        assert myWhere == '!'
 
60
      }
58
61
    }
59
62
}
 
 
b'\\ No newline at end of file'