author | Claus Gittinger <cg@exept.de> |
Tue, 08 May 2018 19:58:20 +0200 | |
changeset 1043 | aeecdb5610e4 |
parent 821 | c9d0cfc35fab |
child 1121 | c5661215109c |
permissions | -rw-r--r-- |
15 | 1 |
"{ Package: 'stx:goodies/monticello/test' }" |
2 |
||
3 |
MCTestCase subclass:#MCRepositoryTest |
|
4 |
instanceVariableNames:'repository ancestors' |
|
5 |
classVariableNames:'' |
|
6 |
poolDictionaries:'' |
|
821
c9d0cfc35fab
Tests moved to category SCM-Monticello-Tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
148
diff
changeset
|
7 |
category:'SCM-Monticello-Tests' |
15 | 8 |
! |
9 |
||
10 |
||
11 |
!MCRepositoryTest class methodsFor:'as yet unclassified'! |
|
12 |
||
13 |
isAbstract |
|
148
b465b9b2da45
more porting (but still unfinished)
Claus Gittinger <cg@exept.de>
parents:
15
diff
changeset
|
14 |
^ self = MCRepositoryTest |
15 | 15 |
! ! |
16 |
||
17 |
!MCRepositoryTest methodsFor:'accessing'! |
|
18 |
||
19 |
snapshotAt: aVersionInfo |
|
20 |
^ (repository versionWithInfo: aVersionInfo) snapshot |
|
21 |
! ! |
|
22 |
||
23 |
!MCRepositoryTest methodsFor:'actions'! |
|
24 |
||
25 |
addVersion: aVersion |
|
26 |
self subclassResponsibility |
|
27 |
! |
|
28 |
||
29 |
addVersionWithSnapshot: aSnapshot name: aString |
|
30 |
| version | |
|
31 |
version _ self versionWithSnapshot: aSnapshot name: aString. |
|
32 |
self addVersion: version. |
|
33 |
^ version info |
|
34 |
! |
|
35 |
||
36 |
saveSnapshot1 |
|
37 |
^ self saveSnapshot: self snapshot1 named: 'rev1' |
|
38 |
! |
|
39 |
||
40 |
saveSnapshot2 |
|
41 |
^ self saveSnapshot: self snapshot2 named: 'rev2' |
|
42 |
! |
|
43 |
||
44 |
saveSnapshot: aSnapshot named: aString |
|
45 |
| version | |
|
46 |
version _ self versionWithSnapshot: aSnapshot name: aString. |
|
47 |
repository storeVersion: version. |
|
48 |
^ version info |
|
49 |
||
50 |
! ! |
|
51 |
||
52 |
!MCRepositoryTest methodsFor:'asserting'! |
|
53 |
||
54 |
assertMissing: aVersionInfo |
|
55 |
self assert: (repository versionWithInfo: aVersionInfo) isNil |
|
56 |
! |
|
57 |
||
58 |
assertVersionInfos: aCollection |
|
59 |
self assert: repository allVersionInfos asSet = aCollection asSet |
|
60 |
! ! |
|
61 |
||
62 |
!MCRepositoryTest methodsFor:'building'! |
|
63 |
||
64 |
snapshot1 |
|
65 |
^ (MCSnapshot fromDefinitions: (Array with: (MCOrganizationDefinition categories: #('y')))) |
|
66 |
! |
|
67 |
||
68 |
snapshot2 |
|
69 |
^ (MCSnapshot fromDefinitions: (Array with: (MCOrganizationDefinition categories: #('x')))) |
|
70 |
! |
|
71 |
||
72 |
versionWithSnapshot: aSnapshot name: aString |
|
73 |
| info | |
|
74 |
info _ self mockVersionInfo: aString. |
|
75 |
^ MCVersion |
|
76 |
package: (MCPackage new name: aString) |
|
77 |
info: info |
|
78 |
snapshot: aSnapshot |
|
79 |
! ! |
|
80 |
||
81 |
!MCRepositoryTest methodsFor:'tests'! |
|
82 |
||
83 |
testAddAndLoad |
|
84 |
| node | |
|
85 |
node _ self addVersionWithSnapshot: self snapshot1 name: 'rev1'. |
|
86 |
self assert: (self snapshotAt: node) = self snapshot1. |
|
87 |
! |
|
88 |
||
89 |
testIncludesName |
|
90 |
self deny: (repository includesVersionNamed: 'MonticelloTest-xxx.1-rev1'). |
|
91 |
self saveSnapshot1. |
|
92 |
self assert: (repository includesVersionNamed: 'MonticelloTest-xxx.1-rev1'). |
|
93 |
self deny: (repository includesVersionNamed: 'MonticelloTest-xxx.1-rev2'). |
|
94 |
self saveSnapshot2. |
|
95 |
self assert: (repository includesVersionNamed: 'MonticelloTest-xxx.1-rev2'). |
|
96 |
! |
|
97 |
||
98 |
testLoadMissingNode |
|
99 |
| node | |
|
100 |
node _ MCVersionInfo new. |
|
101 |
self assertMissing: node |
|
102 |
! |
|
103 |
||
104 |
testStoreAndLoad |
|
105 |
| node node2 | |
|
106 |
node _ self saveSnapshot1. |
|
107 |
node2 _ self saveSnapshot2. |
|
108 |
self assert: (self snapshotAt: node) = self snapshot1. |
|
109 |
self assert: (self snapshotAt: node2) = self snapshot2. |
|
110 |
! ! |
|
111 |
||
112 |
!MCRepositoryTest class methodsFor:'documentation'! |
|
113 |
||
114 |
version |
|
821
c9d0cfc35fab
Tests moved to category SCM-Monticello-Tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
148
diff
changeset
|
115 |
^ '$Header: /cvs/stx/stx/goodies/monticello/test/MCRepositoryTest.st,v 1.3 2013-05-29 00:02:12 vrany Exp $' |
148
b465b9b2da45
more porting (but still unfinished)
Claus Gittinger <cg@exept.de>
parents:
15
diff
changeset
|
116 |
! |
b465b9b2da45
more porting (but still unfinished)
Claus Gittinger <cg@exept.de>
parents:
15
diff
changeset
|
117 |
|
b465b9b2da45
more porting (but still unfinished)
Claus Gittinger <cg@exept.de>
parents:
15
diff
changeset
|
118 |
version_CVS |
821
c9d0cfc35fab
Tests moved to category SCM-Monticello-Tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
148
diff
changeset
|
119 |
^ '$Header: /cvs/stx/stx/goodies/monticello/test/MCRepositoryTest.st,v 1.3 2013-05-29 00:02:12 vrany Exp $' |
15 | 120 |
! ! |
821
c9d0cfc35fab
Tests moved to category SCM-Monticello-Tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
148
diff
changeset
|
121 |