author | Jakub Nesveda <jakubnesveda@seznam.cz> |
Sat, 23 Aug 2014 20:04:41 +0200 | |
changeset 636 | a7f9fcc82017 |
parent 634 | CustomCodeGeneratorTestCaseCodeGenerator.st@d77d9a7561be |
child 646 | 8338755e1088 |
permissions | -rw-r--r-- |
565
e80ce770e237
CustomTestCaseCodeGenerator made as abstract to support multiple implementations of TestCase generation
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff
changeset
|
1 |
"{ Package: 'jn:refactoring_custom' }" |
e80ce770e237
CustomTestCaseCodeGenerator made as abstract to support multiple implementations of TestCase generation
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff
changeset
|
2 |
|
636
a7f9fcc82017
rename CustomCodeGeneratorTestCaseCodeGenerator to CustomCodeGeneratorOrRefactoringTestCaseCodeGenerator and change its implementation to the new naming
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
634
diff
changeset
|
3 |
CustomTestCaseCodeGenerator subclass:#CustomCodeGeneratorOrRefactoringTestCaseCodeGenerator |
565
e80ce770e237
CustomTestCaseCodeGenerator made as abstract to support multiple implementations of TestCase generation
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff
changeset
|
4 |
instanceVariableNames:'' |
e80ce770e237
CustomTestCaseCodeGenerator made as abstract to support multiple implementations of TestCase generation
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff
changeset
|
5 |
classVariableNames:'' |
e80ce770e237
CustomTestCaseCodeGenerator made as abstract to support multiple implementations of TestCase generation
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff
changeset
|
6 |
poolDictionaries:'' |
e80ce770e237
CustomTestCaseCodeGenerator made as abstract to support multiple implementations of TestCase generation
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff
changeset
|
7 |
category:'Interface-Refactoring-Custom' |
e80ce770e237
CustomTestCaseCodeGenerator made as abstract to support multiple implementations of TestCase generation
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff
changeset
|
8 |
! |
e80ce770e237
CustomTestCaseCodeGenerator made as abstract to support multiple implementations of TestCase generation
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff
changeset
|
9 |
|
636
a7f9fcc82017
rename CustomCodeGeneratorTestCaseCodeGenerator to CustomCodeGeneratorOrRefactoringTestCaseCodeGenerator and change its implementation to the new naming
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
634
diff
changeset
|
10 |
|
a7f9fcc82017
rename CustomCodeGeneratorTestCaseCodeGenerator to CustomCodeGeneratorOrRefactoringTestCaseCodeGenerator and change its implementation to the new naming
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
634
diff
changeset
|
11 |
!CustomCodeGeneratorOrRefactoringTestCaseCodeGenerator class methodsFor:'accessing-presentation'! |
565
e80ce770e237
CustomTestCaseCodeGenerator made as abstract to support multiple implementations of TestCase generation
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff
changeset
|
12 |
|
e80ce770e237
CustomTestCaseCodeGenerator made as abstract to support multiple implementations of TestCase generation
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff
changeset
|
13 |
description |
636
a7f9fcc82017
rename CustomCodeGeneratorTestCaseCodeGenerator to CustomCodeGeneratorOrRefactoringTestCaseCodeGenerator and change its implementation to the new naming
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
634
diff
changeset
|
14 |
^ 'Generate CodeGeneratorOrRefactoringTestCase subclass for selected classes (code generators/refactorings)' |
565
e80ce770e237
CustomTestCaseCodeGenerator made as abstract to support multiple implementations of TestCase generation
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff
changeset
|
15 |
|
636
a7f9fcc82017
rename CustomCodeGeneratorTestCaseCodeGenerator to CustomCodeGeneratorOrRefactoringTestCaseCodeGenerator and change its implementation to the new naming
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
634
diff
changeset
|
16 |
"Modified: / 23-08-2014 / 19:50:52 / Jakub Nesveda <nesvejak@fit.cvut.cz>" |
565
e80ce770e237
CustomTestCaseCodeGenerator made as abstract to support multiple implementations of TestCase generation
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff
changeset
|
17 |
! |
e80ce770e237
CustomTestCaseCodeGenerator made as abstract to support multiple implementations of TestCase generation
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff
changeset
|
18 |
|
e80ce770e237
CustomTestCaseCodeGenerator made as abstract to support multiple implementations of TestCase generation
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff
changeset
|
19 |
label |
636
a7f9fcc82017
rename CustomCodeGeneratorTestCaseCodeGenerator to CustomCodeGeneratorOrRefactoringTestCaseCodeGenerator and change its implementation to the new naming
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
634
diff
changeset
|
20 |
^ 'CodeGeneratorOrRefactoringTestCase class' |
565
e80ce770e237
CustomTestCaseCodeGenerator made as abstract to support multiple implementations of TestCase generation
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff
changeset
|
21 |
|
636
a7f9fcc82017
rename CustomCodeGeneratorTestCaseCodeGenerator to CustomCodeGeneratorOrRefactoringTestCaseCodeGenerator and change its implementation to the new naming
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
634
diff
changeset
|
22 |
"Modified: / 23-08-2014 / 19:50:58 / Jakub Nesveda <nesvejak@fit.cvut.cz>" |
565
e80ce770e237
CustomTestCaseCodeGenerator made as abstract to support multiple implementations of TestCase generation
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff
changeset
|
23 |
! ! |
e80ce770e237
CustomTestCaseCodeGenerator made as abstract to support multiple implementations of TestCase generation
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff
changeset
|
24 |
|
636
a7f9fcc82017
rename CustomCodeGeneratorTestCaseCodeGenerator to CustomCodeGeneratorOrRefactoringTestCaseCodeGenerator and change its implementation to the new naming
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
634
diff
changeset
|
25 |
!CustomCodeGeneratorOrRefactoringTestCaseCodeGenerator methodsFor:'executing'! |
565
e80ce770e237
CustomTestCaseCodeGenerator made as abstract to support multiple implementations of TestCase generation
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff
changeset
|
26 |
|
e80ce770e237
CustomTestCaseCodeGenerator made as abstract to support multiple implementations of TestCase generation
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff
changeset
|
27 |
buildForClass: aClass testClass: aTestClass |
e80ce770e237
CustomTestCaseCodeGenerator made as abstract to support multiple implementations of TestCase generation
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff
changeset
|
28 |
| source className | |
e80ce770e237
CustomTestCaseCodeGenerator made as abstract to support multiple implementations of TestCase generation
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff
changeset
|
29 |
|
636
a7f9fcc82017
rename CustomCodeGeneratorTestCaseCodeGenerator to CustomCodeGeneratorOrRefactoringTestCaseCodeGenerator and change its implementation to the new naming
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
634
diff
changeset
|
30 |
aTestClass superclassName: 'CustomCodeGeneratorOrRefactoringTestCase'. |
592
25f7fff0dc9e
fix class name retrieving in test case code generator
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
591
diff
changeset
|
31 |
className := aClass theNonMetaClass name. |
565
e80ce770e237
CustomTestCaseCodeGenerator made as abstract to support multiple implementations of TestCase generation
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff
changeset
|
32 |
|
e80ce770e237
CustomTestCaseCodeGenerator made as abstract to support multiple implementations of TestCase generation
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff
changeset
|
33 |
source := 'test_code_generated |
e80ce770e237
CustomTestCaseCodeGenerator made as abstract to support multiple implementations of TestCase generation
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff
changeset
|
34 |
| expectedSource | |
e80ce770e237
CustomTestCaseCodeGenerator made as abstract to support multiple implementations of TestCase generation
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff
changeset
|
35 |
|
e80ce770e237
CustomTestCaseCodeGenerator made as abstract to support multiple implementations of TestCase generation
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff
changeset
|
36 |
expectedSource := ''instanceVariable |
e80ce770e237
CustomTestCaseCodeGenerator made as abstract to support multiple implementations of TestCase generation
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff
changeset
|
37 |
^ instanceVariable''. |
e80ce770e237
CustomTestCaseCodeGenerator made as abstract to support multiple implementations of TestCase generation
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff
changeset
|
38 |
|
e80ce770e237
CustomTestCaseCodeGenerator made as abstract to support multiple implementations of TestCase generation
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff
changeset
|
39 |
self executeGeneratorInContext: #classWithInstanceVariable. |
e80ce770e237
CustomTestCaseCodeGenerator made as abstract to support multiple implementations of TestCase generation
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff
changeset
|
40 |
self assertMethodSource: expectedSource atSelector: #instanceVariable'. |
e80ce770e237
CustomTestCaseCodeGenerator made as abstract to support multiple implementations of TestCase generation
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff
changeset
|
41 |
|
634
d77d9a7561be
move refactoryBuilder and codeBuilder to CustomCodeGeneratorOrRefactoring
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
592
diff
changeset
|
42 |
codeBuilder |
565
e80ce770e237
CustomTestCaseCodeGenerator made as abstract to support multiple implementations of TestCase generation
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff
changeset
|
43 |
class: aTestClass; |
e80ce770e237
CustomTestCaseCodeGenerator made as abstract to support multiple implementations of TestCase generation
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff
changeset
|
44 |
|
e80ce770e237
CustomTestCaseCodeGenerator made as abstract to support multiple implementations of TestCase generation
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff
changeset
|
45 |
protocol: 'tests'; |
e80ce770e237
CustomTestCaseCodeGenerator made as abstract to support multiple implementations of TestCase generation
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff
changeset
|
46 |
source: source; |
e80ce770e237
CustomTestCaseCodeGenerator made as abstract to support multiple implementations of TestCase generation
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff
changeset
|
47 |
createMethod; |
e80ce770e237
CustomTestCaseCodeGenerator made as abstract to support multiple implementations of TestCase generation
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff
changeset
|
48 |
|
e80ce770e237
CustomTestCaseCodeGenerator made as abstract to support multiple implementations of TestCase generation
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff
changeset
|
49 |
protocol: 'accessing'; |
636
a7f9fcc82017
rename CustomCodeGeneratorTestCaseCodeGenerator to CustomCodeGeneratorOrRefactoringTestCaseCodeGenerator and change its implementation to the new naming
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
634
diff
changeset
|
50 |
source: 'generatorOrRefactoring |
565
e80ce770e237
CustomTestCaseCodeGenerator made as abstract to support multiple implementations of TestCase generation
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff
changeset
|
51 |
^ `className new'; |
e80ce770e237
CustomTestCaseCodeGenerator made as abstract to support multiple implementations of TestCase generation
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff
changeset
|
52 |
replace: '`className' with: className asString; |
e80ce770e237
CustomTestCaseCodeGenerator made as abstract to support multiple implementations of TestCase generation
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff
changeset
|
53 |
createMethod |
e80ce770e237
CustomTestCaseCodeGenerator made as abstract to support multiple implementations of TestCase generation
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff
changeset
|
54 |
|
e80ce770e237
CustomTestCaseCodeGenerator made as abstract to support multiple implementations of TestCase generation
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff
changeset
|
55 |
"Created: / 13-06-2014 / 09:27:15 / Jakub Nesveda <nesvejak@fit.cvut.cz>" |
636
a7f9fcc82017
rename CustomCodeGeneratorTestCaseCodeGenerator to CustomCodeGeneratorOrRefactoringTestCaseCodeGenerator and change its implementation to the new naming
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
634
diff
changeset
|
56 |
"Modified: / 23-08-2014 / 19:56:09 / Jakub Nesveda <nesvejak@fit.cvut.cz>" |
565
e80ce770e237
CustomTestCaseCodeGenerator made as abstract to support multiple implementations of TestCase generation
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff
changeset
|
57 |
! ! |
e80ce770e237
CustomTestCaseCodeGenerator made as abstract to support multiple implementations of TestCase generation
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff
changeset
|
58 |
|
636
a7f9fcc82017
rename CustomCodeGeneratorTestCaseCodeGenerator to CustomCodeGeneratorOrRefactoringTestCaseCodeGenerator and change its implementation to the new naming
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
634
diff
changeset
|
59 |
!CustomCodeGeneratorOrRefactoringTestCaseCodeGenerator class methodsFor:'documentation'! |
a7f9fcc82017
rename CustomCodeGeneratorTestCaseCodeGenerator to CustomCodeGeneratorOrRefactoringTestCaseCodeGenerator and change its implementation to the new naming
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
634
diff
changeset
|
60 |
|
a7f9fcc82017
rename CustomCodeGeneratorTestCaseCodeGenerator to CustomCodeGeneratorOrRefactoringTestCaseCodeGenerator and change its implementation to the new naming
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
634
diff
changeset
|
61 |
version_HG |
a7f9fcc82017
rename CustomCodeGeneratorTestCaseCodeGenerator to CustomCodeGeneratorOrRefactoringTestCaseCodeGenerator and change its implementation to the new naming
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
634
diff
changeset
|
62 |
|
a7f9fcc82017
rename CustomCodeGeneratorTestCaseCodeGenerator to CustomCodeGeneratorOrRefactoringTestCaseCodeGenerator and change its implementation to the new naming
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
634
diff
changeset
|
63 |
^ '$Changeset: <not expanded> $' |
a7f9fcc82017
rename CustomCodeGeneratorTestCaseCodeGenerator to CustomCodeGeneratorOrRefactoringTestCaseCodeGenerator and change its implementation to the new naming
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
634
diff
changeset
|
64 |
! ! |
a7f9fcc82017
rename CustomCodeGeneratorTestCaseCodeGenerator to CustomCodeGeneratorOrRefactoringTestCaseCodeGenerator and change its implementation to the new naming
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
634
diff
changeset
|
65 |