View Javadoc
1   //
2   // $Id$
3   //
4   // jupload - A file upload applet.
5   //
6   // Copyright 2012 The JUpload Team
7   //
8   // Created: 5 nov. 2012
9   // Creator: etienne_sf
10  // Last modified: $Date$
11  //
12  // This program is free software; you can redistribute it and/or modify
13  // it under the terms of the GNU General Public License as published by
14  // the Free Software Foundation; either version 2 of the License, or
15  // (at your option) any later version.
16  //
17  // This program is distributed in the hope that it will be useful,
18  // but WITHOUT ANY WARRANTY; without even the implied warranty of
19  // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20  // GNU General Public License for more details.
21  //
22  // You should have received a copy of the GNU General Public License
23  // along with this program; if not, write to the Free Software
24  // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25  
26  package wjhk.jupload2.upload;
27  
28  import java.io.OutputStream;
29  import java.util.concurrent.BlockingQueue;
30  
31  import wjhk.jupload2.exception.JUploadException;
32  import wjhk.jupload2.exception.JUploadIOException;
33  import wjhk.jupload2.policies.UploadPolicy;
34  import wjhk.jupload2.upload.DefaultFileUploadThread;
35  import wjhk.jupload2.upload.FileUploadManagerThread;
36  import wjhk.jupload2.upload.UploadFileData;
37  import wjhk.jupload2.upload.UploadFilePacket;
38  
39  /**
40   * 
41   * This class is inherits from DefaultFileUploadThread, in order to allow execution of JUnit tests on the
42   * DefaultFileUploadThread class.
43   * 
44   * All abstract method are implemented without actions.
45   * 
46   * @author etienne_sf
47   *
48   */
49  public class DefaultFileUploadThreadTestHelper extends DefaultFileUploadThread {
50  
51      /**
52       * @param threadName
53       * @param packetQueue
54       * @param uploadPolicy
55       * @param fileUploadManagerThread
56       */
57      public DefaultFileUploadThreadTestHelper(String threadName,
58              BlockingQueue<UploadFilePacket> packetQueue,
59              UploadPolicy uploadPolicy,
60              FileUploadManagerThread fileUploadManagerThread) {
61          super(threadName, packetQueue, uploadPolicy, fileUploadManagerThread);
62          // TODO Auto-generated constructor stub
63      }
64  
65      /**
66       * @see wjhk.jupload2.upload.DefaultFileUploadThread#getAdditionnalBytesForUpload(wjhk.jupload2.upload.UploadFileData)
67       */
68      @Override
69      long getAdditionnalBytesForUpload(UploadFileData uploadFileData)
70              throws JUploadIOException {
71          // TODO Auto-generated method stub
72          return 0;
73      }
74  
75      /**
76       * @see wjhk.jupload2.upload.DefaultFileUploadThread#beforeRequest(wjhk.jupload2.upload.UploadFilePacket)
77       */
78      @Override
79      void beforeRequest(UploadFilePacket packet) throws JUploadException {
80          // TODO Auto-generated method stub
81  
82      }
83  
84      /**
85       * @see wjhk.jupload2.upload.DefaultFileUploadThread#startRequest(long, boolean, int, boolean)
86       */
87      @Override
88      void startRequest(long contentLength, boolean bChunkEnabled, int chunkPart,
89              boolean bLastChunk) throws JUploadException {
90          // TODO Auto-generated method stub
91  
92      }
93  
94      /**
95       * @see wjhk.jupload2.upload.DefaultFileUploadThread#finishRequest()
96       */
97      @Override
98      int finishRequest() throws JUploadException {
99          // TODO Auto-generated method stub
100         return 0;
101     }
102 
103     /**
104      * @see wjhk.jupload2.upload.DefaultFileUploadThread#interruptionReceived()
105      */
106     @Override
107     void interruptionReceived() {
108         // TODO Auto-generated method stub
109 
110     }
111 
112     /**
113      * @see wjhk.jupload2.upload.DefaultFileUploadThread#beforeFile(wjhk.jupload2.upload.UploadFilePacket, wjhk.jupload2.upload.UploadFileData)
114      */
115     @Override
116     void beforeFile(UploadFilePacket uploadFilePacket,
117             UploadFileData uploadFileData) throws JUploadException {
118         // TODO Auto-generated method stub
119 
120     }
121 
122     /**
123      * @see wjhk.jupload2.upload.DefaultFileUploadThread#afterFile(wjhk.jupload2.upload.UploadFileData)
124      */
125     @Override
126     void afterFile(UploadFileData uploadFileData) throws JUploadException {
127         // TODO Auto-generated method stub
128 
129     }
130 
131     /**
132      * @see wjhk.jupload2.upload.DefaultFileUploadThread#cleanRequest()
133      */
134     @Override
135     void cleanRequest() throws JUploadException {
136         // TODO Auto-generated method stub
137 
138     }
139 
140     /**
141      * @see wjhk.jupload2.upload.DefaultFileUploadThread#cleanAll()
142      */
143     @Override
144     void cleanAll() throws JUploadException {
145         // TODO Auto-generated method stub
146 
147     }
148 
149     /**
150      * @see wjhk.jupload2.upload.DefaultFileUploadThread#getOutputStream()
151      */
152     @Override
153     OutputStream getOutputStream() throws JUploadException {
154         // TODO Auto-generated method stub
155         return null;
156     }
157 
158 }