TestletTestCaseProxy.st
author Claus Gittinger <cg@exept.de>
Thu, 24 Nov 2011 13:02:13 +0100
branchinitialV
changeset 2333 b1a55b7337c9
parent 2152 1cbdfbcc685c
child 2353 fa7400d022a0
permissions -rw-r--r--
checkin from stx browser
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
     1
"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
     2
 COPYRIGHT (c) 1996-2011 by Claus Gittinger
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
     3
 COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
     4
                            SWING Research Group, Czech Technical University in Prague
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
     5
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
     6
 Parts of the code written by Claus Gittinger are under following
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
     7
 license:
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
     8
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
     9
 This software is furnished under a license and may be used
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    10
 only in accordance with the terms of that license and with the
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    11
 inclusion of the above copyright notice.   This software may not
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    12
 be provided or otherwise made available to, or used by, any
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    13
 other person.  No title to or ownership of the software is
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    14
 hereby transferred.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    15
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    16
 Parts of the code written at SWING Reasearch Group [1] are MIT licensed:
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    17
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    18
 Permission is hereby granted, free of charge, to any person
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    19
 obtaining a copy of this software and associated documentation
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    20
 files (the 'Software'), to deal in the Software without
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    21
 restriction, including without limitation the rights to use,
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    22
 copy, modify, merge, publish, distribute, sublicense, and/or sell
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    23
 copies of the Software, and to permit persons to whom the
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    24
 Software is furnished to do so, subject to the following
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    25
 conditions:
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    26
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    27
 The above copyright notice and this permission notice shall be
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    28
 included in all copies or substantial portions of the Software.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    29
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    30
 THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    31
 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    32
 OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    33
 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    34
 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    35
 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    36
 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    37
 OTHER DEALINGS IN THE SOFTWARE.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    38
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    39
 [1] Code written at SWING Research Group contain a signature
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    40
     of one of the above copright owners.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    41
"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    42
"{ Package: 'stx:libjava' }"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    43
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    44
JavaTestCaseProxy subclass:#TestletTestCaseProxy
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    45
	instanceVariableNames:'harness'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    46
	classVariableNames:'TestCases'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    47
	poolDictionaries:''
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    48
	category:'Languages-Java-Tests-Proxies'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    49
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    50
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    51
!TestletTestCaseProxy class methodsFor:'documentation'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    52
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    53
copyright
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    54
"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    55
 COPYRIGHT (c) 1996-2011 by Claus Gittinger
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    56
 COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    57
                            SWING Research Group, Czech Technical University in Prague
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    58
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    59
 Parts of the code written by Claus Gittinger are under following
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    60
 license:
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    61
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    62
 This software is furnished under a license and may be used
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    63
 only in accordance with the terms of that license and with the
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    64
 inclusion of the above copyright notice.   This software may not
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    65
 be provided or otherwise made available to, or used by, any
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    66
 other person.  No title to or ownership of the software is
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    67
 hereby transferred.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    68
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    69
 Parts of the code written at SWING Reasearch Group [1] are MIT licensed:
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    70
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    71
 Permission is hereby granted, free of charge, to any person
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    72
 obtaining a copy of this software and associated documentation
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    73
 files (the 'Software'), to deal in the Software without
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    74
 restriction, including without limitation the rights to use,
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    75
 copy, modify, merge, publish, distribute, sublicense, and/or sell
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    76
 copies of the Software, and to permit persons to whom the
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    77
 Software is furnished to do so, subject to the following
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    78
 conditions:
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    79
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    80
 The above copyright notice and this permission notice shall be
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    81
 included in all copies or substantial portions of the Software.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    82
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    83
 THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    84
 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    85
 OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    86
 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    87
 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    88
 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    89
 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    90
 OTHER DEALINGS IN THE SOFTWARE.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    91
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    92
 [1] Code written at SWING Research Group contain a signature
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    93
     of one of the above copright owners.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    94
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    95
"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    96
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    97
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    98
!TestletTestCaseProxy class methodsFor:'accessing'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    99
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   100
lookupHierarchyRoot
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   101
    ^ TestletTestCaseProxy
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   102
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   103
    "Created: / 01-03-2011 / 11:41:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   104
    "Modified: / 01-03-2011 / 14:54:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   105
    "Modified: / 29-04-2011 / 10:25:26 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   106
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   107
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   108
selector: aSymbol
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   109
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   110
    ^super selector: aSymbol
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   111
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   112
    "Created: / 01-03-2011 / 11:55:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   113
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   114
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   115
!TestletTestCaseProxy class methodsFor:'private'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   116
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   117
testSelectors
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   118
    "testlet always has only one test method, but maybe for the future.."
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   119
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   120
    ^ #( #'test(Lgnu/testlet/TestHarness;)V' ).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   121
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   122
    "Created: / 01-03-2011 / 10:49:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   123
    "Modified: / 03-03-2011 / 00:34:39 / Marcel Hlopko <hlopik@gmail.com>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   124
    "Modified: / 29-05-2011 / 22:54:06 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   125
    "Modified: / 09-08-2011 / 16:31:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   126
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   127
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   128
!TestletTestCaseProxy class methodsFor:'queries'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   129
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   130
isTestlet
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   131
	^ true
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   132
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   133
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   134
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   135
!TestletTestCaseProxy class methodsFor:'subclass creation'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   136
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   137
for: javaClass 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   138
    "Answers a new (anonymous) testcase proxy for
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   139
     given javaClass"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   140
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   141
    self assert: javaClass isJavaClass description: 'Not a java class'.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   142
    self assert: javaClass isTestletLike
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   143
        description: 'Not a testcase-like class'.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   144
    ^self forClassNamed: javaClass name
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   145
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   146
    "Created: / 01-03-2011 / 10:30:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   147
    "Modified: / 03-03-2011 / 00:20:49 / Marcel Hlopko <hlopik@gmail.com>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   148
    "Modified: / 29-04-2011 / 10:21:39 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   149
    "Modified: / 21-06-2011 / 17:08:57 / Jan Vrany <jan.vrany@fit.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   150
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   151
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   152
!TestletTestCaseProxy methodsFor:'accessing'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   153
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   154
nameForHDTestReport
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   155
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   156
    ^(self class javaClassName copyReplaceAll:$/ with: $.) copyTo: (self class javaClassName lastIndexOf: $/) - 1.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   157
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   158
    "Created: / 01-04-2011 / 16:10:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   159
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   160
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   161
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   162
selectorForHDTestReport
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   163
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   164
    ^self class javaClassName copyFrom: 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   165
		(self class javaClassName lastIndexOf: $/) + 1
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   166
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   167
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   168
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   169
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   170
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   171
!TestletTestCaseProxy methodsFor:'error handling'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   172
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   173
doesNotUnderstand: msg
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   174
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   175
    "Here, we have to emulate stx.libjava.tests.TestHarness.Proxy interface..."
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   176
    | sel |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   177
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   178
    sel  := msg selector.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   179
    (sel includes:$() ifTrue:[
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   180
        sel == #'check(Z)V' ifTrue:[
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   181
            ^self assert: msg arg1 == 1 description: ('Assertion failed (checkpoint: %1)' bindWith: self checkPointName).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   182
        ].
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   183
        sel == #'message(Ljava/lang/String;I)V' ifTrue:[
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   184
            | text type |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   185
            text := Java as_ST_String: msg arg1.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   186
            type := msg arguments at: 2.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   187
            ^self message: text type: type.                
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   188
        ].
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   189
        sel == #'directory(I)Ljava/lang/String;' ifTrue:[
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   190
            ^Java as_String: (self directory: msg arg1) asString.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   191
        ].
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   192
    ].
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   193
    ^super doesNotUnderstand: msg
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   194
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   195
    "Created: / 31-05-2011 / 16:30:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   196
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   197
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   198
!TestletTestCaseProxy methodsFor:'private'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   199
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   200
checkPointName
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   201
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   202
    | jstring |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   203
    jstring := harness instVarNamed: #checkPoint.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   204
    ^jstring notNil ifTrue:[
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   205
        Java as_ST_String: jstring
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   206
    ] ifFalse:[
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   207
        '<no checkpoint set>'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   208
    ]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   209
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   210
    "Modified: / 29-04-2011 / 10:52:53 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   211
    "Created: / 09-08-2011 / 12:16:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   212
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   213
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   214
createHarness
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   215
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   216
    harness := (Java classForName: 'stx.libjava.tests.TestHarness') new.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   217
    harness instVarNamed: #proxy put: self.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   218
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   219
    "Modified: / 29-04-2011 / 10:52:53 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   220
    "Created: / 09-08-2011 / 11:29:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   221
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   222
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   223
performTest
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   224
    | handlerBlock |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   225
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   226
    handlerBlock := [:ex | TestResult failure sunitSignalWith: ex description].
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   227
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   228
    self createHarness.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   229
    
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   230
    [ JavaVM unimplementedNativeMethodSignal 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   231
        handle:
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   232
            handlerBlock
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   233
        do: [
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   234
            self javaClass new 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   235
                perform: 'test(Lgnu/testlet/TestHarness;)V' sunitAsSymbol
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   236
                with: harness
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   237
       ].
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   238
    ] on: JavaError do: [:ex | 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   239
        TestResult failure sunitSignalWith: ex description
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   240
    ].
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   241
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   242
    "/((harness instVarNamed: 'passed') = 0 ) ifTrue: [ TestResult failure sunitSignalWith: 'Test failed' ].
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   243
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   244
    "Created: / 01-03-2011 / 14:50:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   245
    "Modified: / 29-05-2011 / 23:19:07 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   246
    "Modified: / 09-08-2011 / 12:13:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   247
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   248
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   249
!TestletTestCaseProxy methodsFor:'private - Proxy interface'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   250
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   251
directory: type
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   252
    "
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   253
        public static final int DIR_TMP = 1;
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   254
        public static final int DIR_SRC = 2;
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   255
        public static final int DIR_RES = 3;
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   256
        public static final int DIR_BLD = 4;
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   257
    "
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   258
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   259
    type == 1 ifTrue:[
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   260
        ^Filename newTemporaryDirectory.  
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   261
    ] ifFalse:[type == 2 ifTrue:[
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   262
        ^JavaTestsResource classpathForMauve anyOne asFilename directory / 'src'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   263
    ] ifFalse:[type == 3 ifTrue:[
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   264
        ^self error:'DIR_RES not yet implemented'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   265
    ] ifFalse:[type == 4 ifTrue:[
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   266
        ^JavaTestsResource classpathForMauve anyOne asFilename
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   267
    ] ifFalse:[
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   268
        ^self error:'Unknown type code'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   269
    ]]]].
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   270
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   271
    "Created: / 10-08-2011 / 15:03:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   272
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   273
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   274
message:msg type: type
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   275
    "
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   276
        public static final int MSG_DBG = 1;
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   277
        public static final int MSG_INF = 2;
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   278
        public static final int MSG_ERR = 3;
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   279
    "
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   280
    type == 1 ifTrue:[Transcript showCR:' Testlet [DBG]: '] ifFalse:[
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   281
    type == 2 ifTrue:[Transcript showCR:' Testlet [INF]: '] ifFalse:[
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   282
    type == 3 ifTrue:[Transcript showCR:' Testlet [ERR]: '] ifFalse:[
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   283
                      Transcript showCR:' Testlet [???]: ']]].
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   284
    Transcript showCR: msg.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   285
    type == 3 ifTrue:[self error: msg].
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   286
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   287
    "Created: / 10-08-2011 / 15:06:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   288
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   289
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   290
!TestletTestCaseProxy class methodsFor:'documentation'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   291
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   292
version_SVN
2152
1cbdfbcc685c Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 749
diff changeset
   293
    ^ '$Id: TestletTestCaseProxy.st,v 1.1 2011-08-18 19:06:53 vrany Exp $'
1cbdfbcc685c Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 749
diff changeset
   294
! !