src/JavaTestCaseProxy.st
author vranyj1
Tue, 26 Jul 2011 16:31:02 +0000
branchjk_new_structure
changeset 877 f5a5b93e1c78
parent 865 82615f7deade
child 905 d03d9e05c581
permissions -rw-r--r--
Cleanup phase 1 - Added #copyright method to all classes - removed JavaClassReader2
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
877
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
     1
"
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
     2
 COPYRIGHT (c) 1996-2011 by Claus Gittinger
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
     3
 COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
     4
                            SWING Research Group, Czech Technical University in Prague
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
     5
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
     6
 Parts of the code written by Claus Gittinger are under following
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
     7
 license:
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
     8
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
     9
 This software is furnished under a license and may be used
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
    10
 only in accordance with the terms of that license and with the
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
    11
 inclusion of the above copyright notice.   This software may not
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
    12
 be provided or otherwise made available to, or used by, any
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
    13
 other person.  No title to or ownership of the software is
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
    14
 hereby transferred.
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
    15
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
    16
 Parts of the code written at SWING Reasearch Group [1] are MIT licensed:
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
    17
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
    18
 Permission is hereby granted, free of charge, to any person
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
    19
 obtaining a copy of this software and associated documentation
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
    20
 files (the 'Software'), to deal in the Software without
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
    21
 restriction, including without limitation the rights to use,
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
    22
 copy, modify, merge, publish, distribute, sublicense, and/or sell
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
    23
 copies of the Software, and to permit persons to whom the
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
    24
 Software is furnished to do so, subject to the following
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
    25
 conditions:
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
    26
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
    27
 The above copyright notice and this permission notice shall be
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
    28
 included in all copies or substantial portions of the Software.
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
    29
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
    30
 THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
    31
 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
    32
 OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
    33
 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
    34
 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
    35
 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
    36
 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
    37
 OTHER DEALINGS IN THE SOFTWARE.
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
    38
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
    39
 [1] Code written at SWING Research Group contain a signature
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
    40
     of one of the above copright owners.
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
    41
"
859
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
    42
"{ Package: 'stx:libjava' }"
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
    43
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
    44
TestCase subclass:#JavaTestCaseProxy
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
    45
	instanceVariableNames:''
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
    46
	classVariableNames:'TestCases'
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
    47
	poolDictionaries:''
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
    48
	category:'Languages-Java-Tests-Proxies'
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
    49
!
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
    50
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
    51
JavaTestCaseProxy class instanceVariableNames:'javaClassName shouldFork'
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
    52
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
    53
"
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
    54
 The following class instance variables are inherited by this class:
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
    55
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
    56
	TestCase - lastTestRunResultOrNil lastTestRunsPassedTests lastTestRunsFailedTests lastTestRunsErrorTests
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
    57
	TestAsserter - 
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
    58
	Object - 
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
    59
"
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
    60
!
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
    61
877
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
    62
!JavaTestCaseProxy class methodsFor:'documentation'!
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
    63
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
    64
copyright
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
    65
"
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
    66
 COPYRIGHT (c) 1996-2011 by Claus Gittinger
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
    67
 COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
    68
                            SWING Research Group, Czech Technical University in Prague
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
    69
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
    70
 Parts of the code written by Claus Gittinger are under following
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
    71
 license:
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
    72
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
    73
 This software is furnished under a license and may be used
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
    74
 only in accordance with the terms of that license and with the
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
    75
 inclusion of the above copyright notice.   This software may not
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
    76
 be provided or otherwise made available to, or used by, any
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
    77
 other person.  No title to or ownership of the software is
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
    78
 hereby transferred.
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
    79
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
    80
 Parts of the code written at SWING Reasearch Group [1] are MIT licensed:
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
    81
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
    82
 Permission is hereby granted, free of charge, to any person
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
    83
 obtaining a copy of this software and associated documentation
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
    84
 files (the 'Software'), to deal in the Software without
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
    85
 restriction, including without limitation the rights to use,
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
    86
 copy, modify, merge, publish, distribute, sublicense, and/or sell
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
    87
 copies of the Software, and to permit persons to whom the
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
    88
 Software is furnished to do so, subject to the following
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
    89
 conditions:
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
    90
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
    91
 The above copyright notice and this permission notice shall be
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
    92
 included in all copies or substantial portions of the Software.
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
    93
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
    94
 THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
    95
 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
    96
 OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
    97
 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
    98
 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
    99
 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
   100
 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
   101
 OTHER DEALINGS IN THE SOFTWARE.
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
   102
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
   103
 [1] Code written at SWING Research Group contain a signature
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
   104
     of one of the above copright owners.
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
   105
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
   106
"
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
   107
! !
859
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   108
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   109
!JavaTestCaseProxy class methodsFor:'initialization'!
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   110
865
82615f7deade Few fixes...
vranyj1
parents: 859
diff changeset
   111
initialize
82615f7deade Few fixes...
vranyj1
parents: 859
diff changeset
   112
82615f7deade Few fixes...
vranyj1
parents: 859
diff changeset
   113
    TestCases := Dictionary new.
82615f7deade Few fixes...
vranyj1
parents: 859
diff changeset
   114
82615f7deade Few fixes...
vranyj1
parents: 859
diff changeset
   115
    "Created: / 01-03-2011 / 10:43:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
82615f7deade Few fixes...
vranyj1
parents: 859
diff changeset
   116
!
82615f7deade Few fixes...
vranyj1
parents: 859
diff changeset
   117
859
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   118
setJavaClassName: aSymbol
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   119
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   120
    javaClassName ifNotNil:
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   121
        [self error: 'Attempting to set java class name twice'].
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   122
    javaClassName := aSymbol.
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   123
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   124
    "Created: / 01-03-2011 / 10:43:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   125
! !
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   126
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   127
!JavaTestCaseProxy class methodsFor:'accessing'!
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   128
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   129
javaClass
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   130
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   131
    ^Java classForName: javaClassName
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   132
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   133
    "Created: / 01-03-2011 / 11:30:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   134
    "Modified: / 21-06-2011 / 17:09:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   135
!
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   136
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   137
javaClassName
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   138
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   139
    ^javaClassName
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   140
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   141
    "Created: / 01-03-2011 / 11:30:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   142
!
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   143
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   144
shouldFork
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   145
    ^ shouldFork ? false
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   146
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   147
    "Modified: / 13-06-2011 / 16:34:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   148
!
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   149
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   150
shouldFork:aBoolean
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   151
    shouldFork := aBoolean.
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   152
! !
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   153
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   154
!JavaTestCaseProxy class methodsFor:'private'!
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   155
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   156
testSelectors
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   157
    "raise an error: must be redefined in concrete subclass(es)"
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   158
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   159
    ^ self subclassResponsibility
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   160
! !
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   161
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   162
!JavaTestCaseProxy class methodsFor:'queries'!
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   163
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   164
isAbstract
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   165
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   166
    ^self == JavaTestCaseProxy or:[self superclass == JavaTestCaseProxy]
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   167
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   168
    "Created: / 21-06-2011 / 16:56:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   169
!
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   170
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   171
isTestlet
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   172
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   173
    ^false
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   174
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   175
    "Created: / 21-06-2011 / 16:57:44 / Jan Vrany <jan.vrany@fit.cvut.cz>"
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   176
! !
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   177
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   178
!JavaTestCaseProxy class methodsFor:'subclass creation'!
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   179
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   180
for: javaClass 
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   181
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   182
    self subclassResponsibility
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   183
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   184
    "Modified: / 21-06-2011 / 17:08:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   185
!
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   186
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   187
forClassNamed: name 
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   188
    "Answers a new (anonymous) testcase proxy for
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   189
     given javaClass"
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   190
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   191
    | meta  cls   |
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   192
    TestCases at: name ifPresent: [:c | ^ c ].
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   193
    meta := Metaclass new.
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   194
    meta setSuperclass: self class.
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   195
    meta instSize: self class instSize.
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   196
    cls := meta new.
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   197
    cls setSuperclass: self.
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   198
    cls flags: self flags.
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   199
    cls instSize: self instSize.
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   200
    cls setJavaClassName: name.
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   201
    cls 
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   202
        setName: (self name , ' for: (Java classForName: ' , name storeString 
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   203
                , ')') asSymbol.
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   204
    cls setCategory: #'(java test case proxies)'.
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   205
    TestCases at: name put: cls.
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   206
    ^ cls
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   207
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   208
    "Modified: / 03-03-2011 / 00:20:49 / Marcel Hlopko <hlopik@gmail.com>"
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   209
    "Modified: / 29-04-2011 / 10:21:39 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   210
    "Created: / 21-06-2011 / 17:07:28 / Jan Vrany <jan.vrany@fit.cvut.cz>"
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   211
! !
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   212
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   213
!JavaTestCaseProxy methodsFor:'accessing'!
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   214
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   215
javaClass
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   216
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   217
    | javaClass |
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   218
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   219
    self 
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   220
        assert: (javaClass := self class javaClass) isJavaClass
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   221
        description: 'java class does not exists'.
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   222
    ^javaClass
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   223
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   224
    "Created: / 01-03-2011 / 14:48:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   225
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   226
! !
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   227
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   228
!JavaTestCaseProxy class methodsFor:'documentation'!
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   229
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   230
version_SVN
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   231
    ^ '$Id$'
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   232
! !
865
82615f7deade Few fixes...
vranyj1
parents: 859
diff changeset
   233
82615f7deade Few fixes...
vranyj1
parents: 859
diff changeset
   234
JavaTestCaseProxy initialize!