-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest01.java
More file actions
40 lines (32 loc) · 1.18 KB
/
Copy pathtest01.java
File metadata and controls
40 lines (32 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package restructure;
import restructure.old.Customer;
import restructure.old.Movie;
import restructure.old.Rental;
import restructure.struct.CustomerNew;
import restructure.struct.MovieNew;
import restructure.struct.RentalNew;
/**
* 测试类
*
* @author vayi
* @date 2018/7/30
* @since 0.0.1
*/
class test01 {
public static void main(String[] args) {
System.out.println("=========================重构前结果=========================");
Movie mov = new Movie("xxx", 2);
Rental ren = new Rental(mov, 8);
Customer cus = new Customer("Cheng");
cus.addRental(ren);
System.out.println(cus.statement());
System.out.println("=========================重构前结果=========================");
System.out.println("=========================重构后结果=========================");
MovieNew newMov = new MovieNew("xxx", 2);
RentalNew newRen = new RentalNew(newMov, 8);
CustomerNew cusNew = new CustomerNew("Cheng");
cusNew.addRentalNew(newRen);
System.out.println(cusNew.statement());
System.out.println("=========================重构后结果=========================");
}
}