author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Thu, 22 Nov 2012 23:58:35 +0000 | |
changeset 95 | 83ee62dc9491 |
parent 93 | 2579830f6b61 |
child 98 | 8982e002d0ab |
permissions | -rw-r--r-- |
69
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
1 |
"{ Package: 'stx:libscm/mercurial' }" |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
2 |
|
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
3 |
HGTestCase subclass:#HGStXTests |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
4 |
instanceVariableNames:'' |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
5 |
classVariableNames:'' |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
6 |
poolDictionaries:'' |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
7 |
category:'SCM-Mercurial-Tests' |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
8 |
! |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
9 |
|
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
10 |
!HGStXTests class methodsFor:'documentation'! |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
11 |
|
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
12 |
documentation |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
13 |
" |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
14 |
Tests for Mercurial-Smalltalk/X integration. Mapping packages |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
15 |
to Mercurial repositories, commitning packages from image |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
16 |
and so on... |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
17 |
|
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
18 |
[author:] |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
19 |
Jan Vrany <jan.vrany@fit.cvut.cz> |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
20 |
|
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
21 |
[instance variables:] |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
22 |
|
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
23 |
[class variables:] |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
24 |
|
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
25 |
[see also:] |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
26 |
|
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
27 |
" |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
28 |
! ! |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
29 |
|
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
30 |
!HGStXTests methodsFor:'running'! |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
31 |
|
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
32 |
loadPackage: packageId |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
33 |
"A utility method to prepare a repository for package |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
34 |
and load package from it" |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
35 |
|
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
36 |
self repositoryNamed: (packageId copyReplaceAll:$: with:$/). |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
37 |
Smalltalk loadPackage: packageId. |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
38 |
|
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
39 |
"Created: / 16-11-2012 / 20:01:09 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
40 |
! |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
41 |
|
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
42 |
tearDown |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
43 |
| classes methods | |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
44 |
super tearDown. |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
45 |
|
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
46 |
"Also, wipe out all mocks" |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
47 |
classes := OrderedCollection new. |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
48 |
methods := OrderedCollection new. |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
49 |
Smalltalk allClassesDo:[:cls| |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
50 |
(cls package notNil and:[cls package startsWith:'mocks']) ifTrue:[ |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
51 |
classes add: cls |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
52 |
] ifFalse:[ |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
53 |
cls methodsDo:[:m|(m package notNil and:[m package startsWith:'mocks']) ifTrue:[methods add: cls]]. |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
54 |
cls class methodsDo:[:m|(m package notNil and:[m package startsWith:'mocks']) ifTrue:[methods add: cls]]. |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
55 |
] |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
56 |
]. |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
57 |
Class withoutUpdatingChangesDo:[ |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
58 |
classes do:[:cls|Smalltalk removeClass: cls]. |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
59 |
methods do:[:m|m mclass removeSelector: m selector] |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
60 |
]. |
93
2579830f6b61
Tests fixed. Not-yet-supported tests marked as skipped.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
91
diff
changeset
|
61 |
"/ Delay waitForSeconds: 1. |
69
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
62 |
|
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
63 |
"Created: / 16-11-2012 / 19:00:24 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
93
2579830f6b61
Tests fixed. Not-yet-supported tests marked as skipped.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
91
diff
changeset
|
64 |
"Modified: / 21-11-2012 / 17:53:17 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
69
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
65 |
! |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
66 |
|
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
67 |
test_infrastructure |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
68 |
" |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
69 |
This is kind of meta-test that tests if the |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
70 |
setUp/tearDown actually works. Especially, if |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
71 |
no mock classes/methods are left in the image |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
72 |
after tearDown. Also, make sure that all |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
73 |
HGPackageModels for mocks |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
74 |
" |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
75 |
| pm | |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
76 |
|
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
77 |
self loadPackage:'mocks:hg/p1'. |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
78 |
|
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
79 |
self assert: (Smalltalk at: #'mocks_hg_p1') notNil. |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
80 |
pm := HGPackageModelRegistry packageNamed:'mocks:hg/p1'. |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
81 |
self assert: pm notNil. |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
82 |
self assert: ((HGPackageModelRegistry current instVarNamed:#packages) includesKey: #'mocks:hg/p1'). |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
83 |
|
95
83ee62dc9491
HGCommand: fixes for Windows.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
93
diff
changeset
|
84 |
pm := nil. |
91 | 85 |
self cleanup. |
69
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
86 |
|
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
87 |
self assert: (Smalltalk at: #'mocks_hg_p1') isNil. |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
88 |
self assert: repositories isNil. |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
89 |
self assert: ((HGPackageModelRegistry current instVarNamed:#packages) includesKey: #'mocks:hg/p1') not. |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
90 |
|
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
91 |
"Created: / 16-11-2012 / 19:25:40 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
91 | 92 |
"Modified: / 20-11-2012 / 19:32:15 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
95
83ee62dc9491
HGCommand: fixes for Windows.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
93
diff
changeset
|
93 |
"Modified: / 22-11-2012 / 15:31:54 / jv" |
69
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
94 |
! ! |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
95 |
|
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
96 |
!HGStXTests methodsFor:'tests - commit'! |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
97 |
|
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
98 |
test_commit_01 |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
99 |
" |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
100 |
Simple commit |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
101 |
" |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
102 |
|
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
103 |
| repo pm ct | |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
104 |
|
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
105 |
repo := self repositoryNamed: 'mocks/hg/p1'. |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
106 |
Smalltalk loadPackage:'mocks:hg/p1'. |
93
2579830f6b61
Tests fixed. Not-yet-supported tests marked as skipped.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
91
diff
changeset
|
107 |
self dumpRepositoryLog: repo. |
2579830f6b61
Tests fixed. Not-yet-supported tests marked as skipped.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
91
diff
changeset
|
108 |
|
69
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
109 |
|
73
eb731ce2685e
Fixed HGStXTests>>test_commit_01
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
71
diff
changeset
|
110 |
self deny: ((repo @ 1 / 'MockHGP1Bar.st') contents asString includesString:'zork ^ 1'). |
69
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
111 |
|
73
eb731ce2685e
Fixed HGStXTests>>test_commit_01
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
71
diff
changeset
|
112 |
(MockHGP1Bar compile:'zork ^ 1' classified:'test') package: MockHGP1Bar package. |
69
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
113 |
pm := HGPackageModel named: 'mocks:hg/p1'. |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
114 |
ct := pm commitTask. |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
115 |
ct message:'test_commit_01'. |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
116 |
ct do. |
93
2579830f6b61
Tests fixed. Not-yet-supported tests marked as skipped.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
91
diff
changeset
|
117 |
self dumpRepositoryLog: repo. |
2579830f6b61
Tests fixed. Not-yet-supported tests marked as skipped.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
91
diff
changeset
|
118 |
|
71
bd4cfb10a262
Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
69
diff
changeset
|
119 |
" |
bd4cfb10a262
Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
69
diff
changeset
|
120 |
repo workingCopy browse |
bd4cfb10a262
Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
69
diff
changeset
|
121 |
" |
73
eb731ce2685e
Fixed HGStXTests>>test_commit_01
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
71
diff
changeset
|
122 |
self assert: ((repo @ 2 / 'MockHGP1Bar.st') contents asString includesString:'zork ^ 1'). |
69
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
123 |
|
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
124 |
"Created: / 16-11-2012 / 18:51:46 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
93
2579830f6b61
Tests fixed. Not-yet-supported tests marked as skipped.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
91
diff
changeset
|
125 |
"Modified: / 22-11-2012 / 11:30:40 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
91 | 126 |
! |
127 |
||
128 |
test_commit_02a |
|
129 |
" |
|
93
2579830f6b61
Tests fixed. Not-yet-supported tests marked as skipped.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
91
diff
changeset
|
130 |
Repeated commit |
91 | 131 |
" |
132 |
||
133 |
| repo pm ct | |
|
134 |
||
135 |
repo := self repositoryNamed: 'mocks/hg/p1'. |
|
136 |
Smalltalk loadPackage:'mocks:hg/p1'. |
|
137 |
pm := HGPackageModel named: 'mocks:hg/p1'. |
|
93
2579830f6b61
Tests fixed. Not-yet-supported tests marked as skipped.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
91
diff
changeset
|
138 |
self dumpRepositoryLog: repo. |
2579830f6b61
Tests fixed. Not-yet-supported tests marked as skipped.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
91
diff
changeset
|
139 |
|
91 | 140 |
(MockHGP1Bar compile:'zork ^ 1' classified:'test') package: MockHGP1Bar package. |
141 |
||
142 |
self deny: ((repo @ 1 / 'MockHGP1Bar.st') contents asString includesString:'zork ^ 1'). |
|
143 |
||
144 |
ct := pm commitTask. |
|
145 |
ct message:'test_commit_02-1'. |
|
146 |
ct do. |
|
93
2579830f6b61
Tests fixed. Not-yet-supported tests marked as skipped.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
91
diff
changeset
|
147 |
self dumpRepositoryLog: repo. |
91 | 148 |
|
149 |
self assert: ((repo @ 2 / 'MockHGP1Bar.st') contents asString includesString:'zork ^ 1'). |
|
150 |
self assert: ((repo @ 2 ) parent1 == (repo @ 1 )). |
|
151 |
||
152 |
(MockHGP1Bar compile:'zork ^ 2' classified:'test') package: MockHGP1Bar package. |
|
153 |
||
154 |
ct := pm commitTask. |
|
155 |
ct message:'test_commit_02-2'. |
|
156 |
ct do. |
|
93
2579830f6b61
Tests fixed. Not-yet-supported tests marked as skipped.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
91
diff
changeset
|
157 |
self dumpRepositoryLog: repo. |
91 | 158 |
|
93
2579830f6b61
Tests fixed. Not-yet-supported tests marked as skipped.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
91
diff
changeset
|
159 |
self assert: (repo @ 3) message = 'test_commit_02-2'. |
91 | 160 |
self assert: ((repo @ 3 / 'MockHGP1Bar.st') contents asString includesString:'zork ^ 2'). |
161 |
self assert: ((repo @ 3 ) parent1 == (repo @ 2 )). |
|
162 |
||
163 |
" |
|
164 |
repo workingCopy browse |
|
165 |
" |
|
166 |
||
167 |
"Created: / 20-11-2012 / 19:33:55 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
93
2579830f6b61
Tests fixed. Not-yet-supported tests marked as skipped.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
91
diff
changeset
|
168 |
"Modified: / 22-11-2012 / 11:12:20 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
91 | 169 |
! |
170 |
||
171 |
test_commit_02b |
|
172 |
" |
|
173 |
Repeated commit, remove the working copy between commits |
|
174 |
" |
|
175 |
||
176 |
| repo pm ct | |
|
177 |
||
178 |
repo := self repositoryNamed: 'mocks/hg/p1'. |
|
179 |
Smalltalk loadPackage:'mocks:hg/p1'. |
|
180 |
pm := HGPackageModel named: 'mocks:hg/p1'. |
|
181 |
(MockHGP1Bar compile:'zork ^ 1' classified:'test') package: MockHGP1Bar package. |
|
182 |
||
183 |
self deny: ((repo @ 1 / 'MockHGP1Bar.st') contents asString includesString:'zork ^ 1'). |
|
184 |
||
185 |
ct := pm commitTask. |
|
186 |
ct message:'test_commit_02-1'. |
|
187 |
ct do. |
|
188 |
||
189 |
self assert: ((repo @ 2 / 'MockHGP1Bar.st') contents asString includesString:'zork ^ 1'). |
|
190 |
self assert: ((repo @ 2 ) parent1 == (repo @ 1 )). |
|
191 |
||
192 |
(MockHGP1Bar compile:'zork ^ 2' classified:'test') package: MockHGP1Bar package. |
|
193 |
pm workingCopy path recursiveRemove. |
|
194 |
||
195 |
ct := pm commitTask. |
|
196 |
ct message:'test_commit_02-2'. |
|
197 |
ct do. |
|
198 |
||
199 |
self assert: ((repo @ 3 / 'MockHGP1Bar.st') contents asString includesString:'zork ^ 2'). |
|
200 |
self assert: ((repo @ 3 ) parent1 == (repo @ 2 )). |
|
201 |
||
202 |
" |
|
203 |
repo workingCopy browse |
|
204 |
" |
|
205 |
||
206 |
"Created: / 20-11-2012 / 19:35:16 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
207 |
! |
|
208 |
||
209 |
test_commit_03a |
|
210 |
" |
|
211 |
Two images A, B working in parallel, commiting to same repo |
|
212 |
||
213 |
1) A: checkout, modify commit package (cs1) |
|
214 |
2) B: checkout, commit change (cs2) |
|
215 |
2) A: modify, checkout (cs3) |
|
216 |
||
217 |
The changeset cs3 should have cs1 as its parent1 |
|
218 |
" |
|
219 |
||
220 |
| repo pmA ctA wcB s | |
|
221 |
||
222 |
"=== A modifies & commits =============================== " |
|
223 |
repo := self repositoryNamed: 'mocks/hg/p1'. |
|
224 |
Smalltalk loadPackage:'mocks:hg/p1'. |
|
93
2579830f6b61
Tests fixed. Not-yet-supported tests marked as skipped.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
91
diff
changeset
|
225 |
self dumpRepositoryLog: repo. |
2579830f6b61
Tests fixed. Not-yet-supported tests marked as skipped.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
91
diff
changeset
|
226 |
|
91 | 227 |
pmA := HGPackageModel named: 'mocks:hg/p1'. |
228 |
(MockHGP1Bar compile:'zork ^ 1' classified:'test') package: MockHGP1Bar package. |
|
229 |
||
230 |
self deny: ((repo @ 1 / 'MockHGP1Bar.st') contents asString includesString:'zork ^ 1'). |
|
231 |
||
232 |
ctA := pmA commitTask. |
|
233 |
ctA message:'test_commit_03a A-1'. |
|
234 |
ctA do. |
|
93
2579830f6b61
Tests fixed. Not-yet-supported tests marked as skipped.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
91
diff
changeset
|
235 |
self dumpRepositoryLog: repo. |
91 | 236 |
|
237 |
self assert: ((repo @ 2 / 'MockHGP1Bar.st') contents asString includesString:'zork ^ 1'). |
|
238 |
self assert: ((repo @ 2 ) parent1 == (repo @ 1 )). |
|
239 |
||
240 |
"=== B modifies & commits =============================== " |
|
241 |
wcB := repo workingCopy. |
|
242 |
s := ( wcB / 'abbrev.stc' ) appendStream. |
|
243 |
[ s nextPutLine:'# Modification '] ensure:[s close]. |
|
244 |
wcB commit: 'test_commit_03a B-2'. |
|
93
2579830f6b61
Tests fixed. Not-yet-supported tests marked as skipped.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
91
diff
changeset
|
245 |
self dumpRepositoryLog: repo. |
91 | 246 |
self assert: ((repo @ 3 ) parent1 == (repo @ 1 )). |
247 |
||
248 |
||
249 |
"=== A modifies & commits =============================== " |
|
250 |
(MockHGP1Bar compile:'zork ^ 2' classified:'test') package: MockHGP1Bar package. |
|
251 |
||
252 |
ctA := pmA commitTask. |
|
253 |
ctA message:'test_commit_03a A-3'. |
|
254 |
ctA do. |
|
93
2579830f6b61
Tests fixed. Not-yet-supported tests marked as skipped.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
91
diff
changeset
|
255 |
self dumpRepositoryLog: repo. |
91 | 256 |
|
257 |
self assert: ((repo @ 4 ) parent1 == (repo @ 2 )). |
|
258 |
||
259 |
" |
|
260 |
repo workingCopy browse |
|
261 |
" |
|
262 |
||
263 |
"Created: / 20-11-2012 / 19:45:45 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
93
2579830f6b61
Tests fixed. Not-yet-supported tests marked as skipped.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
91
diff
changeset
|
264 |
"Modified: / 22-11-2012 / 11:16:29 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
91 | 265 |
! |
266 |
||
267 |
test_commit_03b |
|
268 |
" |
|
269 |
Two images A, B working in parallel, commiting to same repo |
|
270 |
||
271 |
1) A: checkout, modify commit package (cs1) |
|
272 |
2) B: checkout, commit change (cs2) |
|
273 |
3) A: flushes its temp working copy |
|
274 |
4) A: modify, checkout (cs3) |
|
275 |
||
276 |
The changeset cs3 should have cs1 as its parent1 |
|
277 |
" |
|
278 |
||
93
2579830f6b61
Tests fixed. Not-yet-supported tests marked as skipped.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
91
diff
changeset
|
279 |
<skip> "/ Not yet supported |
2579830f6b61
Tests fixed. Not-yet-supported tests marked as skipped.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
91
diff
changeset
|
280 |
|
91 | 281 |
| repo pmA ctA wcB s | |
282 |
||
283 |
"=== A modifies & commits =============================== " |
|
284 |
repo := self repositoryNamed: 'mocks/hg/p1'. |
|
285 |
Smalltalk loadPackage:'mocks:hg/p1'. |
|
286 |
pmA := HGPackageModel named: 'mocks:hg/p1'. |
|
287 |
(MockHGP1Bar compile:'zork ^ 1' classified:'test') package: MockHGP1Bar package. |
|
288 |
||
289 |
self deny: ((repo @ 1 / 'MockHGP1Bar.st') contents asString includesString:'zork ^ 1'). |
|
290 |
||
291 |
ctA := pmA commitTask. |
|
292 |
ctA message:'test_commit_03a A-1'. |
|
293 |
ctA do. |
|
294 |
||
295 |
self assert: ((repo @ 2 / 'MockHGP1Bar.st') contents asString includesString:'zork ^ 1'). |
|
296 |
self assert: ((repo @ 2 ) parent1 == (repo @ 1 )). |
|
297 |
||
298 |
"=== B modifies & commits =============================== " |
|
299 |
wcB := repo workingCopy. |
|
300 |
s := ( wcB / 'abbrev.stc' ) appendStream. |
|
301 |
[ s nextPutLine:'# Modification '] ensure:[s close]. |
|
302 |
wcB commit: 'test_commit_03a B-2'. |
|
303 |
self assert: ((repo @ 3 ) parent1 == (repo @ 1 )). |
|
304 |
||
305 |
"=== A flushed its working copy ========================= " |
|
306 |
pmA workingCopy path recursiveRemove. |
|
307 |
||
308 |
||
309 |
"=== A modifies & commits =============================== " |
|
310 |
(MockHGP1Bar compile:'zork ^ 2' classified:'test') package: MockHGP1Bar package. |
|
311 |
||
312 |
ctA := pmA commitTask. |
|
313 |
ctA message:'test_commit_03a A-3'. |
|
314 |
ctA do. |
|
315 |
||
316 |
self assert: ((repo @ 4 ) parent1 == (repo @ 2 )). |
|
317 |
||
318 |
" |
|
319 |
repo workingCopy browse |
|
320 |
" |
|
321 |
||
322 |
"Created: / 20-11-2012 / 19:51:33 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
93
2579830f6b61
Tests fixed. Not-yet-supported tests marked as skipped.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
91
diff
changeset
|
323 |
"Modified: / 22-11-2012 / 11:43:26 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
91 | 324 |
! |
325 |
||
326 |
test_commit_03c |
|
327 |
" |
|
328 |
Two images A, B working in parallel, commiting to same repo |
|
329 |
||
330 |
(cs1) - base changeset |
|
331 |
2) B: checkout, modifu, commit change (cs2) |
|
332 |
4) A: checkout, modify, commit change (cs3) |
|
333 |
||
334 |
The changeset cs3 should have cs1 as its parent1 |
|
335 |
" |
|
336 |
||
93
2579830f6b61
Tests fixed. Not-yet-supported tests marked as skipped.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
91
diff
changeset
|
337 |
<skip> "/ Not yet supported |
2579830f6b61
Tests fixed. Not-yet-supported tests marked as skipped.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
91
diff
changeset
|
338 |
|
91 | 339 |
| repo pmA ctA wcB s | |
340 |
||
341 |
repo := self repositoryNamed: 'mocks/hg/p1'. |
|
342 |
Smalltalk loadPackage:'mocks:hg/p1'. |
|
343 |
pmA := HGPackageModel named: 'mocks:hg/p1'. |
|
344 |
||
345 |
"=== B modifies & commits =============================== " |
|
346 |
wcB := repo workingCopy. |
|
347 |
s := ( wcB / 'abbrev.stc' ) appendStream. |
|
348 |
[ s nextPutLine:'# Modification '] ensure:[s close]. |
|
349 |
wcB commit: 'test_commit_03c B-1'. |
|
350 |
self assert: ((repo @ 2 ) parent1 == (repo @ 1 )). |
|
351 |
||
352 |
"=== A modifies & commits =============================== " |
|
353 |
(MockHGP1Bar compile:'zork ^ 2' classified:'test') package: MockHGP1Bar package. |
|
354 |
||
355 |
ctA := pmA commitTask. |
|
356 |
ctA message:'test_commit_03c A-2'. |
|
357 |
ctA do. |
|
358 |
||
359 |
self assert: ((repo @ 3 ) parent1 == (repo @ 1 )). |
|
360 |
||
361 |
" |
|
362 |
repo workingCopy browse |
|
363 |
" |
|
364 |
||
365 |
"Created: / 20-11-2012 / 20:00:15 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
93
2579830f6b61
Tests fixed. Not-yet-supported tests marked as skipped.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
91
diff
changeset
|
366 |
"Modified: / 22-11-2012 / 11:43:34 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
91 | 367 |
! ! |
368 |
||
369 |
!HGStXTests methodsFor:'utilities'! |
|
370 |
||
371 |
cleanup |
|
372 |
"Wipeout all mock package leftovers. Could be used |
|
373 |
to simulate work from another fresh image" |
|
374 |
||
375 |
self tearDown |
|
376 |
||
377 |
"Created: / 20-11-2012 / 19:32:08 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
69
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
378 |
! ! |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
379 |
|
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
380 |
!HGStXTests class methodsFor:'documentation'! |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
381 |
|
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
382 |
version_HG |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
383 |
"Never, ever change this method. Ask JV or CG why" |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
384 |
^thisContext method mclass theNonMetaclass instVarNamed: #revision |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
385 |
! ! |