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 package wjhk.jupload2.testhelpers;
27
28 import wjhk.jupload2.exception.JUploadException;
29 import wjhk.jupload2.upload.FileUploadManagerThread;
30 import wjhk.jupload2.upload.UploadFileData;
31 import wjhk.jupload2.upload.UploadFilePacket;
32
33
34
35
36
37 public class FileUploadManagerThreadTestHelper extends Thread implements
38 FileUploadManagerThread {
39
40
41 public JUploadException uploadException = new JUploadException(
42 new UnsupportedOperationException(this.getClass()
43 + ": uploadException is not supported in tests cases"));
44
45
46 boolean uploadFinished = false;
47
48
49
50
51
52 public void anotherFileHasBeenSent(UploadFilePacket uploadFilePacket,
53 UploadFileData newlyUploadedFileData) throws JUploadException {
54 throw new UnsupportedOperationException(this.getClass()
55 + ".anotherFileHasBeenSent() is not implemented in tests cases");
56 }
57
58
59
60
61 public void currentRequestIsFinished(UploadFilePacket packet)
62 throws JUploadException {
63 throw new UnsupportedOperationException(
64 this.getClass()
65 + ".currentRequestIsFinished() is not implemented in tests cases");
66 }
67
68
69
70
71 public JUploadException getUploadException() {
72 return this.uploadException;
73 }
74
75
76
77
78
79
80
81 public boolean isUploadFinished() {
82 return this.uploadFinished;
83 }
84
85
86
87
88
89
90 public boolean isUploadStopped() {
91 return false;
92 }
93
94
95
96
97
98 public void nbBytesUploaded(long nbBytes, UploadFileData uploadFileData)
99 throws JUploadException {
100 throw new UnsupportedOperationException(this.getClass()
101 + ".nbBytesUploaded() is not implemented in tests cases");
102 }
103
104
105
106
107 @Override
108 public void run() {
109 throw new UnsupportedOperationException(this.getClass()
110 + ".run() is not implemented in tests cases");
111 }
112
113
114
115
116 public void setUploadException(JUploadException uploadException) {
117 this.uploadException = uploadException;
118 }
119
120
121
122
123
124 public void setUploadStatus(UploadFilePacket uploadFilePacket,
125 UploadFileData uploadFileData, int uploadStatus)
126 throws JUploadException {
127 throw new UnsupportedOperationException(this.getClass()
128 + ".setUploadStatus() is not implemented in tests cases");
129 }
130
131
132
133
134 public void stopUpload() {
135 throw new UnsupportedOperationException(this.getClass()
136 + ".stopUpload() is not implemented in tests cases");
137 }
138 }