JUnitTestCaseProxy.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Fri, 24 May 2013 17:55:42 +0100
branchbuiltin-class-support
changeset 2629 cedb88626902
parent 2450 1d34ee4362f4
child 2711 a00302fe5083
permissions -rw-r--r--
Closing branch.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
     1
"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
     2
 COPYRIGHT (c) 1996-2011 by Claus Gittinger
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
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
     6
 COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko
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
"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    34
 COPYRIGHT (c) 1996-2011 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
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    38
 COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko
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
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    94
    | javaClass |
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.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    98
    (javaClass includesBehavior:(JavaVM classForName:'junit.framework.TestCase')) 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    99
        ifTrue:[ ^ javaClass selectors select:[:sel | sel startsWith:'test' ]. ].
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   100
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   101
    ^ (javaClass 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   102
        selectMethodsAnnotatedWith:(JavaVM classForName:'org.junit.Test') typeName) 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   103
            collect:[:method | method selector ]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   104
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   105
    "
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   106
        (JUnitTestCase for: JAVA::stx::libjava::tests::junit::JUnit3Tests)
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   107
            testSelectors"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   108
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   109
    "Created: / 01-03-2011 / 10:49:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   110
    "Modified: / 03-03-2011 / 00:34:39 / Marcel Hlopko <hlopik@gmail.com>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   111
    "Modified: / 04-03-2011 / 00:05:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   112
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   113
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   114
!JUnitTestCaseProxy class methodsFor:'subclass creation'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   115
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   116
for:javaClass 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   117
    "Answers a new (anonymous) testcase proxy for
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   118
     given javaClass"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   119
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   120
    self assert:javaClass isJavaClass description:'Not a java class'.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   121
    self assert:javaClass isTestCaseLike
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   122
        description:'Not a testcase-like class'.    
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   123
    ^self forClassNamed: javaClass name
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   124
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   125
    "Created: / 01-03-2011 / 10:30:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   126
    "Modified: / 03-03-2011 / 00:20:49 / Marcel Hlopko <hlopik@gmail.com>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   127
    "Modified: / 21-06-2011 / 17:08:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   128
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   129
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   130
!JUnitTestCaseProxy methodsFor:'accessing'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   131
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   132
nameForHDTestReport
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   133
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   134
    ^self class javaClassName copyReplaceAll:$/ with: $.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   135
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   136
    "Created: / 01-04-2011 / 16:10:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   137
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   138
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   139
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   140
selectorForHDTestReport
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   141
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   142
	^testSelector upTo:$(
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   143
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
   144
!
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
   145
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
   146
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
   147
    "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
   148
     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
   149
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
     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
   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
    | 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
   153
    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
   154
    ^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
   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
    "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
   157
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   158
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   159
!JUnitTestCaseProxy methodsFor:'private'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   160
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   161
performTest
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   162
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   163
    <resource: #skipInDebuggersWalkBack>
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   164
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
   165
    | 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
   166
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
   167
    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
   168
                    with: (Java classForName:'java.lang.AssertionError')
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
   169
                    with: (Java classForName:'junit.framework.AssertionFailedError').
749
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
        self javaClass new perform: testSelector sunitAsSymbol
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
    ] on: assertions do: [:ex|
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   173
        "This is the tricky part. We have to auto-magically convert
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   174
         jUnit's AssertionFailedError to sUnits TestFailure's"
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
   175
        TestResult failure sunitSignalWith: ex getMessage
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   176
    ]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   177
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   178
    "Created: / 01-03-2011 / 14:50:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
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
   179
    "Modified (format): / 30-11-2012 / 09:59:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   180
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   181
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   182
!JUnitTestCaseProxy class methodsFor:'documentation'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   183
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
   184
version_CVS
2396
fadc6d7a2f5b Updated to rev 009a0df3afce
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2353
diff changeset
   185
    ^ '$Header: /cvs/stx/stx/libjava/JUnitTestCaseProxy.st,v 1.3 2013-02-25 11:15:31 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
   186
!
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
   187
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
   188
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
   189
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
   190
    ^ '$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
   191
!
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
   192
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   193
version_SVN
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
   194
    ^ '§Id§'
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   195
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   196
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
   197
2152
1cbdfbcc685c Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 749
diff changeset
   198
JUnitTestCaseProxy initialize!