src/JavaTestCaseProxy.st
author vranyj1
Wed, 23 Nov 2011 15:26:06 +0000
branchjk_new_structure
changeset 1152 040cba55a7d2
parent 934 7810e6f398b2
child 1155 d6f6d5fc0343
permissions -rw-r--r--
Copyright fixes
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
1152
040cba55a7d2 Copyright fixes
vranyj1
parents: 934
diff changeset
     3
040cba55a7d2 Copyright fixes
vranyj1
parents: 934
diff changeset
     4
 New code and modification done at SWING Research Group [1]:
040cba55a7d2 Copyright fixes
vranyj1
parents: 934
diff changeset
     5
877
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
     6
 COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
     7
                            SWING Research Group, Czech Technical University in Prague
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
     8
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
     9
 Parts of the code written by Claus Gittinger are under following
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
    10
 license:
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
    11
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
    12
 This software is furnished under a license and may be used
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
    13
 only in accordance with the terms of that license and with the
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
    14
 inclusion of the above copyright notice.   This software may not
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
    15
 be provided or otherwise made available to, or used by, any
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
    16
 other person.  No title to or ownership of the software is
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
    17
 hereby transferred.
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
    18
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
    19
 [1] Code written at SWING Research Group contain a signature
1152
040cba55a7d2 Copyright fixes
vranyj1
parents: 934
diff changeset
    20
     of one of the above copright owners. For exact set of such code
040cba55a7d2 Copyright fixes
vranyj1
parents: 934
diff changeset
    21
     see the differences between this version and version stx:lib
040cba55a7d2 Copyright fixes
vranyj1
parents: 934
diff changeset
    22
     as of 1.9.2010
877
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
    23
"
859
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
    24
"{ Package: 'stx:libjava' }"
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
    25
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
    26
TestCase subclass:#JavaTestCaseProxy
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
    27
	instanceVariableNames:''
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
    28
	classVariableNames:'TestCases'
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
    29
	poolDictionaries:''
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
    30
	category:'Languages-Java-Tests-Proxies'
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
    31
!
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
    32
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
    33
JavaTestCaseProxy class instanceVariableNames:'javaClassName shouldFork'
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
    34
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
    35
"
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
    36
 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
    37
934
7810e6f398b2 Changes in JavaLookup
kursjan
parents: 905
diff changeset
    38
	TestCase - lastOutcomes
859
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
    39
	TestAsserter - 
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
    40
	Object - 
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
    41
"
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
    42
!
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
    43
877
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
    44
!JavaTestCaseProxy class methodsFor:'documentation'!
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
    45
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
    46
copyright
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
    47
"
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
    48
 COPYRIGHT (c) 1996-2011 by Claus Gittinger
1152
040cba55a7d2 Copyright fixes
vranyj1
parents: 934
diff changeset
    49
040cba55a7d2 Copyright fixes
vranyj1
parents: 934
diff changeset
    50
 New code and modification done at SWING Research Group [1]:
040cba55a7d2 Copyright fixes
vranyj1
parents: 934
diff changeset
    51
877
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
    52
 COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
    53
                            SWING Research Group, Czech Technical University in Prague
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
    54
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
    55
 Parts of the code written by Claus Gittinger are under following
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
    56
 license:
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
    57
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
    58
 This software is furnished under a license and may be used
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
    59
 only in accordance with the terms of that license and with the
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
    60
 inclusion of the above copyright notice.   This software may not
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
    61
 be provided or otherwise made available to, or used by, any
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
    62
 other person.  No title to or ownership of the software is
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
    63
 hereby transferred.
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
    64
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
    65
 [1] Code written at SWING Research Group contain a signature
1152
040cba55a7d2 Copyright fixes
vranyj1
parents: 934
diff changeset
    66
     of one of the above copright owners. For exact set of such code
040cba55a7d2 Copyright fixes
vranyj1
parents: 934
diff changeset
    67
     see the differences between this version and version stx:lib
040cba55a7d2 Copyright fixes
vranyj1
parents: 934
diff changeset
    68
     as of 1.9.2010
877
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
    69
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
    70
"
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 865
diff changeset
    71
! !
859
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
    72
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
    73
!JavaTestCaseProxy class methodsFor:'initialization'!
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
    74
865
82615f7deade Few fixes...
vranyj1
parents: 859
diff changeset
    75
initialize
82615f7deade Few fixes...
vranyj1
parents: 859
diff changeset
    76
82615f7deade Few fixes...
vranyj1
parents: 859
diff changeset
    77
    TestCases := Dictionary new.
82615f7deade Few fixes...
vranyj1
parents: 859
diff changeset
    78
82615f7deade Few fixes...
vranyj1
parents: 859
diff changeset
    79
    "Created: / 01-03-2011 / 10:43:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
82615f7deade Few fixes...
vranyj1
parents: 859
diff changeset
    80
!
82615f7deade Few fixes...
vranyj1
parents: 859
diff changeset
    81
859
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
    82
setJavaClassName: aSymbol
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
    83
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
    84
    javaClassName ifNotNil:
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
    85
        [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
    86
    javaClassName := aSymbol.
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
    87
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
    88
    "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
    89
! !
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
    90
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
    91
!JavaTestCaseProxy class methodsFor:'accessing'!
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
    92
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
    93
javaClass
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
    94
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
    95
    ^Java classForName: javaClassName
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
    96
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
    97
    "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
    98
    "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
    99
!
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   100
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   101
javaClassName
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   102
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   103
    ^javaClassName
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   104
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   105
    "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
   106
!
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   107
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   108
shouldFork
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   109
    ^ shouldFork ? false
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   110
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   111
    "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
   112
!
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   113
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   114
shouldFork:aBoolean
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   115
    shouldFork := aBoolean.
905
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 877
diff changeset
   116
!
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 877
diff changeset
   117
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 877
diff changeset
   118
sunitName
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 877
diff changeset
   119
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 877
diff changeset
   120
    ^javaClassName
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 877
diff changeset
   121
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 877
diff changeset
   122
    "Created: / 10-08-2011 / 21:21:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
859
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
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   125
!JavaTestCaseProxy class methodsFor:'private'!
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
testSelectors
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   128
    "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
   129
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   130
    ^ self subclassResponsibility
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   131
! !
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
!JavaTestCaseProxy class methodsFor:'queries'!
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   134
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   135
isAbstract
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
    ^self == JavaTestCaseProxy or:[self superclass == JavaTestCaseProxy]
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
    "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
   140
!
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   141
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   142
isTestlet
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
    ^false
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   145
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   146
    "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
   147
! !
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
!JavaTestCaseProxy class methodsFor:'subclass creation'!
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   150
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   151
for: javaClass 
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
    self subclassResponsibility
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   154
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   155
    "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
   156
!
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   157
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   158
forClassNamed: name 
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   159
    "Answers a new (anonymous) testcase proxy for
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   160
     given javaClass"
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
    | meta  cls   |
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   163
    TestCases at: name ifPresent: [:c | ^ c ].
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   164
    meta := Metaclass new.
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   165
    meta setSuperclass: self class.
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   166
    meta instSize: self class instSize.
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   167
    cls := meta new.
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   168
    cls setSuperclass: self.
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   169
    cls flags: self flags.
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   170
    cls instSize: self instSize.
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   171
    cls setJavaClassName: name.
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   172
    cls 
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   173
        setName: (self name , ' for: (Java classForName: ' , name storeString 
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   174
                , ')') asSymbol.
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   175
    cls setCategory: #'(java test case proxies)'.
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   176
    TestCases at: name put: cls.
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   177
    ^ cls
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   178
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   179
    "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
   180
    "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
   181
    "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
   182
! !
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
!JavaTestCaseProxy methodsFor:'accessing'!
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
javaClass
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   187
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   188
    | javaClass |
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   189
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   190
    self 
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   191
        assert: (javaClass := self class javaClass) isJavaClass
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   192
        description: 'java class does not exists'.
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   193
    ^javaClass
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   194
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   195
    "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
   196
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   197
! !
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   198
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   199
!JavaTestCaseProxy class methodsFor:'documentation'!
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   200
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   201
version_SVN
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   202
    ^ '$Id$'
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents:
diff changeset
   203
! !
865
82615f7deade Few fixes...
vranyj1
parents: 859
diff changeset
   204
82615f7deade Few fixes...
vranyj1
parents: 859
diff changeset
   205
JavaTestCaseProxy initialize!