JUnitTestCaseProxy.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Mon, 05 Jan 2015 17:10:02 +0100
changeset 3324 a58245c0e83a
parent 3025 e2137bf62524
child 3330 b14c58b2876c
permissions -rw-r--r--
Updated copyright notices.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
     1
"
3324
a58245c0e83a Updated copyright notices.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3025
diff changeset
     2
 COPYRIGHT (c) 1996-2015 by Claus Gittinger
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
     3
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
     4
 New code and modifications done at SWING Research Group [1]:
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
     5
3324
a58245c0e83a Updated copyright notices.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3025
diff changeset
     6
 COPYRIGHT (c) 2010-2015 by Jan Vrany, Jan Kurs and Marcel Hlopko
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
     7
                            SWING Research Group, Czech Technical University in Prague
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
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
    16
 [1] Code written at SWING Research Group contains a signature
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
    17
     of one of the above copright owners. For exact set of such code,
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
    18
     see the differences between this version and version stx:libjava
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
    19
     as of 1.9.2010
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    20
"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    21
"{ Package: 'stx:libjava' }"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    22
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    23
JavaTestCaseProxy subclass:#JUnitTestCaseProxy
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    24
	instanceVariableNames:''
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    25
	classVariableNames:''
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    26
	poolDictionaries:''
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    27
	category:'Languages-Java-Tests-Proxies'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    28
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    29
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    30
!JUnitTestCaseProxy class methodsFor:'documentation'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    31
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    32
copyright
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    33
"
3324
a58245c0e83a Updated copyright notices.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3025
diff changeset
    34
 COPYRIGHT (c) 1996-2015 by Claus Gittinger
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
    35
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
    36
 New code and modifications done at SWING Research Group [1]:
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
    37
3324
a58245c0e83a Updated copyright notices.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3025
diff changeset
    38
 COPYRIGHT (c) 2010-2015 by Jan Vrany, Jan Kurs and Marcel Hlopko
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    39
                            SWING Research Group, Czech Technical University in Prague
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    40
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    41
 This software is furnished under a license and may be used
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    42
 only in accordance with the terms of that license and with the
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    43
 inclusion of the above copyright notice.   This software may not
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    44
 be provided or otherwise made available to, or used by, any
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    45
 other person.  No title to or ownership of the software is
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    46
 hereby transferred.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    47
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
    48
 [1] Code written at SWING Research Group contains a signature
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
    49
     of one of the above copright owners. For exact set of such code,
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
    50
     see the differences between this version and version stx:libjava
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
    51
     as of 1.9.2010
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    52
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    53
"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    54
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    55
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    56
!JUnitTestCaseProxy class methodsFor:'initialization'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    57
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    58
initialize
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    59
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    60
    TestCases := Dictionary new.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    61
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    62
    "Created: / 01-03-2011 / 10:43:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    63
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    64
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    65
!JUnitTestCaseProxy class methodsFor:'accessing'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    66
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    67
lookupHierarchyRoot
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    68
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    69
    ^JUnitTestCaseProxy
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    70
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    71
    "Created: / 01-03-2011 / 11:41:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    72
    "Modified: / 01-03-2011 / 14:54:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    73
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    74
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    75
!JUnitTestCaseProxy class methodsFor:'private'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    76
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
    77
isTestSelector: selector
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
    78
    | javaClass |
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
    79
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
    80
    self == JUnitTestCaseProxy ifTrue:[ ^ #() ].
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
    81
    javaClass := self javaClass.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
    82
    (javaClass includesBehavior:(JavaVM classForName:'junit.framework.TestCase')) 
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
    83
        ifTrue:[ ^ selector startsWith:'test' ].
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
    84
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
    85
    self testSelectors includes: selector.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
    86
    "
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
    87
        (JUnitTestCase for: JAVA::stx::libjava::tests::junit::JUnit3Tests)
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
    88
            testSelectors"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
    89
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
    90
    "Created: / 17-04-2012 / 22:48:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
    91
!
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
    92
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    93
testSelectors
2919
d4ef0fe45599 Fix in JUnitTestCaseProxy>>#testSelectors.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2841
diff changeset
    94
    | javaClass testMethods ignoredMethods |
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    95
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    96
    self == JUnitTestCaseProxy ifTrue:[ ^ #() ].
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    97
    javaClass := self javaClass.
2919
d4ef0fe45599 Fix in JUnitTestCaseProxy>>#testSelectors.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2841
diff changeset
    98
d4ef0fe45599 Fix in JUnitTestCaseProxy>>#testSelectors.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2841
diff changeset
    99
    "/ Old JUnit 3.x style...
d4ef0fe45599 Fix in JUnitTestCaseProxy>>#testSelectors.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2841
diff changeset
   100
    (javaClass includesBehavior:(JavaVM classForName:'junit.framework.TestCase')) ifTrue:[ 
d4ef0fe45599 Fix in JUnitTestCaseProxy>>#testSelectors.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2841
diff changeset
   101
        ^ javaClass selectors select:[:sel | sel startsWith:'test' ]. 
d4ef0fe45599 Fix in JUnitTestCaseProxy>>#testSelectors.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2841
diff changeset
   102
    ].
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   103
2919
d4ef0fe45599 Fix in JUnitTestCaseProxy>>#testSelectors.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2841
diff changeset
   104
    "/ New JUnit 4.x style
d4ef0fe45599 Fix in JUnitTestCaseProxy>>#testSelectors.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2841
diff changeset
   105
    testMethods := (javaClass selectMethodsAnnotatedWith: 'Lorg/junit/Test;' "Has to be type name!!!!!!").
d4ef0fe45599 Fix in JUnitTestCaseProxy>>#testSelectors.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2841
diff changeset
   106
    ignoredMethods := (javaClass selectMethodsAnnotatedWith: 'Lorg/junit/Ignore;' "Has to be type name!!!!!!").
d4ef0fe45599 Fix in JUnitTestCaseProxy>>#testSelectors.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2841
diff changeset
   107
d4ef0fe45599 Fix in JUnitTestCaseProxy>>#testSelectors.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2841
diff changeset
   108
    ^ ( testMethods \ ignoredMethods ) collect:[:m | m selector ].
d4ef0fe45599 Fix in JUnitTestCaseProxy>>#testSelectors.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2841
diff changeset
   109
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   110
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   111
    "
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   112
        (JUnitTestCase for: JAVA::stx::libjava::tests::junit::JUnit3Tests)
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   113
            testSelectors"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   114
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   115
    "Created: / 01-03-2011 / 10:49:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   116
    "Modified: / 03-03-2011 / 00:34:39 / Marcel Hlopko <hlopik@gmail.com>"
2919
d4ef0fe45599 Fix in JUnitTestCaseProxy>>#testSelectors.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2841
diff changeset
   117
    "Modified: / 14-11-2013 / 11:59:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   118
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   119
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   120
!JUnitTestCaseProxy class methodsFor:'subclass creation'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   121
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   122
for:javaClass 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   123
    "Answers a new (anonymous) testcase proxy for
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   124
     given javaClass"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   125
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   126
    self assert:javaClass isJavaClass description:'Not a java class'.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   127
    self assert:javaClass isTestCaseLike
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   128
        description:'Not a testcase-like class'.    
2841
6fa1bcf9c997 JavaClass>>#name vs. #binaryName refactoring
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2731
diff changeset
   129
    ^self forClassNamed: javaClass binaryName
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   130
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   131
    "Created: / 01-03-2011 / 10:30:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   132
    "Modified: / 03-03-2011 / 00:20:49 / Marcel Hlopko <hlopik@gmail.com>"
2841
6fa1bcf9c997 JavaClass>>#name vs. #binaryName refactoring
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2731
diff changeset
   133
    "Modified: / 08-10-2013 / 22:28:28 / Jan Vrany <jan.vrany@fit.cvut.cz>"
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   134
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   135
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   136
!JUnitTestCaseProxy methodsFor:'accessing'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   137
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   138
nameForHDTestReport
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   139
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   140
    ^self class javaClassName copyReplaceAll:$/ with: $.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   141
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   142
    "Created: / 01-04-2011 / 16:10:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   143
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   144
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   145
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   146
selectorForHDTestReport
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   147
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   148
	^testSelector upTo:$(
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   149
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
   150
!
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
   151
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
   152
shouldSkip
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
   153
    "Returns true, if this testcase should be skipped when a testsuite is run.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
   154
     This inly a hint, a test runner is not obliged to respect return value.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
   155
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
   156
     Currently, the only user is stx/goodies/builder/reports"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
   157
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
   158
    | method |
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
   159
    method := self javaClass lookupMethodFor: testSelector.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
   160
    ^method notNil and:[(method annotations runtimeVisible includesKey: 'Lorg/junit/Ignore;')].
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
   161
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
   162
    "Created: / 03-12-2012 / 22:02:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   163
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   164
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   165
!JUnitTestCaseProxy methodsFor:'private'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   166
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   167
performTest
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   168
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   169
    <resource: #skipInDebuggersWalkBack>
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   170
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
   171
    | assertions |
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
   172
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
   173
    assertions := SignalSet 
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
   174
                    with: (Java classForName:'java.lang.AssertionError')
3025
e2137bf62524 Fix in JUnit/TestletTestCaseProxy.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2982
diff changeset
   175
                    with: (Java classForName:'junit.framework.AssertionFailedError').
e2137bf62524 Fix in JUnit/TestletTestCaseProxy.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2982
diff changeset
   176
e2137bf62524 Fix in JUnit/TestletTestCaseProxy.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2982
diff changeset
   177
e2137bf62524 Fix in JUnit/TestletTestCaseProxy.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2982
diff changeset
   178
    "/ JavaVM unimplementedNativeMethodSignal is Signal, not exception.
e2137bf62524 Fix in JUnit/TestletTestCaseProxy.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2982
diff changeset
   179
    "/ Therefore it MUST be caught here!!!!!!                                        
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   180
    [
3025
e2137bf62524 Fix in JUnit/TestletTestCaseProxy.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2982
diff changeset
   181
        [
e2137bf62524 Fix in JUnit/TestletTestCaseProxy.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2982
diff changeset
   182
            self javaClass new perform: testSelector sunitAsSymbol
e2137bf62524 Fix in JUnit/TestletTestCaseProxy.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2982
diff changeset
   183
        ] on: assertions do: [:ex|
e2137bf62524 Fix in JUnit/TestletTestCaseProxy.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2982
diff changeset
   184
            "This is the tricky part. We have to auto-magically convert
e2137bf62524 Fix in JUnit/TestletTestCaseProxy.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2982
diff changeset
   185
             jUnit's AssertionFailedError to sUnits TestFailure's"
e2137bf62524 Fix in JUnit/TestletTestCaseProxy.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2982
diff changeset
   186
            TestResult failure sunitSignalWith: ex getMessage
e2137bf62524 Fix in JUnit/TestletTestCaseProxy.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2982
diff changeset
   187
        ]
e2137bf62524 Fix in JUnit/TestletTestCaseProxy.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2982
diff changeset
   188
    ] on: JavaVM unimplementedNativeMethodSignal do:[:ex|
e2137bf62524 Fix in JUnit/TestletTestCaseProxy.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2982
diff changeset
   189
        ex class sunitSignalWith: ex description
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   190
    ]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   191
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   192
    "Created: / 01-03-2011 / 14:50:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
3025
e2137bf62524 Fix in JUnit/TestletTestCaseProxy.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2982
diff changeset
   193
    "Modified: / 12-02-2014 / 12:33:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   194
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   195
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   196
!JUnitTestCaseProxy class methodsFor:'documentation'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   197
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
   198
version_CVS
2678
c865275e48a7 Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2396
diff changeset
   199
    ^ '$Header: /cvs/stx/stx/libjava/JUnitTestCaseProxy.st,v 1.4 2013-09-06 00:41:08 vrany Exp $'
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
   200
!
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
   201
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
   202
version_HG
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
   203
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
   204
    ^ '$Changeset: <not expanded> $'
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
   205
!
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
   206
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   207
version_SVN
2731
13f5be2bf83b Merged d87e89dd5276 and fe83a843a7bf (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2711 2678
diff changeset
   208
    ^ 'Id'
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   209
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   210
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
   211
2152
1cbdfbcc685c Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 749
diff changeset
   212
JUnitTestCaseProxy initialize!