packages/PackageTestCases.st
author Claus Gittinger <cg@exept.de>
Sun, 07 Jul 2019 23:42:57 +0200
changeset 4453 5e6ad8c5a97e
parent 1445 b8cc2792ab97
child 3011 1997ff6e7e55
permissions -rw-r--r--
#FEATURE by cg class: AbstractSourceCodeManager class added: #revisionLogOfFile:fromRevision:toRevision: #revisionLogOfFile:fromRevision:toRevision:finishAfter: #revisionLogOfFile:numberOfRevisions: comment/format in: #revisionLogOf:fromRevision:toRevision:numberOfRevisions:fileName:directory:module: #revisionLogOf:numberOfRevisions:fileName:directory:module:
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1445
b8cc2792ab97 copyright
Claus Gittinger <cg@exept.de>
parents: 1273
diff changeset
     1
"
b8cc2792ab97 copyright
Claus Gittinger <cg@exept.de>
parents: 1273
diff changeset
     2
 COPYRIGHT (c) 2003 by eXept Software AG
b8cc2792ab97 copyright
Claus Gittinger <cg@exept.de>
parents: 1273
diff changeset
     3
              All Rights Reserved
b8cc2792ab97 copyright
Claus Gittinger <cg@exept.de>
parents: 1273
diff changeset
     4
b8cc2792ab97 copyright
Claus Gittinger <cg@exept.de>
parents: 1273
diff changeset
     5
 This software is furnished under a license and may be used
b8cc2792ab97 copyright
Claus Gittinger <cg@exept.de>
parents: 1273
diff changeset
     6
 only in accordance with the terms of that license and with the
b8cc2792ab97 copyright
Claus Gittinger <cg@exept.de>
parents: 1273
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
b8cc2792ab97 copyright
Claus Gittinger <cg@exept.de>
parents: 1273
diff changeset
     8
 be provided or otherwise made available to, or used by, any
b8cc2792ab97 copyright
Claus Gittinger <cg@exept.de>
parents: 1273
diff changeset
     9
 other person.  No title to or ownership of the software is
b8cc2792ab97 copyright
Claus Gittinger <cg@exept.de>
parents: 1273
diff changeset
    10
 hereby transferred.
b8cc2792ab97 copyright
Claus Gittinger <cg@exept.de>
parents: 1273
diff changeset
    11
"
b8cc2792ab97 copyright
Claus Gittinger <cg@exept.de>
parents: 1273
diff changeset
    12
1226
adff4760750f initial checkin
james
parents:
diff changeset
    13
"{ Package: 'stx:libbasic3' }"
adff4760750f initial checkin
james
parents:
diff changeset
    14
adff4760750f initial checkin
james
parents:
diff changeset
    15
"{ NameSpace: Packages }"
adff4760750f initial checkin
james
parents:
diff changeset
    16
adff4760750f initial checkin
james
parents:
diff changeset
    17
AbstractTestCases subclass:#PackageTestCases
1268
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
    18
	instanceVariableNames:'packageManager workingPackage'
1226
adff4760750f initial checkin
james
parents:
diff changeset
    19
	classVariableNames:''
adff4760750f initial checkin
james
parents:
diff changeset
    20
	poolDictionaries:''
adff4760750f initial checkin
james
parents:
diff changeset
    21
	category:'Package'
adff4760750f initial checkin
james
parents:
diff changeset
    22
!
adff4760750f initial checkin
james
parents:
diff changeset
    23
adff4760750f initial checkin
james
parents:
diff changeset
    24
!PackageTestCases class methodsFor:'documentation'!
adff4760750f initial checkin
james
parents:
diff changeset
    25
1445
b8cc2792ab97 copyright
Claus Gittinger <cg@exept.de>
parents: 1273
diff changeset
    26
copyright
b8cc2792ab97 copyright
Claus Gittinger <cg@exept.de>
parents: 1273
diff changeset
    27
"
b8cc2792ab97 copyright
Claus Gittinger <cg@exept.de>
parents: 1273
diff changeset
    28
 COPYRIGHT (c) 2003 by eXept Software AG
b8cc2792ab97 copyright
Claus Gittinger <cg@exept.de>
parents: 1273
diff changeset
    29
              All Rights Reserved
b8cc2792ab97 copyright
Claus Gittinger <cg@exept.de>
parents: 1273
diff changeset
    30
b8cc2792ab97 copyright
Claus Gittinger <cg@exept.de>
parents: 1273
diff changeset
    31
 This software is furnished under a license and may be used
b8cc2792ab97 copyright
Claus Gittinger <cg@exept.de>
parents: 1273
diff changeset
    32
 only in accordance with the terms of that license and with the
b8cc2792ab97 copyright
Claus Gittinger <cg@exept.de>
parents: 1273
diff changeset
    33
 inclusion of the above copyright notice.   This software may not
b8cc2792ab97 copyright
Claus Gittinger <cg@exept.de>
parents: 1273
diff changeset
    34
 be provided or otherwise made available to, or used by, any
b8cc2792ab97 copyright
Claus Gittinger <cg@exept.de>
parents: 1273
diff changeset
    35
 other person.  No title to or ownership of the software is
b8cc2792ab97 copyright
Claus Gittinger <cg@exept.de>
parents: 1273
diff changeset
    36
 hereby transferred.
b8cc2792ab97 copyright
Claus Gittinger <cg@exept.de>
parents: 1273
diff changeset
    37
"
b8cc2792ab97 copyright
Claus Gittinger <cg@exept.de>
parents: 1273
diff changeset
    38
!
b8cc2792ab97 copyright
Claus Gittinger <cg@exept.de>
parents: 1273
diff changeset
    39
1226
adff4760750f initial checkin
james
parents:
diff changeset
    40
documentation
adff4760750f initial checkin
james
parents:
diff changeset
    41
"
adff4760750f initial checkin
james
parents:
diff changeset
    42
    documentation to be added.
adff4760750f initial checkin
james
parents:
diff changeset
    43
adff4760750f initial checkin
james
parents:
diff changeset
    44
    [author:]
adff4760750f initial checkin
james
parents:
diff changeset
    45
         (james@miraculix)
adff4760750f initial checkin
james
parents:
diff changeset
    46
adff4760750f initial checkin
james
parents:
diff changeset
    47
    [instance variables:]
adff4760750f initial checkin
james
parents:
diff changeset
    48
adff4760750f initial checkin
james
parents:
diff changeset
    49
    [class variables:]
adff4760750f initial checkin
james
parents:
diff changeset
    50
adff4760750f initial checkin
james
parents:
diff changeset
    51
    [see also:]
adff4760750f initial checkin
james
parents:
diff changeset
    52
adff4760750f initial checkin
james
parents:
diff changeset
    53
"
adff4760750f initial checkin
james
parents:
diff changeset
    54
!
adff4760750f initial checkin
james
parents:
diff changeset
    55
adff4760750f initial checkin
james
parents:
diff changeset
    56
history
adff4760750f initial checkin
james
parents:
diff changeset
    57
    "Created: / 24.1.2003 / 16:15:21 / james"
adff4760750f initial checkin
james
parents:
diff changeset
    58
! !
adff4760750f initial checkin
james
parents:
diff changeset
    59
adff4760750f initial checkin
james
parents:
diff changeset
    60
!PackageTestCases methodsFor:'initialize / release'!
adff4760750f initial checkin
james
parents:
diff changeset
    61
1268
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
    62
initialize
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
    63
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
    64
    packageManager ifNil:[
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
    65
        packageManager := self packageManager.
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
    66
    ].
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
    67
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
    68
    workingPackage ifNil:[
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
    69
        workingPackage := packageManager workingPackage.
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
    70
    ].
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
    71
!
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
    72
1226
adff4760750f initial checkin
james
parents:
diff changeset
    73
setUp
adff4760750f initial checkin
james
parents:
diff changeset
    74
    "common setup - invoked before testing"
1273
daaf2c5c4b6a *** empty log message ***
james
parents: 1268
diff changeset
    75
    super setUp.
1268
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
    76
    self setUpUsedClasses.
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
    77
!
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
    78
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
    79
setUpAllForQWERTY
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
    80
    | class copyQWERTYDic|
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
    81
    
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
    82
    (class := Smalltalk at:#QWERTY) ifNil:[
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
    83
        self createClassNamed:#QWERTY. 
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
    84
        (class := Smalltalk at:#QWERTY).
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
    85
    ].
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
    86
    (class compiledMethodAt:#aDummyMethod) ifNil:[
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
    87
        self createMethodFor:QWERTY source:'aDummyMethod 1 + 1.'.
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
    88
    ].
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
    89
    (class compiledMethodAt:#aDummyMethod2) ifNil:[
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
    90
        self createMethodFor:QWERTY source:'aDummyMethod2 1 + 1.'.
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
    91
    ].
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
    92
    (class compiledMethodAt:#aDummyMethod3) ifNil:[
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
    93
        self createMethodFor:QWERTY source:'aDummyMethod3 1 + 1.'.
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
    94
    ].
1273
daaf2c5c4b6a *** empty log message ***
james
parents: 1268
diff changeset
    95
daaf2c5c4b6a *** empty log message ***
james
parents: 1268
diff changeset
    96
    copyQWERTYDic := QWERTY methodDictionary copy.
daaf2c5c4b6a *** empty log message ***
james
parents: 1268
diff changeset
    97
    copyQWERTYDic removeKey:#aDummyMethod.
daaf2c5c4b6a *** empty log message ***
james
parents: 1268
diff changeset
    98
    copyQWERTYDic removeKey:#aDummyMethod2.
daaf2c5c4b6a *** empty log message ***
james
parents: 1268
diff changeset
    99
    copyQWERTYDic removeKey:#aDummyMethod3.
daaf2c5c4b6a *** empty log message ***
james
parents: 1268
diff changeset
   100
    copyQWERTYDic keysAndValuesDo:[:key :value |
daaf2c5c4b6a *** empty log message ***
james
parents: 1268
diff changeset
   101
       QWERTY methodDictionary removeKey:key.
daaf2c5c4b6a *** empty log message ***
james
parents: 1268
diff changeset
   102
    ].
daaf2c5c4b6a *** empty log message ***
james
parents: 1268
diff changeset
   103
daaf2c5c4b6a *** empty log message ***
james
parents: 1268
diff changeset
   104
1268
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   105
    packageManager moveClass:QWERTY toPackage:workingPackage.
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   106
    packageManager moveMethod:(class compiledMethodAt:#aDummyMethod) toPackage:workingPackage.
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   107
    packageManager moveMethod:(class compiledMethodAt:#aDummyMethod2) toPackage:workingPackage.
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   108
    packageManager moveMethod:(class compiledMethodAt:#aDummyMethod3) toPackage:workingPackage.
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   109
!
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   110
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   111
setUpAllForQWERTZ
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   112
    | class copyQWERTZDic|
1226
adff4760750f initial checkin
james
parents:
diff changeset
   113
    (class := Smalltalk at:#QWERTZ) ifNil:[
adff4760750f initial checkin
james
parents:
diff changeset
   114
        self createClassNamed:#QWERTZ.
1268
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   115
        (class := Smalltalk at:#QWERTZ)
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   116
    ].
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   117
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   118
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   119
    (class compiledMethodAt:#aDummyMethod) ifNil:[
1226
adff4760750f initial checkin
james
parents:
diff changeset
   120
        self createMethodFor:QWERTZ source:'aDummyMethod 1 + 1.'.
1268
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   121
    ].
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   122
    (class compiledMethodAt:#aDummyMethod2) ifNil:[
1226
adff4760750f initial checkin
james
parents:
diff changeset
   123
        self createMethodFor:QWERTZ source:'aDummyMethod2 1 + 1.'.
1268
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   124
    ].
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   125
    (class compiledMethodAt:#aDummyMethod3) ifNil:[
1226
adff4760750f initial checkin
james
parents:
diff changeset
   126
        self createMethodFor:QWERTZ source:'aDummyMethod3 1 + 1.'.
adff4760750f initial checkin
james
parents:
diff changeset
   127
    ].
adff4760750f initial checkin
james
parents:
diff changeset
   128
1268
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   129
    copyQWERTZDic := QWERTZ methodDictionary copy.
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   130
    copyQWERTZDic removeKey:#aDummyMethod.
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   131
    copyQWERTZDic removeKey:#aDummyMethod2.
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   132
    copyQWERTZDic removeKey:#aDummyMethod3.
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   133
    copyQWERTZDic keysAndValuesDo:[:key :value |
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   134
       QWERTZ methodDictionary removeKey:key.
1226
adff4760750f initial checkin
james
parents:
diff changeset
   135
    ].
1268
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   136
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   137
    packageManager moveClass:QWERTZ toPackage:workingPackage.
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   138
    packageManager moveMethod:(class compiledMethodAt:#aDummyMethod) toPackage:workingPackage.
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   139
    packageManager moveMethod:(class compiledMethodAt:#aDummyMethod2) toPackage:workingPackage.
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   140
    packageManager moveMethod:(class compiledMethodAt:#aDummyMethod3) toPackage:workingPackage.
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   141
!
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   142
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   143
setUpUsedClasses
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   144
    "common setup - invoked before testing"
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   145
    |  |
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   146
    self setUpAllForQWERTZ.
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   147
    self setUpAllForQWERTY.                
1226
adff4760750f initial checkin
james
parents:
diff changeset
   148
!
adff4760750f initial checkin
james
parents:
diff changeset
   149
adff4760750f initial checkin
james
parents:
diff changeset
   150
tearDown
adff4760750f initial checkin
james
parents:
diff changeset
   151
    "common cleanup - invoked after testing"
adff4760750f initial checkin
james
parents:
diff changeset
   152
1268
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   153
    "move class package to where it was"
1226
adff4760750f initial checkin
james
parents:
diff changeset
   154
    super tearDown
adff4760750f initial checkin
james
parents:
diff changeset
   155
! !
adff4760750f initial checkin
james
parents:
diff changeset
   156
adff4760750f initial checkin
james
parents:
diff changeset
   157
!PackageTestCases methodsFor:'test - accessing'!
adff4760750f initial checkin
james
parents:
diff changeset
   158
adff4760750f initial checkin
james
parents:
diff changeset
   159
test_classNames
1268
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   160
    | packageTestCases |
1226
adff4760750f initial checkin
james
parents:
diff changeset
   161
    [
1268
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   162
        packageTestCases := packageManager newPackageNamed:#'packageTestCases'.
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   163
        packageManager moveClass:QWERTZ toPackage:packageTestCases.
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   164
        packageManager moveClass:QWERTY toPackage:packageTestCases.
1226
adff4760750f initial checkin
james
parents:
diff changeset
   165
1268
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   166
        self assert:(packageTestCases classNames includesAll:#(#QWERTZ #QWERTY)).
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   167
        self assert:(packageTestCases isDirty).
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   168
    ] ensure:
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   169
    [
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   170
        packageTestCases ifNotNil:[
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   171
            packageManager removePackage:packageTestCases.
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   172
        ].
1226
adff4760750f initial checkin
james
parents:
diff changeset
   173
    ]
adff4760750f initial checkin
james
parents:
diff changeset
   174
!
adff4760750f initial checkin
james
parents:
diff changeset
   175
adff4760750f initial checkin
james
parents:
diff changeset
   176
test_isDirty
1268
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   177
    | packageTestCases |
1226
adff4760750f initial checkin
james
parents:
diff changeset
   178
    [
1268
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   179
        packageTestCases := packageManager newPackageNamed:#'packageTestCases'.
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   180
        packageManager moveClass:QWERTZ toPackage:packageTestCases.
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   181
        self assert:(packageTestCases isDirty).
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   182
    ] ensure:
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   183
    [
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   184
        packageTestCases ifNotNil:[
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   185
            packageManager removePackage:packageTestCases.
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   186
        ].
1226
adff4760750f initial checkin
james
parents:
diff changeset
   187
    ]
adff4760750f initial checkin
james
parents:
diff changeset
   188
! !
adff4760750f initial checkin
james
parents:
diff changeset
   189
adff4760750f initial checkin
james
parents:
diff changeset
   190
!PackageTestCases methodsFor:'test - adding and removing'!
adff4760750f initial checkin
james
parents:
diff changeset
   191
1268
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   192
test_addMethod
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   193
    | packageTestCases |
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   194
1226
adff4760750f initial checkin
james
parents:
diff changeset
   195
    [
1268
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   196
        "setting up the test"
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   197
        packageTestCases := packageManager newPackageNamed:#'packageTestCases'.
1226
adff4760750f initial checkin
james
parents:
diff changeset
   198
1268
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   199
        packageManager moveClass:QWERTZ toPackage:packageTestCases.
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   200
        packageTestCases isDirty:false.   "i am telling it a fib here "
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   201
        "prerequisites to test"
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   202
        self assert:((packageTestCases blockedMethodsAtClassNamed:#QWERTZ) size == 0).
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   203
        self shouldnt:(packageTestCases isDirty).
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   204
        self assert:(packageTestCases isInstalled).
1226
adff4760750f initial checkin
james
parents:
diff changeset
   205
1268
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   206
        "add a method for QWERTZ and test that the package adds a blocked method, as
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   207
        the method is from the workingPackage "
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   208
        self createMethodFor:QWERTZ source:'aDummyMethodTest_test_addMethod2 1 + 1.'.   
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   209
        self assert:((packageTestCases blockedMethodsAtClassNamed:#QWERTZ) size == 1).
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   210
        self assert:(packageTestCases isInstalled).
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   211
        self shouldnt:(packageTestCases isDirty).
1226
adff4760750f initial checkin
james
parents:
diff changeset
   212
1268
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   213
        self assert:(QWERTZ compiledMethodAt:#aDummyMethodTest_test_addMethod2) package == workingPackage name.
1226
adff4760750f initial checkin
james
parents:
diff changeset
   214
1268
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   215
    ] ensure:
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   216
    [
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   217
        packageTestCases ifNotNil:[
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   218
            packageManager removePackage:packageTestCases.
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   219
        ].
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   220
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   221
        QWERTZ methodDictionary removeKey:#aDummyMethodTest_test_addMethod2 ifAbsent:["do nothing"].
1226
adff4760750f initial checkin
james
parents:
diff changeset
   222
    ]
adff4760750f initial checkin
james
parents:
diff changeset
   223
!
adff4760750f initial checkin
james
parents:
diff changeset
   224
adff4760750f initial checkin
james
parents:
diff changeset
   225
test_addMethod2
1268
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   226
    "
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   227
    check that when a method is added to a new package and then added back to the old package
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   228
    that 
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   229
    1) the oldPackage has got the method and has not got any overriddenMethods
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   230
    2) the 'newPackage' has got the method registered as an overriddenMethod
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   231
    "
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   232
    | packageTestCases packageTestCases2 aMethodToOverride|
1226
adff4760750f initial checkin
james
parents:
diff changeset
   233
adff4760750f initial checkin
james
parents:
diff changeset
   234
    [
1268
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   235
        "setting up the test"
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   236
        packageTestCases := packageManager newPackageNamed:#'packageTestCases'.
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   237
        packageTestCases2 := packageManager newPackageNamed:#'packageTestCases2'.
1226
adff4760750f initial checkin
james
parents:
diff changeset
   238
1268
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   239
        packageManager moveClass:QWERTZ toPackage:packageTestCases.
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   240
        packageTestCases isDirty:false.   "i am telling it a fib here "
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   241
        "prerequisites to test"
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   242
        self shouldnt:(packageTestCases isDirty).
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   243
        aMethodToOverride :=  QWERTZ methodDictionary values first.
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   244
        "add a method for QWERTZ and test that the package adds a blocked method, as
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   245
        the method is from the workingPackage "
1226
adff4760750f initial checkin
james
parents:
diff changeset
   246
1268
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   247
        packageManager addMethod:aMethodToOverride toPackage:packageTestCases2.
1226
adff4760750f initial checkin
james
parents:
diff changeset
   248
1268
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   249
       "Tests for packageTestCases"
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   250
        self assert:(packageTestCases overriddenChangesIncludesMethodName:aMethodToOverride name forClassNamed:#QWERTZ).
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   251
        self shouldnt:(packageTestCases isDirty).  "it is overridden not dirty"
1226
adff4760750f initial checkin
james
parents:
diff changeset
   252
1268
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   253
        "Tests for packageTestCases2"
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   254
        self assert:(packageTestCases2 definesSelector:aMethodToOverride name forClassNamed:#QWERTZ).
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   255
        self assert:(packageTestCases2 isDirty).  "was not there before so is dirty!!"
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   256
        self shouldnt:(packageTestCases2 overriddenChangesIncludesMethodName:aMethodToOverride name forClassNamed:#QWERTZ).
1226
adff4760750f initial checkin
james
parents:
diff changeset
   257
1268
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   258
        packageManager addMethod:aMethodToOverride toPackage:packageTestCases.
1226
adff4760750f initial checkin
james
parents:
diff changeset
   259
1268
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   260
       "Tests for packageTestCases"
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   261
        self assert:(packageTestCases isDirty).  "a new version of the method is added!!"
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   262
        self shouldnt:(packageTestCases overriddenChangesIncludesMethodName:aMethodToOverride name forClassNamed:#QWERTZ).
1226
adff4760750f initial checkin
james
parents:
diff changeset
   263
1268
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   264
        "Tests for packageTestCases2"
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   265
        self assert:(packageTestCases2 overriddenChangesIncludesMethodName:aMethodToOverride name forClassNamed:#QWERTZ).
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   266
        self assert:(packageTestCases2 isDirty).
1226
adff4760750f initial checkin
james
parents:
diff changeset
   267
1268
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   268
    ] ensure:
1226
adff4760750f initial checkin
james
parents:
diff changeset
   269
    [
1268
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   270
        packageTestCases ifNotNil:[
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   271
            packageManager removePackage:packageTestCases.
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   272
        ].
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   273
        packageTestCases ifNotNil:[
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   274
            packageManager removePackage:packageTestCases2.
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   275
        ].
1226
adff4760750f initial checkin
james
parents:
diff changeset
   276
1268
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   277
        QWERTZ methodDictionary removeKey:#aDummyMethodTest_test_addMethod2 ifAbsent:["do nothing"].
1226
adff4760750f initial checkin
james
parents:
diff changeset
   278
    ]
adff4760750f initial checkin
james
parents:
diff changeset
   279
!
adff4760750f initial checkin
james
parents:
diff changeset
   280
1268
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   281
test_moveMethod
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   282
    | packageTestCases method1 method2|
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   283
    "prerequisites to test"
1226
adff4760750f initial checkin
james
parents:
diff changeset
   284
adff4760750f initial checkin
james
parents:
diff changeset
   285
    [
1268
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   286
        packageTestCases := packageManager newPackageNamed:#'packageTestCases'.
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   287
        method1 := (QWERTZ compiledMethodAt:#aDummyMethod).
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   288
        method2 := (QWERTZ compiledMethodAt:#aDummyMethod2).
1226
adff4760750f initial checkin
james
parents:
diff changeset
   289
1268
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   290
        self shouldnt:(packageTestCases isDirty).
1226
adff4760750f initial checkin
james
parents:
diff changeset
   291
1268
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   292
        packageManager moveMethod:method1 toPackage:packageTestCases.
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   293
        packageManager moveMethod:method2 toPackage:packageTestCases.
1226
adff4760750f initial checkin
james
parents:
diff changeset
   294
1268
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   295
        self assert:(packageTestCases isDirty).
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   296
        self assert:(packageTestCases isInstalled).
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   297
        self assert:(packageTestCases definesSelector:method1 name forClassNamed:method1 mclass name).
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   298
        self assert:(packageTestCases definesSelector:method2 name forClassNamed:method2 mclass name).
1226
adff4760750f initial checkin
james
parents:
diff changeset
   299
1268
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   300
    ] ensure:
1226
adff4760750f initial checkin
james
parents:
diff changeset
   301
    [
1268
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   302
        packageTestCases ifNotNil:[
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   303
            packageManager removePackage:packageTestCases.
1226
adff4760750f initial checkin
james
parents:
diff changeset
   304
        ].
adff4760750f initial checkin
james
parents:
diff changeset
   305
    ]
adff4760750f initial checkin
james
parents:
diff changeset
   306
!
adff4760750f initial checkin
james
parents:
diff changeset
   307
1268
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   308
test_packagedClass_isInSmalltalk
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   309
    | package1 package2|
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   310
    "prerequisites to test"
1226
adff4760750f initial checkin
james
parents:
diff changeset
   311
1268
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   312
    [
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   313
        package1 := Package packageManager newPackageNamed:#'package1'.
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   314
        package2 := Package packageManager newPackageNamed:#'package2'. 
1226
adff4760750f initial checkin
james
parents:
diff changeset
   315
1268
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   316
        packageManager moveClassNamed:#QWERTZ fromPackage:workingPackage toPackage:package1.
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   317
        self assert:(package1 packagedClassNamed:#QWERTZ) isInSmalltalk.
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   318
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   319
        packageManager addClass:QWERTZ toPackage:package2.
1226
adff4760750f initial checkin
james
parents:
diff changeset
   320
1268
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   321
        self assert:(package2 packagedClassNamed:#QWERTZ) isInSmalltalk.
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   322
        self shouldnt:(package1 packagedClassNamed:#QWERTZ) isInSmalltalk.
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   323
        
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   324
        (package2 packagedClassNamed:#QWERTZ) .
1226
adff4760750f initial checkin
james
parents:
diff changeset
   325
1268
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   326
    ] ensure:
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   327
    [
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   328
        package1 ifNotNil:[
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   329
            packageManager unloadPackageNamed:#'package1'.
1226
adff4760750f initial checkin
james
parents:
diff changeset
   330
        ].
1268
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   331
        package2 ifNotNil:[
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   332
            packageManager unloadPackageNamed:#'package2'.
1226
adff4760750f initial checkin
james
parents:
diff changeset
   333
        ].
adff4760750f initial checkin
james
parents:
diff changeset
   334
    ]
adff4760750f initial checkin
james
parents:
diff changeset
   335
! !
adff4760750f initial checkin
james
parents:
diff changeset
   336
1268
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   337
!PackageTestCases methodsFor:'test - moving'!
1226
adff4760750f initial checkin
james
parents:
diff changeset
   338
1268
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   339
obsolete_test_moveMethod1
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   340
    "moving classes via change notification is now deprecated as i found it best to try and seperate
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   341
    the functionality on Smalltalk and the functionality of package handling.
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   342
    "
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   343
    "Move QWERTZ class from package1 to package 2. Then move the class back."
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   344
    | package1 package2 aName  theMethod methodOwnedClass|
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   345
    [
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   346
        package1 :=  packageManager newPackageNamed:#'package1'.
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   347
        package2 :=  packageManager newPackageNamed:#'package2'.
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   348
        theMethod :=(QWERTZ compiledMethodAt:#'aDummyMethod').
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   349
        methodOwnedClass := QWERTZ.
1226
adff4760750f initial checkin
james
parents:
diff changeset
   350
1268
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   351
        packageManager addMethod:theMethod toPackage:package1.
1226
adff4760750f initial checkin
james
parents:
diff changeset
   352
1268
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   353
        self assert:(package1 definesSelector:#'aDummyMethod' forClassNamed:#QWERTZ).
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   354
        self shouldnt:(package2 definesSelector:#'aDummyMethod' forClassNamed:#QWERTZ).
1226
adff4760750f initial checkin
james
parents:
diff changeset
   355
1268
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   356
        self assert:(package1 isDirty).
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   357
        self shouldnt:(package2 isDirty).
1226
adff4760750f initial checkin
james
parents:
diff changeset
   358
1268
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   359
        "<simulatedChangeInBrowser>"
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   360
            "This change always moves the method away from the classes current owner"
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   361
            self assert:(aName := theMethod package) == package1 name.
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   362
            theMethod setPackage:package2 name.
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   363
            ChangeFaker methodMovePackageChangeWithMethod:theMethod class:methodOwnedClass oldPackageName:aName.
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   364
        "</simulatedChangeInBrowser>"
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   365
        self assert:(package1 definesSelector:#'aDummyMethod' forClassNamed:#QWERTZ).
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   366
        self assert:(package2 definesSelector:#'aDummyMethod' forClassNamed:#QWERTZ).
1226
adff4760750f initial checkin
james
parents:
diff changeset
   367
1268
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   368
        self assert:(package2 packagedMethodNamed:#'aDummyMethod' forClassNamed:#QWERTZ) isInSmalltalk.      
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   369
        self shouldnt:(package1 packagedMethodNamed:#'aDummyMethod' forClassNamed:#QWERTZ) isInSmalltalk.     
1226
adff4760750f initial checkin
james
parents:
diff changeset
   370
1268
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   371
        self assert:(package2 isDependentOnMethodNamed:#'aDummyMethod' forClassNamed:#QWERTZ).     
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   372
        self shouldnt:(package1 isDependentOnMethodNamed:#'aDummyMethod' forClassNamed:#QWERTZ).       
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   373
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   374
        self assert:(package2 isDirty).
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   375
        self assert:(package1 isDirty).
1226
adff4760750f initial checkin
james
parents:
diff changeset
   376
1268
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   377
        "<simulatedChangeInBrowser>"
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   378
            "This change always moves the method away from the classes current owner"
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   379
            self assert:(aName := theMethod package) == package2 name.
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   380
            theMethod setPackage:package1 name.
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   381
            ChangeFaker methodMovePackageChangeWithMethod:theMethod class:methodOwnedClass oldPackageName:aName.
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   382
        "</simulatedChangeInBrowser>"
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   383
        self assert:(package1 isDependentOnMethodNamed:#'aDummyMethod' forClassNamed:#QWERTZ).     
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   384
        self shouldnt:(package2 isDependentOnMethodNamed:#'aDummyMethod' forClassNamed:#QWERTZ).       
1226
adff4760750f initial checkin
james
parents:
diff changeset
   385
1268
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   386
        self shouldnt:(package2 packagedMethodNamed:#'aDummyMethod' forClassNamed:#QWERTZ) isInSmalltalk.      
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   387
        self assert:(package1 packagedMethodNamed:#'aDummyMethod' forClassNamed:#QWERTZ) isInSmalltalk.
1226
adff4760750f initial checkin
james
parents:
diff changeset
   388
1268
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   389
        self assert:(package2 isDirty).
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   390
        self assert:(package1 isDirty).
1226
adff4760750f initial checkin
james
parents:
diff changeset
   391
1268
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   392
        packageManager addClass:QWERTZ toPackage:defaultPackage.
1226
adff4760750f initial checkin
james
parents:
diff changeset
   393
    ] ensure:[
1268
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   394
        packageManager unloadPackageNamed:#'package1'.
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   395
        packageManager unloadPackageNamed:#'package2'.
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1243
diff changeset
   396
    ].
1226
adff4760750f initial checkin
james
parents:
diff changeset
   397
! !
adff4760750f initial checkin
james
parents:
diff changeset
   398
adff4760750f initial checkin
james
parents:
diff changeset
   399
!PackageTestCases class methodsFor:'documentation'!
adff4760750f initial checkin
james
parents:
diff changeset
   400
adff4760750f initial checkin
james
parents:
diff changeset
   401
version
1445
b8cc2792ab97 copyright
Claus Gittinger <cg@exept.de>
parents: 1273
diff changeset
   402
    ^ '$Header: /cvs/stx/stx/libbasic3/packages/PackageTestCases.st,v 1.5 2006-01-10 09:31:48 cg Exp $'
1226
adff4760750f initial checkin
james
parents:
diff changeset
   403
! !