JavaTestsLoader.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Fri, 25 Jan 2013 00:15:51 +0000
branchrefactoring-classpath
changeset 2000 13a10b73aa83
parent 1864 60a8dc26c8c6
child 1987 596f7d5cb7cd
permissions -rw-r--r--
Closing branch refactoring-classpath
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
1152
040cba55a7d2 Copyright fixes
vranyj1
parents: 1075
diff changeset
     3
1155
vranyj1
parents: 1152
diff changeset
     4
 New code and modifications done at SWING Research Group [1]:
1152
040cba55a7d2 Copyright fixes
vranyj1
parents: 1075
diff changeset
     5
877
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
     6
 COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
     7
                            SWING Research Group, Czech Technical University in Prague
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
1155
vranyj1
parents: 1152
diff changeset
    16
 [1] Code written at SWING Research Group contains a signature
vranyj1
parents: 1152
diff changeset
    17
     of one of the above copright owners. For exact set of such code,
vranyj1
parents: 1152
diff changeset
    18
     see the differences between this version and version stx:libjava
1152
040cba55a7d2 Copyright fixes
vranyj1
parents: 1075
diff changeset
    19
     as of 1.9.2010
877
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
    20
"
763
1e82b558abd3 Few fixes toward new repository layout
vranyj1
parents:
diff changeset
    21
"{ Package: 'stx:libjava' }"
1e82b558abd3 Few fixes toward new repository layout
vranyj1
parents:
diff changeset
    22
1e82b558abd3 Few fixes toward new repository layout
vranyj1
parents:
diff changeset
    23
Object subclass:#JavaTestsLoader
1e82b558abd3 Few fixes toward new repository layout
vranyj1
parents:
diff changeset
    24
	instanceVariableNames:''
1e82b558abd3 Few fixes toward new repository layout
vranyj1
parents:
diff changeset
    25
	classVariableNames:''
1e82b558abd3 Few fixes toward new repository layout
vranyj1
parents:
diff changeset
    26
	poolDictionaries:''
1e82b558abd3 Few fixes toward new repository layout
vranyj1
parents:
diff changeset
    27
	category:'Languages-Java-Tests'
1e82b558abd3 Few fixes toward new repository layout
vranyj1
parents:
diff changeset
    28
!
1e82b558abd3 Few fixes toward new repository layout
vranyj1
parents:
diff changeset
    29
877
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
    30
!JavaTestsLoader class methodsFor:'documentation'!
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
    31
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
    32
copyright
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
    33
"
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
    34
 COPYRIGHT (c) 1996-2011 by Claus Gittinger
1152
040cba55a7d2 Copyright fixes
vranyj1
parents: 1075
diff changeset
    35
1155
vranyj1
parents: 1152
diff changeset
    36
 New code and modifications done at SWING Research Group [1]:
1152
040cba55a7d2 Copyright fixes
vranyj1
parents: 1075
diff changeset
    37
877
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
    38
 COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
    39
                            SWING Research Group, Czech Technical University in Prague
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
    40
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
    41
 This software is furnished under a license and may be used
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
    42
 only in accordance with the terms of that license and with the
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
    43
 inclusion of the above copyright notice.   This software may not
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
    44
 be provided or otherwise made available to, or used by, any
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
    45
 other person.  No title to or ownership of the software is
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
    46
 hereby transferred.
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
    47
1155
vranyj1
parents: 1152
diff changeset
    48
 [1] Code written at SWING Research Group contains a signature
vranyj1
parents: 1152
diff changeset
    49
     of one of the above copright owners. For exact set of such code,
vranyj1
parents: 1152
diff changeset
    50
     see the differences between this version and version stx:libjava
1152
040cba55a7d2 Copyright fixes
vranyj1
parents: 1075
diff changeset
    51
     as of 1.9.2010
877
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
    52
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
    53
"
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 867
diff changeset
    54
! !
763
1e82b558abd3 Few fixes toward new repository layout
vranyj1
parents:
diff changeset
    55
860
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
    56
!JavaTestsLoader class methodsFor:'accessing'!
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
    57
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
    58
buildSuiteForLibjava
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
    59
1433
cc7b8e8cd814 Fixes for Mauve tests
vranyj1
parents: 1432
diff changeset
    60
    ^(self buildSuiteFrom: (self loadLibjava)) name: 'stx:libjava Test Suite'
860
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
    61
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
    62
    "
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
    63
        JavaTestsLoader buildSuiteForLibjava
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
    64
    "
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
    65
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
    66
    "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
    67
!
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
    68
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
    69
buildSuiteForMauve
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
    70
1433
cc7b8e8cd814 Fixes for Mauve tests
vranyj1
parents: 1432
diff changeset
    71
    ^(self buildSuiteFrom: (self loadMauve)) name: 'Mauve Test Suite'
860
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
    72
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
    73
    "
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
    74
        JavaTestsLoader buildSuiteForMauve
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
    75
    "
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
    76
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
    77
    "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
    78
!
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
    79
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
    80
buildSuiteForMauveToFix
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
    81
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
    82
    ^self buildSuiteFrom: 
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
    83
        (self loadMauveToFix)
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
    84
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
    85
    "
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
    86
        JavaTestsLoader buildSuiteForMauveToFix
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
    87
    "
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
    88
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
    89
    "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
    90
! !
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
    91
763
1e82b558abd3 Few fixes toward new repository layout
vranyj1
parents:
diff changeset
    92
!JavaTestsLoader class methodsFor:'loading'!
1e82b558abd3 Few fixes toward new repository layout
vranyj1
parents:
diff changeset
    93
1e82b558abd3 Few fixes toward new repository layout
vranyj1
parents:
diff changeset
    94
load
867
vranyj1
parents: 860
diff changeset
    95
    JavaTestsResource build.
848
b06ee9c295d9 Utility methods to load relevant subset of Mauve test suite
vranyj1
parents: 829
diff changeset
    96
    self loadIn:JavaTestsResource classpath
763
1e82b558abd3 Few fixes toward new repository layout
vranyj1
parents:
diff changeset
    97
1e82b558abd3 Few fixes toward new repository layout
vranyj1
parents:
diff changeset
    98
    "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
    99
!
1e82b558abd3 Few fixes toward new repository layout
vranyj1
parents:
diff changeset
   100
848
b06ee9c295d9 Utility methods to load relevant subset of Mauve test suite
vranyj1
parents: 829
diff changeset
   101
load:testdir 
b06ee9c295d9 Utility methods to load relevant subset of Mauve test suite
vranyj1
parents: 829
diff changeset
   102
    |base dirs|
763
1e82b558abd3 Few fixes toward new repository layout
vranyj1
parents:
diff changeset
   103
848
b06ee9c295d9 Utility methods to load relevant subset of Mauve test suite
vranyj1
parents: 829
diff changeset
   104
    base := (UserPreferences current javaTestsDirectory asFilename / testdir) 
b06ee9c295d9 Utility methods to load relevant subset of Mauve test suite
vranyj1
parents: 829
diff changeset
   105
                pathName.
b06ee9c295d9 Utility methods to load relevant subset of Mauve test suite
vranyj1
parents: 829
diff changeset
   106
    dirs := JavaTestsResource classpath 
b06ee9c295d9 Utility methods to load relevant subset of Mauve test suite
vranyj1
parents: 829
diff changeset
   107
                select:[:each | each startsWith:base ].
b06ee9c295d9 Utility methods to load relevant subset of Mauve test suite
vranyj1
parents: 829
diff changeset
   108
    self loadIn:dirs.
763
1e82b558abd3 Few fixes toward new repository layout
vranyj1
parents:
diff changeset
   109
1e82b558abd3 Few fixes toward new repository layout
vranyj1
parents:
diff changeset
   110
    "
848
b06ee9c295d9 Utility methods to load relevant subset of Mauve test suite
vranyj1
parents: 829
diff changeset
   111
        JavaTestsLoader load: 'libjava'"
b06ee9c295d9 Utility methods to load relevant subset of Mauve test suite
vranyj1
parents: 829
diff changeset
   112
    "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
   113
! !
b06ee9c295d9 Utility methods to load relevant subset of Mauve test suite
vranyj1
parents: 829
diff changeset
   114
b06ee9c295d9 Utility methods to load relevant subset of Mauve test suite
vranyj1
parents: 829
diff changeset
   115
!JavaTestsLoader class methodsFor:'loading - test suites'!
b06ee9c295d9 Utility methods to load relevant subset of Mauve test suite
vranyj1
parents: 829
diff changeset
   116
860
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   117
loadLibjava
1075
927aeb3649fc Fix in native method imp -> class loading java tests all pass.. I'm getting drunk tonight :)
hlopkmar
parents: 1033
diff changeset
   118
    | cp |
860
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   119
    JavaTestsResource new setUp.
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   120
    cp := JavaTestsResource classpathForLibjava.
1075
927aeb3649fc Fix in native method imp -> class loading java tests all pass.. I'm getting drunk tonight :)
hlopkmar
parents: 1033
diff changeset
   121
    ^ self loadIn: cp
860
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   122
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   123
    "Created: / 21-06-2011 / 17:35:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1075
927aeb3649fc Fix in native method imp -> class loading java tests all pass.. I'm getting drunk tonight :)
hlopkmar
parents: 1033
diff changeset
   124
    "Modified (format): / 03-11-2011 / 10:17:12 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
860
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   125
!
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   126
848
b06ee9c295d9 Utility methods to load relevant subset of Mauve test suite
vranyj1
parents: 829
diff changeset
   127
loadMauve
b06ee9c295d9 Utility methods to load relevant subset of Mauve test suite
vranyj1
parents: 829
diff changeset
   128
    |cp|
b06ee9c295d9 Utility methods to load relevant subset of Mauve test suite
vranyj1
parents: 829
diff changeset
   129
b06ee9c295d9 Utility methods to load relevant subset of Mauve test suite
vranyj1
parents: 829
diff changeset
   130
    JavaTestsResource new setUp.
b06ee9c295d9 Utility methods to load relevant subset of Mauve test suite
vranyj1
parents: 829
diff changeset
   131
    cp := JavaTestsResource classpathForMauve.
b06ee9c295d9 Utility methods to load relevant subset of Mauve test suite
vranyj1
parents: 829
diff changeset
   132
    ^self loadIn: cp
b06ee9c295d9 Utility methods to load relevant subset of Mauve test suite
vranyj1
parents: 829
diff changeset
   133
b06ee9c295d9 Utility methods to load relevant subset of Mauve test suite
vranyj1
parents: 829
diff changeset
   134
    "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
   135
!
b06ee9c295d9 Utility methods to load relevant subset of Mauve test suite
vranyj1
parents: 829
diff changeset
   136
852
37bd4bf93eb6 added JavaTestsLoader>>loadMauve: pattern utility method
vranyj1
parents: 849
diff changeset
   137
loadMauve: pattern
37bd4bf93eb6 added JavaTestsLoader>>loadMauve: pattern utility method
vranyj1
parents: 849
diff changeset
   138
    |cp|
37bd4bf93eb6 added JavaTestsLoader>>loadMauve: pattern utility method
vranyj1
parents: 849
diff changeset
   139
37bd4bf93eb6 added JavaTestsLoader>>loadMauve: pattern utility method
vranyj1
parents: 849
diff changeset
   140
    JavaTestsResource new setUp.
37bd4bf93eb6 added JavaTestsLoader>>loadMauve: pattern utility method
vranyj1
parents: 849
diff changeset
   141
    cp := JavaTestsResource classpathForMauve.
857
98433a9afe3f JavaTestsLoader: loadMauve: now returns collection of loaded classes
vranyj1
parents: 852
diff changeset
   142
    ^self loadIn: cp matching: pattern.
852
37bd4bf93eb6 added JavaTestsLoader>>loadMauve: pattern utility method
vranyj1
parents: 849
diff changeset
   143
37bd4bf93eb6 added JavaTestsLoader>>loadMauve: pattern utility method
vranyj1
parents: 849
diff changeset
   144
    "
37bd4bf93eb6 added JavaTestsLoader>>loadMauve: pattern utility method
vranyj1
parents: 849
diff changeset
   145
        JavaTestsLoader loadMauve:'gnu.testlet.java.lang.String.*'
37bd4bf93eb6 added JavaTestsLoader>>loadMauve: pattern utility method
vranyj1
parents: 849
diff changeset
   146
    "
37bd4bf93eb6 added JavaTestsLoader>>loadMauve: pattern utility method
vranyj1
parents: 849
diff changeset
   147
37bd4bf93eb6 added JavaTestsLoader>>loadMauve: pattern utility method
vranyj1
parents: 849
diff changeset
   148
    "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
   149
    "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
   150
!
37bd4bf93eb6 added JavaTestsLoader>>loadMauve: pattern utility method
vranyj1
parents: 849
diff changeset
   151
848
b06ee9c295d9 Utility methods to load relevant subset of Mauve test suite
vranyj1
parents: 829
diff changeset
   152
loadMauveToFix
b06ee9c295d9 Utility methods to load relevant subset of Mauve test suite
vranyj1
parents: 829
diff changeset
   153
    |cp|
b06ee9c295d9 Utility methods to load relevant subset of Mauve test suite
vranyj1
parents: 829
diff changeset
   154
b06ee9c295d9 Utility methods to load relevant subset of Mauve test suite
vranyj1
parents: 829
diff changeset
   155
    JavaTestsResource new setUp.
b06ee9c295d9 Utility methods to load relevant subset of Mauve test suite
vranyj1
parents: 829
diff changeset
   156
    cp := JavaTestsResource classpathForMauve.
b06ee9c295d9 Utility methods to load relevant subset of Mauve test suite
vranyj1
parents: 829
diff changeset
   157
    self 
849
0addf2406912 Fixes for Mauve test suite
vranyj1
parents: 848
diff changeset
   158
        loadIn: cp matching:'gnu.testlet.java.lang.*';
0addf2406912 Fixes for Mauve test suite
vranyj1
parents: 848
diff changeset
   159
        loadIn: cp matching:'gnu.testlet.java.lang.reflect.*';
898
94eb1038a323 - add native to close InputFileStream
vranyj1
parents: 877
diff changeset
   160
        loadIn: cp matching:'gnu.testlet.java.util.*';
94eb1038a323 - add native to close InputFileStream
vranyj1
parents: 877
diff changeset
   161
        loadIn: cp matching:'gnu.testlet.java.io.*';
94eb1038a323 - add native to close InputFileStream
vranyj1
parents: 877
diff changeset
   162
        loadIn: cp matching:'gnu.testlet.java.nio.*'.
848
b06ee9c295d9 Utility methods to load relevant subset of Mauve test suite
vranyj1
parents: 829
diff changeset
   163
b06ee9c295d9 Utility methods to load relevant subset of Mauve test suite
vranyj1
parents: 829
diff changeset
   164
    "
b06ee9c295d9 Utility methods to load relevant subset of Mauve test suite
vranyj1
parents: 829
diff changeset
   165
        JavaTestsLoader loadMauveToFix    
763
1e82b558abd3 Few fixes toward new repository layout
vranyj1
parents:
diff changeset
   166
    "
1e82b558abd3 Few fixes toward new repository layout
vranyj1
parents:
diff changeset
   167
848
b06ee9c295d9 Utility methods to load relevant subset of Mauve test suite
vranyj1
parents: 829
diff changeset
   168
    "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
   169
! !
1e82b558abd3 Few fixes toward new repository layout
vranyj1
parents:
diff changeset
   170
1e82b558abd3 Few fixes toward new repository layout
vranyj1
parents:
diff changeset
   171
!JavaTestsLoader class methodsFor:'private'!
1e82b558abd3 Few fixes toward new repository layout
vranyj1
parents:
diff changeset
   172
860
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   173
buildSuiteFrom: classes
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   174
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   175
    | javaTestCases suite |
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   176
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   177
    javaTestCases := OrderedCollection new.
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   178
    suite := TestSuite new.
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   179
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   180
    classes do:
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   181
        [:jclass|
1545
1ded666190e2 - Try to cleanup on too many files open error
vranyj1
parents: 1492
diff changeset
   182
        ((self ignoredTestCaseNames includes: jclass name) not
1ded666190e2 - Try to cleanup on too many files open error
vranyj1
parents: 1492
diff changeset
   183
                and:[jclass isTestCaseLike])
860
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   184
                    ifTrue:
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   185
                        [ | tc |
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   186
                        tc := jclass asTestCase.
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   187
                                                (tc askFor:#isTestlet) ifTrue:[
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   188
                                                        tc shouldFork: true.
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   189
                                                ].
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   190
                        tc isAbstract ifFalse:[javaTestCases add:tc ]]].
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   191
1492
f653ab710551 - JavaTestsLoader
vranyj1
parents: 1433
diff changeset
   192
    javaTestCases sort:[:a :b| a name < b name ].
f653ab710551 - JavaTestsLoader
vranyj1
parents: 1433
diff changeset
   193
860
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   194
    javaTestCases do:
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   195
                [:each | 
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   196
                suite addTests:each buildSuite tests ].
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   197
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   198
    ^suite
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   199
1545
1ded666190e2 - Try to cleanup on too many files open error
vranyj1
parents: 1492
diff changeset
   200
    "Modified: / 23-07-2012 / 20:12:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1ded666190e2 - Try to cleanup on too many files open error
vranyj1
parents: 1492
diff changeset
   201
!
1ded666190e2 - Try to cleanup on too many files open error
vranyj1
parents: 1492
diff changeset
   202
1ded666190e2 - Try to cleanup on too many files open error
vranyj1
parents: 1492
diff changeset
   203
ignoredTestCaseNames
1ded666190e2 - Try to cleanup on too many files open error
vranyj1
parents: 1492
diff changeset
   204
    "Return an array of java slashed class names to be ignored when
1ded666190e2 - Try to cleanup on too many files open error
vranyj1
parents: 1492
diff changeset
   205
     building testsuite"
1ded666190e2 - Try to cleanup on too many files open error
vranyj1
parents: 1492
diff changeset
   206
1ded666190e2 - Try to cleanup on too many files open error
vranyj1
parents: 1492
diff changeset
   207
    ^#(
1ded666190e2 - Try to cleanup on too many files open error
vranyj1
parents: 1492
diff changeset
   208
        #'stx/libjava/tests/JUnit3Tests'
1ded666190e2 - Try to cleanup on too many files open error
vranyj1
parents: 1492
diff changeset
   209
        #'stx/libjava/tests/JUnit4Tests'
1ded666190e2 - Try to cleanup on too many files open error
vranyj1
parents: 1492
diff changeset
   210
1ded666190e2 - Try to cleanup on too many files open error
vranyj1
parents: 1492
diff changeset
   211
        "Fails because of broken finalization, ignore for now.."
1ded666190e2 - Try to cleanup on too many files open error
vranyj1
parents: 1492
diff changeset
   212
        #'gnu/testlet/java/nio/channels/FileChannel/manyopen'
1ded666190e2 - Try to cleanup on too many files open error
vranyj1
parents: 1492
diff changeset
   213
    )
1ded666190e2 - Try to cleanup on too many files open error
vranyj1
parents: 1492
diff changeset
   214
1ded666190e2 - Try to cleanup on too many files open error
vranyj1
parents: 1492
diff changeset
   215
    "Created: / 23-07-2012 / 20:06:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
860
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   216
!
7c3f4b090534 More utility methods for tests
vranyj1
parents: 857
diff changeset
   217
763
1e82b558abd3 Few fixes toward new repository layout
vranyj1
parents:
diff changeset
   218
loadIn: directories
1e82b558abd3 Few fixes toward new repository layout
vranyj1
parents:
diff changeset
   219
848
b06ee9c295d9 Utility methods to load relevant subset of Mauve test suite
vranyj1
parents: 829
diff changeset
   220
    ^self loadIn: directories matching: '*'
b06ee9c295d9 Utility methods to load relevant subset of Mauve test suite
vranyj1
parents: 829
diff changeset
   221
b06ee9c295d9 Utility methods to load relevant subset of Mauve test suite
vranyj1
parents: 829
diff changeset
   222
    "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
   223
!
b06ee9c295d9 Utility methods to load relevant subset of Mauve test suite
vranyj1
parents: 829
diff changeset
   224
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
   225
loadIn: directories matching: pattern 
857
98433a9afe3f JavaTestsLoader: loadMauve: now returns collection of loaded classes
vranyj1
parents: 852
diff changeset
   226
    | 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
   227
5badd1d31864 introduced JavaClassRegistry, taken loading responsibilities from JavaClassReader, got rid of stringConstants and started using StringRefs.. Bugs very likely :)
hlopkmar
parents: 898
diff changeset
   228
    JavaInitializedResource new setUp.
763
1e82b558abd3 Few fixes toward new repository layout
vranyj1
parents:
diff changeset
   229
    JavaLibrariesResource new setUp.
1e82b558abd3 Few fixes toward new repository layout
vranyj1
parents:
diff changeset
   230
    JavaTestsResource new setUp.
857
98433a9afe3f JavaTestsLoader: loadMauve: now returns collection of loaded classes
vranyj1
parents: 852
diff changeset
   231
    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
   232
    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
   233
        :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
   234
        each asFilename exists ifTrue: [
1033
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1026
diff changeset
   235
            classes addAll: (JavaVM loadClassesIn: each matching: pattern)
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
   236
        ]
5badd1d31864 introduced JavaClassRegistry, taken loading responsibilities from JavaClassReader, got rid of stringConstants and started using StringRefs.. Bugs very likely :)
hlopkmar
parents: 898
diff changeset
   237
    ].
5badd1d31864 introduced JavaClassRegistry, taken loading responsibilities from JavaClassReader, got rid of stringConstants and started using StringRefs.. Bugs very likely :)
hlopkmar
parents: 898
diff changeset
   238
    ^ classes
763
1e82b558abd3 Few fixes toward new repository layout
vranyj1
parents:
diff changeset
   239
848
b06ee9c295d9 Utility methods to load relevant subset of Mauve test suite
vranyj1
parents: 829
diff changeset
   240
    "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
   241
    "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
   242
! !
1e82b558abd3 Few fixes toward new repository layout
vranyj1
parents:
diff changeset
   243
1e82b558abd3 Few fixes toward new repository layout
vranyj1
parents:
diff changeset
   244
!JavaTestsLoader class methodsFor:'documentation'!
1e82b558abd3 Few fixes toward new repository layout
vranyj1
parents:
diff changeset
   245
1864
60a8dc26c8c6 Updated from HG
vranyj1
parents: 1818
diff changeset
   246
version_HG
60a8dc26c8c6 Updated from HG
vranyj1
parents: 1818
diff changeset
   247
60a8dc26c8c6 Updated from HG
vranyj1
parents: 1818
diff changeset
   248
    ^ '$Changeset: <not expanded> $'
60a8dc26c8c6 Updated from HG
vranyj1
parents: 1818
diff changeset
   249
!
60a8dc26c8c6 Updated from HG
vranyj1
parents: 1818
diff changeset
   250
763
1e82b558abd3 Few fixes toward new repository layout
vranyj1
parents:
diff changeset
   251
version_SVN
1864
60a8dc26c8c6 Updated from HG
vranyj1
parents: 1818
diff changeset
   252
    ^ '§Id§'
763
1e82b558abd3 Few fixes toward new repository layout
vranyj1
parents:
diff changeset
   253
! !