SmallSense__AbstractJavaCompletionEngineTests.st
author Claus Gittinger <cg@exept.de>
Fri, 18 Nov 2016 11:56:15 +0100
branchcvs_MAIN
changeset 996 f5c13fa1943d
parent 270 51c4ee46f5c0
child 374 e65bd2bf892a
permissions -rw-r--r--
#OTHER by cg documentation
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
270
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
     1
"{ Encoding: utf8 }"
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
     2
252
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
     3
"
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
     4
stx:goodies/smallsense - A productivity plugin for Smalltalk/X IDE
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
     5
Copyright (C) 2013-2014 Jan Vrany
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
     6
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
     7
This library is free software; you can redistribute it and/or
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
     8
modify it under the terms of the GNU Lesser General Public
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
     9
License as published by the Free Software Foundation; either
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    10
version 2.1 of the License. 
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    11
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    12
This library is distributed in the hope that it will be useful,
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    13
but WITHOUT ANY WARRANTY; without even the implied warranty of
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    14
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    15
Lesser General Public License for more details.
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    16
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    17
You should have received a copy of the GNU Lesser General Public
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    18
License along with this library; if not, write to the Free Software
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    19
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    20
"
249
8bc64027b189 Package renamed to stx:goodies/smallsense
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 234
diff changeset
    21
"{ Package: 'stx:goodies/smallsense' }"
234
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    22
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    23
"{ NameSpace: SmallSense }"
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    24
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    25
CompletionEngineTests subclass:#AbstractJavaCompletionEngineTests
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    26
	instanceVariableNames:''
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    27
	classVariableNames:''
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    28
	poolDictionaries:''
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    29
	category:'SmallSense-Tests'
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    30
!
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    31
252
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    32
!AbstractJavaCompletionEngineTests class methodsFor:'documentation'!
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    33
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    34
copyright
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    35
"
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    36
stx:goodies/smallsense - A productivity plugin for Smalltalk/X IDE
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    37
Copyright (C) 2013-2014 Jan Vrany
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    38
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    39
This library is free software; you can redistribute it and/or
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    40
modify it under the terms of the GNU Lesser General Public
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    41
License as published by the Free Software Foundation; either
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    42
version 2.1 of the License. 
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    43
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    44
This library is distributed in the hope that it will be useful,
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    45
but WITHOUT ANY WARRANTY; without even the implied warranty of
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    46
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    47
Lesser General Public License for more details.
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    48
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    49
You should have received a copy of the GNU Lesser General Public
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    50
License along with this library; if not, write to the Free Software
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    51
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    52
"
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    53
! !
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    54
234
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    55
!AbstractJavaCompletionEngineTests class methodsFor:'accessing'!
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    56
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    57
resources
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    58
    ^ Array with: JavaCompletionEngineEnvironmentResource
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    59
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    60
    "Created: / 22-05-2014 / 17:18:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    61
! !
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    62
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    63
!AbstractJavaCompletionEngineTests class methodsFor:'queries'!
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    64
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    65
isAbstract
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    66
    "Return if this class is an abstract class.
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    67
     True is returned here for myself only; false for subclasses.
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    68
     Abstract subclasses must redefine again."
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    69
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    70
    ^ self == AbstractJavaCompletionEngineTests.
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    71
! !
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    72
270
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
    73
!AbstractJavaCompletionEngineTests methodsFor:'tests - completion'!
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
    74
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
    75
test_complete_catch_01a
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
    76
    "
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
    77
    Test catch completion
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
    78
    "
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
    79
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
    80
    | java_io_IOException |
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
    81
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
    82
    self complete:'try { 
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
    83
        do(something);
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
    84
    } catch ( IOE┃'.
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
    85
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
    86
    java_io_IOException := context environment == Smalltalk 
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
    87
                            ifTrue:[ context environment classNamed: #'JAVA::java::io::IOException'  ]
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
    88
                            ifFalse:[ context environment classNamed: #'java/io/IOException'].
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
    89
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
    90
    self assert: result notEmpty.
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
    91
    self assert: (result allSatisfy:[:each | each isSmallSenseClassPO ]).
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
    92
    self assert: (result contains:[:each | each klass == java_io_IOException ]).
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
    93
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
    94
    "Created: / 07-08-2014 / 15:11:57 / Jan Vrany <jan.vrany@fit.cvut.cz>"
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
    95
!
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
    96
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
    97
test_complete_catch_01b
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
    98
    "
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
    99
    Test catch completion
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
   100
    "
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
   101
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
   102
    | java_io_IOException |
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
   103
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
   104
    self complete:'try { 
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
   105
        do(something);
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
   106
    } catch ( ┃'.
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
   107
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
   108
    java_io_IOException := context environment == Smalltalk 
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
   109
                            ifTrue:[ context environment classNamed: #'JAVA::java::io::IOException'  ]
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
   110
                            ifFalse:[ context environment classNamed: #'java/io/IOException'].
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
   111
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
   112
    self assert: result notEmpty.
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
   113
    self assert: (result allSatisfy:[:each | each isSmallSenseClassPO ]).
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
   114
    self assert: (result contains:[:each | each klass == java_io_IOException ]).
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
   115
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
   116
    "Created: / 07-08-2014 / 16:02:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
   117
!
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
   118
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
   119
test_complete_catch_01c
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
   120
    "
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
   121
    Test catch completion
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
   122
    "
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
   123
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
   124
    | java_io_IOException |
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
   125
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
   126
    self complete:'try { 
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
   127
        do(something);
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
   128
    } catch ( java.io.IO┃'.
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
   129
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
   130
    java_io_IOException := context environment == Smalltalk 
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
   131
                            ifTrue:[ context environment classNamed: #'JAVA::java::io::IOException'  ]
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
   132
                            ifFalse:[ context environment classNamed: #'java/io/IOException'].
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
   133
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
   134
    self assert: result notEmpty.
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
   135
    self assert: (result allSatisfy:[:each | each isSmallSenseClassPO ]).
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
   136
    self assert: (result contains:[:each | each klass == java_io_IOException ]).
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
   137
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
   138
    "Created: / 07-08-2014 / 16:07:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
   139
!
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
   140
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
   141
test_complete_catch_01d
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
   142
    "
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
   143
    Test catch completion
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
   144
    "
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
   145
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
   146
    | java_io_IOException |
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
   147
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
   148
    self complete:'try { 
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
   149
        do(something);
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
   150
    } catch ( java.io.┃'.
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
   151
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
   152
    java_io_IOException := context environment == Smalltalk 
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
   153
                            ifTrue:[ context environment classNamed: #'JAVA::java::io::IOException'  ]
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
   154
                            ifFalse:[ context environment classNamed: #'java/io/IOException'].
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
   155
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
   156
    self assert: result notEmpty.
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
   157
    self assert: (result allSatisfy:[:each | each isSmallSenseClassPO ]).
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
   158
    self assert: (result contains:[:each | each klass == java_io_IOException ]).
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
   159
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
   160
    "Created: / 07-08-2014 / 16:08:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
   161
!
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
   162
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
   163
test_complete_catch_01e
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
   164
    "
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
   165
    Test catch completion
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
   166
    "
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
   167
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
   168
    | java_io_IOException |
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
   169
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
   170
    self complete:'try { 
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
   171
        do(something);
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
   172
    } catch ( jav┃'.
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
   173
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
   174
    java_io_IOException := context environment == Smalltalk 
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
   175
                            ifTrue:[ context environment classNamed: #'JAVA::java::io::IOException'  ]
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
   176
                            ifFalse:[ context environment classNamed: #'java/io/IOException'].
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
   177
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
   178
    self assert: result notEmpty.
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
   179
    self assert: (result allSatisfy:[:each | each isSmallSenseClassPO ]).
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
   180
    self assert: (result contains:[:each | each klass == java_io_IOException ]).
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
   181
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
   182
    "Created: / 07-08-2014 / 16:20:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
   183
! !
51c4ee46f5c0 Support for completion of Java catch clause (completes exception classes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
   184