src/JavaTestsLoader.st
author hlopkmar
Wed, 19 Oct 2011 16:18:27 +0000
branchjk_new_structure
changeset 1026 5badd1d31864
parent 898 94eb1038a323
child 1033 a31de6a4cfa4
permissions -rw-r--r--
introduced JavaClassRegistry, taken loading responsibilities from JavaClassReader, got rid of stringConstants and started using StringRefs.. Bugs very likely :)
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
877
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
     1
"
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
     2
 COPYRIGHT (c) 1996-2011 by Claus Gittinger
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
     3
 COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
     4
                            SWING Research Group, Czech Technical University in Prague
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
     5
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
     6
 Parts of the code written by Claus Gittinger are under following
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
     7
 license:
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
     8
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
     9
 This software is furnished under a license and may be used
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
    10
 only in accordance with the terms of that license and with the
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
    11
 inclusion of the above copyright notice.   This software may not
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
    12
 be provided or otherwise made available to, or used by, any
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
    13
 other person.  No title to or ownership of the software is
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
    14
 hereby transferred.
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
    15
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
    16
 Parts of the code written at SWING Reasearch Group [1] are MIT licensed:
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
    17
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
    18
 Permission is hereby granted, free of charge, to any person
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
    19
 obtaining a copy of this software and associated documentation
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
    20
 files (the 'Software'), to deal in the Software without
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
    21
 restriction, including without limitation the rights to use,
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
    22
 copy, modify, merge, publish, distribute, sublicense, and/or sell
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
    23
 copies of the Software, and to permit persons to whom the
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
    24
 Software is furnished to do so, subject to the following
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
    25
 conditions:
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
    26
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
    27
 The above copyright notice and this permission notice shall be
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
    28
 included in all copies or substantial portions of the Software.
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
    29
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
    30
 THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
    31
 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
    32
 OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
    33
 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
    34
 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
    35
 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
    36
 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
    37
 OTHER DEALINGS IN THE SOFTWARE.
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
    38
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
    39
 [1] Code written at SWING Research Group contain a signature
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
    40
     of one of the above copright owners.
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
    41
"
763
1e82b558abd3 Few fixes toward new repository layout
vranyj1
parents:
diff changeset
    42
"{ Package: 'stx:libjava' }"
1e82b558abd3 Few fixes toward new repository layout
vranyj1
parents:
diff changeset
    43
1e82b558abd3 Few fixes toward new repository layout
vranyj1
parents:
diff changeset
    44
Object subclass:#JavaTestsLoader
1e82b558abd3 Few fixes toward new repository layout
vranyj1
parents:
diff changeset
    45
	instanceVariableNames:''
1e82b558abd3 Few fixes toward new repository layout
vranyj1
parents:
diff changeset
    46
	classVariableNames:''
1e82b558abd3 Few fixes toward new repository layout
vranyj1
parents:
diff changeset
    47
	poolDictionaries:''
1e82b558abd3 Few fixes toward new repository layout
vranyj1
parents:
diff changeset
    48
	category:'Languages-Java-Tests'
1e82b558abd3 Few fixes toward new repository layout
vranyj1
parents:
diff changeset
    49
!
1e82b558abd3 Few fixes toward new repository layout
vranyj1
parents:
diff changeset
    50
877
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
    51
!JavaTestsLoader class methodsFor:'documentation'!
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
    52
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
    53
copyright
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
    54
"
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
    55
 COPYRIGHT (c) 1996-2011 by Claus Gittinger
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
    56
 COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
    57
                            SWING Research Group, Czech Technical University in Prague
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
    58
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
    59
 Parts of the code written by Claus Gittinger are under following
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
    60
 license:
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
    61
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
    62
 This software is furnished under a license and may be used
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
    63
 only in accordance with the terms of that license and with the
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
    64
 inclusion of the above copyright notice.   This software may not
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
    65
 be provided or otherwise made available to, or used by, any
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
    66
 other person.  No title to or ownership of the software is
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
    67
 hereby transferred.
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
    68
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
    69
 Parts of the code written at SWING Reasearch Group [1] are MIT licensed:
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
    70
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
    71
 Permission is hereby granted, free of charge, to any person
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
    72
 obtaining a copy of this software and associated documentation
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
    73
 files (the 'Software'), to deal in the Software without
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
    74
 restriction, including without limitation the rights to use,
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
    75
 copy, modify, merge, publish, distribute, sublicense, and/or sell
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
    76
 copies of the Software, and to permit persons to whom the
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
    77
 Software is furnished to do so, subject to the following
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
    78
 conditions:
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
    79
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
    80
 The above copyright notice and this permission notice shall be
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
    81
 included in all copies or substantial portions of the Software.
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
    82
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
    83
 THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
    84
 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
    85
 OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
    86
 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
    87
 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
    88
 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
    89
 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
    90
 OTHER DEALINGS IN THE SOFTWARE.
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
    91
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
    92
 [1] Code written at SWING Research Group contain a signature
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
    93
     of one of the above copright owners.
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
    94
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
    95
"
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
    96
! !
763
1e82b558abd3 Few fixes toward new repository layout
vranyj1
parents:
diff changeset
    97
860
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
    98
!JavaTestsLoader class methodsFor:'accessing'!
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
    99
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   100
buildSuiteForLibjava
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   101
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   102
    ^self buildSuiteFrom: 
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   103
        (self loadLibjava)
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   104
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   105
    "
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   106
        JavaTestsLoader buildSuiteForLibjava
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   107
    "
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   108
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   109
    "Created: / 21-06-2011 / 17:39:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   110
!
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   111
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   112
buildSuiteForMauve
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   113
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   114
    ^self buildSuiteFrom: 
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   115
        (self loadMauve)
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   116
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   117
    "
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   118
        JavaTestsLoader buildSuiteForMauve
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   119
    "
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   120
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   121
    "Created: / 21-06-2011 / 17:40:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   122
!
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   123
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   124
buildSuiteForMauveToFix
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   125
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   126
    ^self buildSuiteFrom: 
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   127
        (self loadMauveToFix)
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   128
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   129
    "
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   130
        JavaTestsLoader buildSuiteForMauveToFix
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   131
    "
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   132
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   133
    "Created: / 21-06-2011 / 17:40:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   134
! !
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   135
763
1e82b558abd3 Few fixes toward new repository layout
vranyj1
parents:
diff changeset
   136
!JavaTestsLoader class methodsFor:'loading'!
1e82b558abd3 Few fixes toward new repository layout
vranyj1
parents:
diff changeset
   137
1e82b558abd3 Few fixes toward new repository layout
vranyj1
parents:
diff changeset
   138
load
867
vranyj1
parents: 860
diff changeset
   139
    JavaTestsResource build.
848
b06ee9c295d9 Utility methods to load relevant subset of Mauve test suite
vranyj1
parents: 829
diff changeset
   140
    self loadIn:JavaTestsResource classpath
763
1e82b558abd3 Few fixes toward new repository layout
vranyj1
parents:
diff changeset
   141
1e82b558abd3 Few fixes toward new repository layout
vranyj1
parents:
diff changeset
   142
    "Created: / 07-05-2011 / 18:43:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1e82b558abd3 Few fixes toward new repository layout
vranyj1
parents:
diff changeset
   143
!
1e82b558abd3 Few fixes toward new repository layout
vranyj1
parents:
diff changeset
   144
848
b06ee9c295d9 Utility methods to load relevant subset of Mauve test suite
vranyj1
parents: 829
diff changeset
   145
load:testdir 
b06ee9c295d9 Utility methods to load relevant subset of Mauve test suite
vranyj1
parents: 829
diff changeset
   146
    |base dirs|
763
1e82b558abd3 Few fixes toward new repository layout
vranyj1
parents:
diff changeset
   147
848
b06ee9c295d9 Utility methods to load relevant subset of Mauve test suite
vranyj1
parents: 829
diff changeset
   148
    base := (UserPreferences current javaTestsDirectory asFilename / testdir) 
b06ee9c295d9 Utility methods to load relevant subset of Mauve test suite
vranyj1
parents: 829
diff changeset
   149
                pathName.
b06ee9c295d9 Utility methods to load relevant subset of Mauve test suite
vranyj1
parents: 829
diff changeset
   150
    dirs := JavaTestsResource classpath 
b06ee9c295d9 Utility methods to load relevant subset of Mauve test suite
vranyj1
parents: 829
diff changeset
   151
                select:[:each | each startsWith:base ].
b06ee9c295d9 Utility methods to load relevant subset of Mauve test suite
vranyj1
parents: 829
diff changeset
   152
    self loadIn:dirs.
763
1e82b558abd3 Few fixes toward new repository layout
vranyj1
parents:
diff changeset
   153
1e82b558abd3 Few fixes toward new repository layout
vranyj1
parents:
diff changeset
   154
    "
848
b06ee9c295d9 Utility methods to load relevant subset of Mauve test suite
vranyj1
parents: 829
diff changeset
   155
        JavaTestsLoader load: 'libjava'"
b06ee9c295d9 Utility methods to load relevant subset of Mauve test suite
vranyj1
parents: 829
diff changeset
   156
    "Created: / 07-05-2011 / 18:40:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
b06ee9c295d9 Utility methods to load relevant subset of Mauve test suite
vranyj1
parents: 829
diff changeset
   157
! !
b06ee9c295d9 Utility methods to load relevant subset of Mauve test suite
vranyj1
parents: 829
diff changeset
   158
b06ee9c295d9 Utility methods to load relevant subset of Mauve test suite
vranyj1
parents: 829
diff changeset
   159
!JavaTestsLoader class methodsFor:'loading - test suites'!
b06ee9c295d9 Utility methods to load relevant subset of Mauve test suite
vranyj1
parents: 829
diff changeset
   160
860
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   161
loadLibjava
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   162
    |cp|
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   163
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   164
    JavaTestsResource new setUp.
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   165
    cp := JavaTestsResource classpathForLibjava.
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   166
    ^self loadIn: cp
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   167
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   168
    "Created: / 21-06-2011 / 17:35:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   169
!
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   170
848
b06ee9c295d9 Utility methods to load relevant subset of Mauve test suite
vranyj1
parents: 829
diff changeset
   171
loadMauve
b06ee9c295d9 Utility methods to load relevant subset of Mauve test suite
vranyj1
parents: 829
diff changeset
   172
    |cp|
b06ee9c295d9 Utility methods to load relevant subset of Mauve test suite
vranyj1
parents: 829
diff changeset
   173
b06ee9c295d9 Utility methods to load relevant subset of Mauve test suite
vranyj1
parents: 829
diff changeset
   174
    JavaTestsResource new setUp.
b06ee9c295d9 Utility methods to load relevant subset of Mauve test suite
vranyj1
parents: 829
diff changeset
   175
    cp := JavaTestsResource classpathForMauve.
b06ee9c295d9 Utility methods to load relevant subset of Mauve test suite
vranyj1
parents: 829
diff changeset
   176
    ^self loadIn: cp
b06ee9c295d9 Utility methods to load relevant subset of Mauve test suite
vranyj1
parents: 829
diff changeset
   177
b06ee9c295d9 Utility methods to load relevant subset of Mauve test suite
vranyj1
parents: 829
diff changeset
   178
    "Created: / 11-06-2011 / 16:03:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
b06ee9c295d9 Utility methods to load relevant subset of Mauve test suite
vranyj1
parents: 829
diff changeset
   179
!
b06ee9c295d9 Utility methods to load relevant subset of Mauve test suite
vranyj1
parents: 829
diff changeset
   180
852
37bd4bf93eb6 added JavaTestsLoader>>loadMauve: pattern utility method
vranyj1
parents: 849
diff changeset
   181
loadMauve: pattern
37bd4bf93eb6 added JavaTestsLoader>>loadMauve: pattern utility method
vranyj1
parents: 849
diff changeset
   182
    |cp|
37bd4bf93eb6 added JavaTestsLoader>>loadMauve: pattern utility method
vranyj1
parents: 849
diff changeset
   183
37bd4bf93eb6 added JavaTestsLoader>>loadMauve: pattern utility method
vranyj1
parents: 849
diff changeset
   184
    JavaTestsResource new setUp.
37bd4bf93eb6 added JavaTestsLoader>>loadMauve: pattern utility method
vranyj1
parents: 849
diff changeset
   185
    cp := JavaTestsResource classpathForMauve.
857
98433a9afe3f JavaTestsLoader: loadMauve: now returns collection of loaded classes
vranyj1
parents: 852
diff changeset
   186
    ^self loadIn: cp matching: pattern.
852
37bd4bf93eb6 added JavaTestsLoader>>loadMauve: pattern utility method
vranyj1
parents: 849
diff changeset
   187
37bd4bf93eb6 added JavaTestsLoader>>loadMauve: pattern utility method
vranyj1
parents: 849
diff changeset
   188
    "
37bd4bf93eb6 added JavaTestsLoader>>loadMauve: pattern utility method
vranyj1
parents: 849
diff changeset
   189
        JavaTestsLoader loadMauve:'gnu.testlet.java.lang.String.*'
37bd4bf93eb6 added JavaTestsLoader>>loadMauve: pattern utility method
vranyj1
parents: 849
diff changeset
   190
    "
37bd4bf93eb6 added JavaTestsLoader>>loadMauve: pattern utility method
vranyj1
parents: 849
diff changeset
   191
37bd4bf93eb6 added JavaTestsLoader>>loadMauve: pattern utility method
vranyj1
parents: 849
diff changeset
   192
    "Created: / 12-06-2011 / 21:56:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
857
98433a9afe3f JavaTestsLoader: loadMauve: now returns collection of loaded classes
vranyj1
parents: 852
diff changeset
   193
    "Modified: / 20-06-2011 / 19:00:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
852
37bd4bf93eb6 added JavaTestsLoader>>loadMauve: pattern utility method
vranyj1
parents: 849
diff changeset
   194
!
37bd4bf93eb6 added JavaTestsLoader>>loadMauve: pattern utility method
vranyj1
parents: 849
diff changeset
   195
848
b06ee9c295d9 Utility methods to load relevant subset of Mauve test suite
vranyj1
parents: 829
diff changeset
   196
loadMauveToFix
b06ee9c295d9 Utility methods to load relevant subset of Mauve test suite
vranyj1
parents: 829
diff changeset
   197
    |cp|
b06ee9c295d9 Utility methods to load relevant subset of Mauve test suite
vranyj1
parents: 829
diff changeset
   198
b06ee9c295d9 Utility methods to load relevant subset of Mauve test suite
vranyj1
parents: 829
diff changeset
   199
    JavaTestsResource new setUp.
b06ee9c295d9 Utility methods to load relevant subset of Mauve test suite
vranyj1
parents: 829
diff changeset
   200
    cp := JavaTestsResource classpathForMauve.
b06ee9c295d9 Utility methods to load relevant subset of Mauve test suite
vranyj1
parents: 829
diff changeset
   201
    self 
849
0addf2406912 Fixes for Mauve test suite
vranyj1
parents: 848
diff changeset
   202
        loadIn: cp matching:'gnu.testlet.java.lang.*';
0addf2406912 Fixes for Mauve test suite
vranyj1
parents: 848
diff changeset
   203
        loadIn: cp matching:'gnu.testlet.java.lang.reflect.*';
898
94eb1038a323 - add native to close InputFileStream
vranyj1
parents: 877
diff changeset
   204
        loadIn: cp matching:'gnu.testlet.java.util.*';
94eb1038a323 - add native to close InputFileStream
vranyj1
parents: 877
diff changeset
   205
        loadIn: cp matching:'gnu.testlet.java.io.*';
94eb1038a323 - add native to close InputFileStream
vranyj1
parents: 877
diff changeset
   206
        loadIn: cp matching:'gnu.testlet.java.nio.*'.
848
b06ee9c295d9 Utility methods to load relevant subset of Mauve test suite
vranyj1
parents: 829
diff changeset
   207
b06ee9c295d9 Utility methods to load relevant subset of Mauve test suite
vranyj1
parents: 829
diff changeset
   208
    "
b06ee9c295d9 Utility methods to load relevant subset of Mauve test suite
vranyj1
parents: 829
diff changeset
   209
        JavaTestsLoader loadMauveToFix    
763
1e82b558abd3 Few fixes toward new repository layout
vranyj1
parents:
diff changeset
   210
    "
1e82b558abd3 Few fixes toward new repository layout
vranyj1
parents:
diff changeset
   211
848
b06ee9c295d9 Utility methods to load relevant subset of Mauve test suite
vranyj1
parents: 829
diff changeset
   212
    "Created: / 11-06-2011 / 16:07:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
763
1e82b558abd3 Few fixes toward new repository layout
vranyj1
parents:
diff changeset
   213
! !
1e82b558abd3 Few fixes toward new repository layout
vranyj1
parents:
diff changeset
   214
1e82b558abd3 Few fixes toward new repository layout
vranyj1
parents:
diff changeset
   215
!JavaTestsLoader class methodsFor:'private'!
1e82b558abd3 Few fixes toward new repository layout
vranyj1
parents:
diff changeset
   216
860
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   217
buildSuiteFrom: classes
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   218
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   219
    | javaTestCases suite |
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   220
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   221
    javaTestCases := OrderedCollection new.
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   222
    suite := TestSuite new.
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   223
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   224
    classes do:
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   225
        [:jclass|
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   226
        (jclass ~~ (Java at:'stx.libjava.tests.JUnit3Tests')
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   227
            and:[jclass ~~ (Java at:'stx.libjava.tests.JUnit4Tests')
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   228
                and:[jclass isTestCaseLike]])
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   229
                    ifTrue:
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   230
                        [ | tc |
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   231
                        tc := jclass asTestCase.
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   232
                                                (tc askFor:#isTestlet) ifTrue:[
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   233
                                                        tc shouldFork: true.
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   234
                                                ].
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   235
                        tc isAbstract ifFalse:[javaTestCases add:tc ]]].
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   236
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   237
    javaTestCases do:
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   238
                [:each | 
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   239
                suite addTests:each buildSuite tests ].
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   240
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   241
    ^suite
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   242
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   243
    "Modified: / 21-06-2011 / 17:39:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   244
!
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   245
763
1e82b558abd3 Few fixes toward new repository layout
vranyj1
parents:
diff changeset
   246
loadIn: directories
1e82b558abd3 Few fixes toward new repository layout
vranyj1
parents:
diff changeset
   247
848
b06ee9c295d9 Utility methods to load relevant subset of Mauve test suite
vranyj1
parents: 829
diff changeset
   248
    ^self loadIn: directories matching: '*'
b06ee9c295d9 Utility methods to load relevant subset of Mauve test suite
vranyj1
parents: 829
diff changeset
   249
b06ee9c295d9 Utility methods to load relevant subset of Mauve test suite
vranyj1
parents: 829
diff changeset
   250
    "Created: / 11-06-2011 / 16:05:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
b06ee9c295d9 Utility methods to load relevant subset of Mauve test suite
vranyj1
parents: 829
diff changeset
   251
!
b06ee9c295d9 Utility methods to load relevant subset of Mauve test suite
vranyj1
parents: 829
diff changeset
   252
1026
5badd1d31864 introduced JavaClassRegistry, taken loading responsibilities from JavaClassReader, got rid of stringConstants and started using StringRefs.. Bugs very likely :)
hlopkmar
parents: 898
diff changeset
   253
loadIn: directories matching: pattern 
857
98433a9afe3f JavaTestsLoader: loadMauve: now returns collection of loaded classes
vranyj1
parents: 852
diff changeset
   254
    | classes |
1026
5badd1d31864 introduced JavaClassRegistry, taken loading responsibilities from JavaClassReader, got rid of stringConstants and started using StringRefs.. Bugs very likely :)
hlopkmar
parents: 898
diff changeset
   255
5badd1d31864 introduced JavaClassRegistry, taken loading responsibilities from JavaClassReader, got rid of stringConstants and started using StringRefs.. Bugs very likely :)
hlopkmar
parents: 898
diff changeset
   256
    JavaInitializedResource new setUp.
763
1e82b558abd3 Few fixes toward new repository layout
vranyj1
parents:
diff changeset
   257
    JavaLibrariesResource new setUp.
1e82b558abd3 Few fixes toward new repository layout
vranyj1
parents:
diff changeset
   258
    JavaTestsResource new setUp.
857
98433a9afe3f JavaTestsLoader: loadMauve: now returns collection of loaded classes
vranyj1
parents: 852
diff changeset
   259
    classes := OrderedCollection new.
1026
5badd1d31864 introduced JavaClassRegistry, taken loading responsibilities from JavaClassReader, got rid of stringConstants and started using StringRefs.. Bugs very likely :)
hlopkmar
parents: 898
diff changeset
   260
    directories do: [
5badd1d31864 introduced JavaClassRegistry, taken loading responsibilities from JavaClassReader, got rid of stringConstants and started using StringRefs.. Bugs very likely :)
hlopkmar
parents: 898
diff changeset
   261
        :each | 
5badd1d31864 introduced JavaClassRegistry, taken loading responsibilities from JavaClassReader, got rid of stringConstants and started using StringRefs.. Bugs very likely :)
hlopkmar
parents: 898
diff changeset
   262
        each asFilename exists ifTrue: [
5badd1d31864 introduced JavaClassRegistry, taken loading responsibilities from JavaClassReader, got rid of stringConstants and started using StringRefs.. Bugs very likely :)
hlopkmar
parents: 898
diff changeset
   263
            classes addAll: (Java javaRegistry loadClassesIn: each matching: pattern)
5badd1d31864 introduced JavaClassRegistry, taken loading responsibilities from JavaClassReader, got rid of stringConstants and started using StringRefs.. Bugs very likely :)
hlopkmar
parents: 898
diff changeset
   264
        ]
5badd1d31864 introduced JavaClassRegistry, taken loading responsibilities from JavaClassReader, got rid of stringConstants and started using StringRefs.. Bugs very likely :)
hlopkmar
parents: 898
diff changeset
   265
    ].
5badd1d31864 introduced JavaClassRegistry, taken loading responsibilities from JavaClassReader, got rid of stringConstants and started using StringRefs.. Bugs very likely :)
hlopkmar
parents: 898
diff changeset
   266
    ^ classes
763
1e82b558abd3 Few fixes toward new repository layout
vranyj1
parents:
diff changeset
   267
848
b06ee9c295d9 Utility methods to load relevant subset of Mauve test suite
vranyj1
parents: 829
diff changeset
   268
    "Created: / 11-06-2011 / 16:05:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
857
98433a9afe3f JavaTestsLoader: loadMauve: now returns collection of loaded classes
vranyj1
parents: 852
diff changeset
   269
    "Modified: / 20-06-2011 / 19:02:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
763
1e82b558abd3 Few fixes toward new repository layout
vranyj1
parents:
diff changeset
   270
! !
1e82b558abd3 Few fixes toward new repository layout
vranyj1
parents:
diff changeset
   271
1e82b558abd3 Few fixes toward new repository layout
vranyj1
parents:
diff changeset
   272
!JavaTestsLoader class methodsFor:'documentation'!
1e82b558abd3 Few fixes toward new repository layout
vranyj1
parents:
diff changeset
   273
1e82b558abd3 Few fixes toward new repository layout
vranyj1
parents:
diff changeset
   274
version_SVN
1e82b558abd3 Few fixes toward new repository layout
vranyj1
parents:
diff changeset
   275
    ^ '$Id$'
1e82b558abd3 Few fixes toward new repository layout
vranyj1
parents:
diff changeset
   276
! !