ВУЗ:
Составители:
Рубрика:
ɋɬɟɩɚɧɰɨɜ ȼ.Ⱥ. ɉɪɚɤɬɢɱɟɫɤɚɹ ɪɚɛɨɬɚ ɜ Eclipse 3.2
32
2. Ⱦɚɥɟɟ ɩɨɥɭɱɢɬɟ ɩɪɢɝɥɚɲɟɧɢɟ ɜɵɛɪɚɬɶ, ɧɭɠɧɨ ɢɥɢ ɧɟɬ ɢɡɦɟɧɹɬɶ
ɫɫɵɥɤɢ ɧɚ ɮɚɣɥ, ɤɨɬɨɪɵɣ ɩɟɪɟɦɟɳɚɟɬɟ. Ɉɛɵɱɧɨ ɷɬɨ ɧɟɨɛɯɨɞɢɦɨ
ɫɞɟɥɚɬɶ, ɱɬɨɛɵ ɢɡɛɟɠɚɬɶ ɨɲɢɛɨɤ ɤɨɦɩɢɥɹɰɢɢ. ɇɚɠɦɢɬɟ ɧɚ ɤɧɨɩɤɭ
Preview, ɱɬɨɛɵ ɭɜɢɞɟɬɶ ɫɩɢɫɨɤ ɢɡɦɟɧɟɧɢɣ, ɤɨɬɨɪɵɟ ɛɭɞɭɬ ɫɞɟɥɚɧɵ ɜ
ɪɟɡɭɥɶɬɚɬɟ ɩɟɪɟɦɟɳɟɧɢɹ.
3. ɇɚɠɦɢɬɟ ɧɚ Ok. Ɏɚɣɥ ɩɟɪɟɦɟɳɚɟɬɫɹ, ɢ ɟɝɨ ɨɛɴɹɜɥɟɧɢɟ ɩɚɤɟɬɚ
ɢɡɦɟɧɹɟɬɫɹ, ɨɬɪɚɠɚɹ ɟɝɨ ɧɨɜɨɟ ɦɟɫɬɨɩɨɥɨɠɟɧɢɟ.
Ʉɨɧɬɟɤɫɬɧɨɟ ɦɟɧɸ ɹɜɥɹɟɬɫɹ ɚɥɶɬɟɪɧɚɬɢɜɨɣ ɛɭɤɫɢɪɨɜɤɢ. ɉɪɢ
ɢɫɩɨɥɶɡɨɜɚɧɢɢ ɦɟɧɸ ɧɟɨɛɯɨɞɢɦɨ ɡɚɞɚɬɶ ɰɟɥɟɜɨɣ ɩɚɤɟɬ ɜ ɞɢɚɥɨɝɟ Move,
ɤɪɨɦɟ ɜɵɛɨɪɚ ɢɡɦɟɧɟɧɢɹ ɫɫɵɥɨɤ, ɤɨɬɨɪɵɣ ɭɠɟ ɛɵɥ ɩɨɤɚɡɚɧ.
1. ȼɵɛɟɪɢɬɟ ɮɚɣɥ
MyTestCase.java ɢ ɢɡ ɤɨɧɬɟɤɫɬɧɨɝɨ ɦɟɧɸ ɜɵɛɟɪɢɬɟ
Refactor > Move.
2. ȼ ɞɢɚɥɨɝɟ Move ɪɚɫɤɪɨɣɬɟ ɢɟɪɚɪɯɢɸ, ɱɬɨɛɵ ɭɜɢɞɟɬɶ ɜɨɡɦɨɠɧɵɟ
ɧɨɜɵɟ ɦɟɫɬɨɩɨɥɨɠɟɧɢɹ ɪɟɫɭɪɫɚ. ȼɵɛɟɪɢɬɟ ɩɚɤɟɬ
junit.samples ɢ
ɳɟɥɤɧɢɬɟ ɧɚ OK. Ʉɥɚɫɫ ɩɟɪɟɦɟɳɚɟɬɫɹ, ɢ ɟɝɨ ɨɛɴɹɜɥɟɧɢɟ ɩɚɤɟɬɚ
ɢɡɦɟɧɹɟɬɫɹ ɧɚ ɧɨɜɨɟ ɦɟɫɬɨɩɨɥɨɠɟɧɢɟ.
3.12. ɇɚɜɢɝɚɰɢɹ ɩɨ ɨɛɴɹɜɥɟɧɢɹɦ ɷɥɟɦɟɧɬɨɜ Java
1. Ɉɬɤɪɨɣɬɟ ɮɚɣɥ
MoneyTest.java ɢɡ ɩɚɤɟɬɚ junit.samples.money ɜ
ɪɟɞɚɤɬɨɪɟ Java.
2. ȼ ɩɟɪɜɨɣ ɫɬɪɨɤɟ ɨɛɴɹɜɥɟɧɢɹ ɤɥɚɫɫɚ
MoneyTest ɜɵɛɟɪɢɬɟ ɫɭɩɟɪɤɥɚɫɫ
TestCase ɢ ɢɡ ɫɬɪɨɤɢ ɦɟɧɸ ɜɵɛɟɪɢɬɟ Navigate > Open Declaration
ɢɥɢ ɧɚɠɦɢɬɟ ɧɚ F3.
ɋɬɟɩɚɧɰɨɜ ȼ.Ⱥ. ɉɪɚɤɬɢɱɟɫɤɚɹ ɪɚɛɨɬɚ ɜ Eclipse 3.2
2. Ⱦɚɥɟɟ ɩɨɥɭɱɢɬɟ ɩɪɢɝɥɚɲɟɧɢɟ ɜɵɛɪɚɬɶ, ɧɭɠɧɨ ɢɥɢ ɧɟɬ ɢɡɦɟɧɹɬɶ
ɫɫɵɥɤɢ ɧɚ ɮɚɣɥ, ɤɨɬɨɪɵɣ ɩɟɪɟɦɟɳɚɟɬɟ. Ɉɛɵɱɧɨ ɷɬɨ ɧɟɨɛɯɨɞɢɦɨ
ɫɞɟɥɚɬɶ, ɱɬɨɛɵ ɢɡɛɟɠɚɬɶ ɨɲɢɛɨɤ ɤɨɦɩɢɥɹɰɢɢ. ɇɚɠɦɢɬɟ ɧɚ ɤɧɨɩɤɭ
Preview, ɱɬɨɛɵ ɭɜɢɞɟɬɶ ɫɩɢɫɨɤ ɢɡɦɟɧɟɧɢɣ, ɤɨɬɨɪɵɟ ɛɭɞɭɬ ɫɞɟɥɚɧɵ ɜ
ɪɟɡɭɥɶɬɚɬɟ ɩɟɪɟɦɟɳɟɧɢɹ.
3. ɇɚɠɦɢɬɟ ɧɚ Ok. Ɏɚɣɥ ɩɟɪɟɦɟɳɚɟɬɫɹ, ɢ ɟɝɨ ɨɛɴɹɜɥɟɧɢɟ ɩɚɤɟɬɚ
ɢɡɦɟɧɹɟɬɫɹ, ɨɬɪɚɠɚɹ ɟɝɨ ɧɨɜɨɟ ɦɟɫɬɨɩɨɥɨɠɟɧɢɟ.
Ʉɨɧɬɟɤɫɬɧɨɟ ɦɟɧɸ ɹɜɥɹɟɬɫɹ ɚɥɶɬɟɪɧɚɬɢɜɨɣ ɛɭɤɫɢɪɨɜɤɢ. ɉɪɢ
ɢɫɩɨɥɶɡɨɜɚɧɢɢ ɦɟɧɸ ɧɟɨɛɯɨɞɢɦɨ ɡɚɞɚɬɶ ɰɟɥɟɜɨɣ ɩɚɤɟɬ ɜ ɞɢɚɥɨɝɟ Move,
ɤɪɨɦɟ ɜɵɛɨɪɚ ɢɡɦɟɧɟɧɢɹ ɫɫɵɥɨɤ, ɤɨɬɨɪɵɣ ɭɠɟ ɛɵɥ ɩɨɤɚɡɚɧ.
1. ȼɵɛɟɪɢɬɟ ɮɚɣɥ MyTestCase.java ɢ ɢɡ ɤɨɧɬɟɤɫɬɧɨɝɨ ɦɟɧɸ ɜɵɛɟɪɢɬɟ
Refactor > Move.
2. ȼ ɞɢɚɥɨɝɟ Move ɪɚɫɤɪɨɣɬɟ ɢɟɪɚɪɯɢɸ, ɱɬɨɛɵ ɭɜɢɞɟɬɶ ɜɨɡɦɨɠɧɵɟ
ɧɨɜɵɟ ɦɟɫɬɨɩɨɥɨɠɟɧɢɹ ɪɟɫɭɪɫɚ. ȼɵɛɟɪɢɬɟ ɩɚɤɟɬ junit.samples ɢ
ɳɟɥɤɧɢɬɟ ɧɚ OK. Ʉɥɚɫɫ ɩɟɪɟɦɟɳɚɟɬɫɹ, ɢ ɟɝɨ ɨɛɴɹɜɥɟɧɢɟ ɩɚɤɟɬɚ
ɢɡɦɟɧɹɟɬɫɹ ɧɚ ɧɨɜɨɟ ɦɟɫɬɨɩɨɥɨɠɟɧɢɟ.
3.12. ɇɚɜɢɝɚɰɢɹ ɩɨ ɨɛɴɹɜɥɟɧɢɹɦ ɷɥɟɦɟɧɬɨɜ Java
1. Ɉɬɤɪɨɣɬɟ ɮɚɣɥ MoneyTest.java ɢɡ ɩɚɤɟɬɚ junit.samples.money ɜ
ɪɟɞɚɤɬɨɪɟ Java.
2. ȼ ɩɟɪɜɨɣ ɫɬɪɨɤɟ ɨɛɴɹɜɥɟɧɢɹ ɤɥɚɫɫɚ MoneyTest ɜɵɛɟɪɢɬɟ ɫɭɩɟɪɤɥɚɫɫ
TestCase ɢ ɢɡ ɫɬɪɨɤɢ ɦɟɧɸ ɜɵɛɟɪɢɬɟ Navigate > Open Declaration
ɢɥɢ ɧɚɠɦɢɬɟ ɧɚ F3.
32
Страницы
- « первая
- ‹ предыдущая
- …
- 30
- 31
- 32
- 33
- 34
- …
- следующая ›
- последняя »
