test/MCSnapshotBrowserTest.st
author HG Automerge
Thu, 24 Nov 2016 21:56:31 +0000
branchjv
changeset 1015 7b6393ea3d52
parent 822 509715fb5cf5
child 1121 c5661215109c
permissions -rw-r--r--
Merge
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
24
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     1
"{ Package: 'stx:goodies/monticello/test' }"
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     2
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     3
MCTestCase subclass:#MCSnapshotBrowserTest
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     4
	instanceVariableNames:'model morph'
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     5
	classVariableNames:''
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     6
	poolDictionaries:''
822
509715fb5cf5 Tests moved to category SCM-Monticello-Tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 24
diff changeset
     7
	category:'SCM-Monticello-Tests'
24
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     8
!
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     9
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    10
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    11
!MCSnapshotBrowserTest class methodsFor:'as yet unclassified'!
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    12
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    13
resources
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    14
	^ Array with: MCSnapshotResource
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    15
! !
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    16
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    17
!MCSnapshotBrowserTest methodsFor:'asserting'!
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    19
assertAListIncludes: anArrayOfStrings
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
	self listMorphs 
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
			detect: [:m | m getList includesAllOf: anArrayOfStrings]
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
			ifNone: [self assert: false].
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    23
!
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    24
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    25
assertAListMatches: strings
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    26
	| listMorphs list |
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    27
	listMorphs _ self listMorphs.
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    28
	listMorphs 
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    29
		detect: [:m | list _ m getList. (list size = strings size) and: [list includesAllOf: strings]]
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    30
		ifNone: [self assert: false].
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    31
!
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    32
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    33
assertButtonExists: aString
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    34
	self buttonMorphs detect: [:m | m label = aString] ifNone: [self assert: false].
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    35
				
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    36
!
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    37
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    38
assertButtonOn: aString
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    39
	self assert: (self findButtonWithLabel: aString) getModelState.
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    40
	
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    41
!
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    42
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    43
assertTextIs: aString
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    44
	self assert: self textMorph contents = aString.
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    45
!
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    46
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    47
denyAListHasSelection: aString
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    48
	| found |
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    49
	found _ true.
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
	self listMorphs 
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    51
			detect: [:m | m selection = aString]
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    52
			ifNone: [found _ false].
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    53
	self deny: found.
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    54
!
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    55
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    56
denyAListIncludesAnyOf: anArrayOfStrings
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    57
	| found |
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    58
	found _ true.
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    59
	self listMorphs 
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    60
			detect: [:m | m getList includesAnyOf: anArrayOfStrings]
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    61
			ifNone: [found _ false].
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    62
	self deny: found.
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    63
!
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    64
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    65
denyButtonOn: aString
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    66
	self deny: (self findButtonWithLabel: aString) getModelState.
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    67
	
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    68
! !
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    69
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    70
!MCSnapshotBrowserTest methodsFor:'morphic'!
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    71
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    72
annotationTextMorph
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    73
	^ (self morphsOfClass: TextMorph) first
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    74
!
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    75
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    76
buttonMorphs
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    77
	^ self morphsOfClass: PluggableButtonMorph
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    78
!
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    79
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    80
findButtonWithLabel: aString
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    81
	^ self buttonMorphs detect: [:m | m label = aString]
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    82
!
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    83
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    84
findListContaining: aString
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    85
	^ self listMorphs detect: [:m | m getList includes: aString]
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    86
!
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    87
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    88
listMorphs
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    89
	^ self morphsOfClass: PluggableListMorph
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    90
!
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    91
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    92
morphsOfClass: aMorphClass
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    93
	| morphs |
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    94
	morphs _ OrderedCollection new.
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    95
	morph allMorphsDo: [:m | (m isKindOf: aMorphClass) ifTrue: [morphs add: m]].
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    96
	^ morphs
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    97
!
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    98
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    99
textMorph
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   100
	^ (self morphsOfClass: TextMorph) last
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   101
! !
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   102
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   103
!MCSnapshotBrowserTest methodsFor:'private'!
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   104
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   105
allCategories
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   106
	^ Array with: model extensionsCategory with: self mockCategoryName.
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   107
!
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   108
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   109
allMethods
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   110
	^ MCSnapshotResource current definitions
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   111
		select: [:def | def isMethodDefinition]
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   112
		thenCollect: [:def | def selector]		
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   113
!
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   114
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   115
allProtocols
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   116
	^ MCSnapshotResource current definitions
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   117
		select: [:def | def isMethodDefinition]
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   118
		thenCollect: [:def | def category]		
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   119
!
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   120
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   121
classABooleanMethods
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   122
	^ #(falsehood moreTruth truth)
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   123
!
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   124
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   125
classAClassProtocols
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   126
	^ self protocolsForClass: self mockClassA class.
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   127
!
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   128
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   129
classAComment
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   130
	^ self mockClassA organization classComment.
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   131
!
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   132
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   133
classADefinitionString
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   134
	^ self mockClassA definition
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   135
!
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   136
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   137
classAProtocols
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   138
	^ self protocolsForClass: self mockClassA.
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   139
!
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   140
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   141
definedClasses
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   142
	^ MCSnapshotResource current definitions 
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   143
		select: [:def | def isClassDefinition] 
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   144
		thenCollect: [:def | def className].
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   145
!
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   146
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   147
falsehoodMethodSource
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   148
	^ 'falsehood
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   149
	^ false'
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   150
!
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   151
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   152
protocolsForClass: aClass
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   153
	| protocols |
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   154
	protocols _ aClass organization categories.
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   155
	protocols size > 1 ifTrue: [protocols _ protocols copyWith: '-- all --'].
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   156
	^ protocols.
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   157
! !
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   158
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   159
!MCSnapshotBrowserTest methodsFor:'running'!
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   160
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   161
setUp
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   162
	model _ MCSnapshotBrowser forSnapshot: MCSnapshotResource current snapshot.
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   163
	morph _ model buildWindow.
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   164
! !
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   165
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   166
!MCSnapshotBrowserTest methodsFor:'selecting'!
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   167
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   168
selectMockClassA
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   169
	self clickOnListItem: self mockCategoryName.
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   170
	self clickOnListItem: 'MCMockClassA'.
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   171
	
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   172
! !
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   173
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   174
!MCSnapshotBrowserTest methodsFor:'simulating'!
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   175
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   176
clickOnButton: aString
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   177
	(self findButtonWithLabel: aString) performAction.
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   178
!
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   179
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   180
clickOnListItem: aString
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   181
	| listMorph |
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   182
	listMorph _ self findListContaining: aString.
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   183
	listMorph changeModelSelection: (listMorph getList indexOf: aString).
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   184
! !
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   185
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   186
!MCSnapshotBrowserTest methodsFor:'testing'!
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   187
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   188
testAnnotationPane
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   189
	| oldPref |
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   190
	oldPref _ Preferences annotationPanes.
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   191
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   192
	Preferences disable: #annotationPanes.
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   193
	morph _ model buildWindow.
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   194
	self assert: (self morphsOfClass: TextMorph) size = 1.
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   195
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   196
	Preferences enable: #annotationPanes.
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   197
	morph _ model buildWindow.
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   198
	self assert: (self morphsOfClass: TextMorph) size = 2.
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   199
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   200
	Preferences setPreference: #annotationPanes toValue: oldPref
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   201
!
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   202
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   203
testButtonMutex
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   204
	self assertButtonOn: 'instance'.
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   205
	self denyButtonOn: '?'.
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   206
	self denyButtonOn: 'class'.
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   207
	
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   208
	self clickOnButton: '?'.
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   209
	self assertButtonOn: '?'.
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   210
	self denyButtonOn: 'instance'.
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   211
	self denyButtonOn: 'class'.
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   212
	
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   213
	self clickOnButton: 'class'.
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   214
	self assertButtonOn: 'class'.
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   215
	self denyButtonOn: '?'.
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   216
	self denyButtonOn: 'instance'.
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   217
!
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   218
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   219
testCategorySelected
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   220
	self clickOnListItem: self mockCategoryName.
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   221
	
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   222
	self assertAListMatches: self allCategories.
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   223
	self assertAListMatches: self definedClasses.
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   224
	self denyAListIncludesAnyOf: self allProtocols.
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   225
	self denyAListIncludesAnyOf: self allMethods.
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   226
	self assertTextIs: ''.
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   227
!
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   228
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   229
testClassSelected
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   230
	self selectMockClassA.
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   231
	
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   232
	self assertAListMatches: self allCategories.
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   233
	self assertAListMatches: self definedClasses.
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   234
	self assertAListMatches: self classAProtocols.
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   235
	self denyAListIncludesAnyOf: self allMethods.
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   236
	self assertTextIs: self classADefinitionString.
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   237
!
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   238
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   239
testClassSideClassSelected
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   240
	self clickOnButton: 'class'.
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   241
	self selectMockClassA.
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   242
	
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   243
	self assertAListMatches: self allCategories.
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   244
	self assertAListMatches: self definedClasses.
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   245
	self assertAListMatches: self classAClassProtocols.
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   246
	self denyAListIncludesAnyOf: self allMethods.
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   247
	self assertTextIs: self classADefinitionString.
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   248
!
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   249
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   250
testComment
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   251
	self clickOnButton: '?'.
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   252
	self assertTextIs: ''.
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   253
	
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   254
	self clickOnListItem: self mockCategoryName.
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   255
	self assertTextIs: ''.
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   256
	
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   257
	self clickOnListItem: 'MCMockClassA'.
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   258
	self assertTextIs: self classAComment.
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   259
!
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   260
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   261
testFourColumns
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   262
	self assert: self listMorphs size = 4.
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   263
!
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   264
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   265
testMethodIsCleared
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   266
	self clickOnListItem: self mockCategoryName.
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   267
	self clickOnListItem: 'MCMockClassA'.
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   268
	self clickOnListItem: 'boolean'.
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   269
	self clickOnListItem: 'falsehood'.
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   270
	self clickOnListItem: '-- all --'.
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   271
	
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   272
	self denyAListHasSelection: 'falsehood'.
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   273
!
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   274
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   275
testMethodSelected
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   276
	self clickOnListItem: self mockCategoryName.
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   277
	self clickOnListItem: 'MCMockClassA'.
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   278
	self clickOnListItem: 'boolean'.
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   279
	self clickOnListItem: 'falsehood'.
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   280
	
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   281
	self assertAListMatches: self allCategories.
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   282
	self assertAListMatches: self definedClasses.
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   283
	self assertAListMatches: self classAProtocols.
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   284
	self assertAListMatches: self classABooleanMethods.
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   285
	self assertTextIs: self falsehoodMethodSource.
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   286
!
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   287
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   288
testNoSelection
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   289
	self assertAListMatches: self allCategories.
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   290
	self denyAListIncludesAnyOf: self definedClasses.
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   291
	self denyAListIncludesAnyOf: self allProtocols.
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   292
	self denyAListIncludesAnyOf: self allMethods.
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   293
	self assertTextIs: ''.
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   294
!
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   295
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   296
testProtocolIsCleared
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   297
	self clickOnListItem: self mockCategoryName.
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   298
	self clickOnListItem: 'MCMockASubclass'.
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   299
	self clickOnListItem: 'as yet unclassified'.
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   300
	self clickOnListItem: 'MCMockClassA'.
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   301
	
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   302
	self denyAListHasSelection: 'as yet unclassified'.
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   303
!
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   304
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   305
testProtocolSelected
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   306
	self clickOnListItem: self mockCategoryName.
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   307
	self clickOnListItem: 'MCMockClassA'.
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   308
	self clickOnListItem: 'boolean'.
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   309
	
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   310
	self assertAListMatches: self allCategories.
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   311
	self assertAListMatches: self definedClasses.
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   312
	self assertAListMatches: self classAProtocols.
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   313
	self assertAListMatches: self classABooleanMethods.
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   314
	self assertTextIs: ''.		
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   315
!
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   316
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   317
testTextPane
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   318
	self shouldnt: [self textMorph] raise: Exception.
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   319
!
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   320
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   321
testThreeButtons
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   322
	self assertButtonExists: 'instance'.
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   323
	self assertButtonExists: '?'.
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   324
	self assertButtonExists: 'class'.
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   325
! !
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   326
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   327
!MCSnapshotBrowserTest class methodsFor:'documentation'!
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   328
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   329
version
822
509715fb5cf5 Tests moved to category SCM-Monticello-Tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 24
diff changeset
   330
    ^ '$Header: /cvs/stx/stx/goodies/monticello/test/MCSnapshotBrowserTest.st,v 1.2 2013-05-29 00:02:19 vrany Exp $'
24
f42fd4d26694 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   331
! !
822
509715fb5cf5 Tests moved to category SCM-Monticello-Tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 24
diff changeset
   332