author | Jakub Nesveda <jakubnesveda@seznam.cz> |
Fri, 10 Oct 2014 16:28:37 +0200 | |
changeset 688 | 6bd18ba5e56c |
parent 650 | 7514c13d6dd8 |
child 698 | 525d39491ecc |
permissions | -rw-r--r-- |
645
38a38c28ddb1
work in progress - create selection replace API in CustomRefactoryBuilder and CustomCodeSelectionToResourceTranslation
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff
changeset
|
1 |
"{ Package: 'jn:refactoring_custom' }" |
38a38c28ddb1
work in progress - create selection replace API in CustomRefactoryBuilder and CustomCodeSelectionToResourceTranslation
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff
changeset
|
2 |
|
38a38c28ddb1
work in progress - create selection replace API in CustomRefactoryBuilder and CustomCodeSelectionToResourceTranslation
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff
changeset
|
3 |
CustomCodeGeneratorOrRefactoringTestCase subclass:#CustomCodeSelectionToResourceTranslationTests |
38a38c28ddb1
work in progress - create selection replace API in CustomRefactoryBuilder and CustomCodeSelectionToResourceTranslation
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff
changeset
|
4 |
instanceVariableNames:'' |
38a38c28ddb1
work in progress - create selection replace API in CustomRefactoryBuilder and CustomCodeSelectionToResourceTranslation
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff
changeset
|
5 |
classVariableNames:'' |
38a38c28ddb1
work in progress - create selection replace API in CustomRefactoryBuilder and CustomCodeSelectionToResourceTranslation
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff
changeset
|
6 |
poolDictionaries:'' |
38a38c28ddb1
work in progress - create selection replace API in CustomRefactoryBuilder and CustomCodeSelectionToResourceTranslation
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff
changeset
|
7 |
category:'Interface-Refactoring-Custom-Tests' |
38a38c28ddb1
work in progress - create selection replace API in CustomRefactoryBuilder and CustomCodeSelectionToResourceTranslation
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff
changeset
|
8 |
! |
38a38c28ddb1
work in progress - create selection replace API in CustomRefactoryBuilder and CustomCodeSelectionToResourceTranslation
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff
changeset
|
9 |
|
38a38c28ddb1
work in progress - create selection replace API in CustomRefactoryBuilder and CustomCodeSelectionToResourceTranslation
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff
changeset
|
10 |
!CustomCodeSelectionToResourceTranslationTests methodsFor:'accessing'! |
38a38c28ddb1
work in progress - create selection replace API in CustomRefactoryBuilder and CustomCodeSelectionToResourceTranslation
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff
changeset
|
11 |
|
38a38c28ddb1
work in progress - create selection replace API in CustomRefactoryBuilder and CustomCodeSelectionToResourceTranslation
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff
changeset
|
12 |
generatorOrRefactoring |
38a38c28ddb1
work in progress - create selection replace API in CustomRefactoryBuilder and CustomCodeSelectionToResourceTranslation
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff
changeset
|
13 |
^ CustomCodeSelectionToResourceTranslation new |
38a38c28ddb1
work in progress - create selection replace API in CustomRefactoryBuilder and CustomCodeSelectionToResourceTranslation
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff
changeset
|
14 |
! ! |
38a38c28ddb1
work in progress - create selection replace API in CustomRefactoryBuilder and CustomCodeSelectionToResourceTranslation
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff
changeset
|
15 |
|
38a38c28ddb1
work in progress - create selection replace API in CustomRefactoryBuilder and CustomCodeSelectionToResourceTranslation
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff
changeset
|
16 |
!CustomCodeSelectionToResourceTranslationTests methodsFor:'tests'! |
38a38c28ddb1
work in progress - create selection replace API in CustomRefactoryBuilder and CustomCodeSelectionToResourceTranslation
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff
changeset
|
17 |
|
38a38c28ddb1
work in progress - create selection replace API in CustomRefactoryBuilder and CustomCodeSelectionToResourceTranslation
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff
changeset
|
18 |
test_code_selection_replaced_by_resource_translation_01 |
38a38c28ddb1
work in progress - create selection replace API in CustomRefactoryBuilder and CustomCodeSelectionToResourceTranslation
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff
changeset
|
19 |
| expectedSource originalSource codeSelection class | |
38a38c28ddb1
work in progress - create selection replace API in CustomRefactoryBuilder and CustomCodeSelectionToResourceTranslation
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff
changeset
|
20 |
|
38a38c28ddb1
work in progress - create selection replace API in CustomRefactoryBuilder and CustomCodeSelectionToResourceTranslation
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff
changeset
|
21 |
originalSource := 'selector |
38a38c28ddb1
work in progress - create selection replace API in CustomRefactoryBuilder and CustomCodeSelectionToResourceTranslation
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff
changeset
|
22 |
self information: ''Translate this''. |
38a38c28ddb1
work in progress - create selection replace API in CustomRefactoryBuilder and CustomCodeSelectionToResourceTranslation
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff
changeset
|
23 |
^ self.'. |
38a38c28ddb1
work in progress - create selection replace API in CustomRefactoryBuilder and CustomCodeSelectionToResourceTranslation
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff
changeset
|
24 |
|
688
6bd18ba5e56c
completed - rewriting code generators to replace CustomSourceCodeBuilder, but RBClass, RBMetaclass, RBNamespace and CodeGenerator
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
650
diff
changeset
|
25 |
class := model createClassImmediate: 'DummyClassForTestCase01' instanceVariableNames: 'resources'. |
6bd18ba5e56c
completed - rewriting code generators to replace CustomSourceCodeBuilder, but RBClass, RBMetaclass, RBNamespace and CodeGenerator
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
650
diff
changeset
|
26 |
model createMethodImmediate: class source: originalSource. |
645
38a38c28ddb1
work in progress - create selection replace API in CustomRefactoryBuilder and CustomCodeSelectionToResourceTranslation
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff
changeset
|
27 |
|
38a38c28ddb1
work in progress - create selection replace API in CustomRefactoryBuilder and CustomCodeSelectionToResourceTranslation
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff
changeset
|
28 |
codeSelection := CustomSourceCodeSelection new. |
38a38c28ddb1
work in progress - create selection replace API in CustomRefactoryBuilder and CustomCodeSelectionToResourceTranslation
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff
changeset
|
29 |
codeSelection |
38a38c28ddb1
work in progress - create selection replace API in CustomRefactoryBuilder and CustomCodeSelectionToResourceTranslation
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff
changeset
|
30 |
currentSourceCode: originalSource; |
38a38c28ddb1
work in progress - create selection replace API in CustomRefactoryBuilder and CustomCodeSelectionToResourceTranslation
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff
changeset
|
31 |
selectedClass: class; |
38a38c28ddb1
work in progress - create selection replace API in CustomRefactoryBuilder and CustomCodeSelectionToResourceTranslation
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff
changeset
|
32 |
selectedInterval: (32 to: 48); |
38a38c28ddb1
work in progress - create selection replace API in CustomRefactoryBuilder and CustomCodeSelectionToResourceTranslation
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff
changeset
|
33 |
selectedMethod: (class compiledMethodAt: #selector); |
38a38c28ddb1
work in progress - create selection replace API in CustomRefactoryBuilder and CustomCodeSelectionToResourceTranslation
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff
changeset
|
34 |
selectedSelector: #selector. |
38a38c28ddb1
work in progress - create selection replace API in CustomRefactoryBuilder and CustomCodeSelectionToResourceTranslation
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff
changeset
|
35 |
|
38a38c28ddb1
work in progress - create selection replace API in CustomRefactoryBuilder and CustomCodeSelectionToResourceTranslation
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff
changeset
|
36 |
context selectedCodes: (Array with: codeSelection). |
38a38c28ddb1
work in progress - create selection replace API in CustomRefactoryBuilder and CustomCodeSelectionToResourceTranslation
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff
changeset
|
37 |
generatorOrRefactoring executeInContext: context. |
38a38c28ddb1
work in progress - create selection replace API in CustomRefactoryBuilder and CustomCodeSelectionToResourceTranslation
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff
changeset
|
38 |
|
38a38c28ddb1
work in progress - create selection replace API in CustomRefactoryBuilder and CustomCodeSelectionToResourceTranslation
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff
changeset
|
39 |
expectedSource := 'selector |
650
7514c13d6dd8
working refactoring CustomCodeSelectionToResourceTranslation - wraps code selection in code editor (codeView) to translation call, finished code selection search/replace API in CustomRefactoryBuilder
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
645
diff
changeset
|
40 |
self information:(resources string:''Translate this''). |
645
38a38c28ddb1
work in progress - create selection replace API in CustomRefactoryBuilder and CustomCodeSelectionToResourceTranslation
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff
changeset
|
41 |
^ self.'. |
38a38c28ddb1
work in progress - create selection replace API in CustomRefactoryBuilder and CustomCodeSelectionToResourceTranslation
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff
changeset
|
42 |
|
650
7514c13d6dd8
working refactoring CustomCodeSelectionToResourceTranslation - wraps code selection in code editor (codeView) to translation call, finished code selection search/replace API in CustomRefactoryBuilder
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
645
diff
changeset
|
43 |
self assertMethodSource:expectedSource atSelector:#selector forClass:class |
645
38a38c28ddb1
work in progress - create selection replace API in CustomRefactoryBuilder and CustomCodeSelectionToResourceTranslation
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff
changeset
|
44 |
|
38a38c28ddb1
work in progress - create selection replace API in CustomRefactoryBuilder and CustomCodeSelectionToResourceTranslation
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff
changeset
|
45 |
"Created: / 23-08-2014 / 20:09:06 / Jakub Nesveda <nesvejak@fit.cvut.cz>" |
650
7514c13d6dd8
working refactoring CustomCodeSelectionToResourceTranslation - wraps code selection in code editor (codeView) to translation call, finished code selection search/replace API in CustomRefactoryBuilder
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
645
diff
changeset
|
46 |
"Modified: / 26-08-2014 / 23:13:22 / Jakub Nesveda <nesvejak@fit.cvut.cz>" |
645
38a38c28ddb1
work in progress - create selection replace API in CustomRefactoryBuilder and CustomCodeSelectionToResourceTranslation
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff
changeset
|
47 |
! ! |
38a38c28ddb1
work in progress - create selection replace API in CustomRefactoryBuilder and CustomCodeSelectionToResourceTranslation
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff
changeset
|
48 |