View Javadoc
1   //
2   // $Id$
3   //
4   // jupload - A file upload applet.
5   //
6   // Copyright 2010 The JUpload Team
7   //
8   // Created: 3 fevr. 2010
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.testhelpers;
27  
28  import java.util.concurrent.BlockingQueue;
29  
30  import wjhk.jupload2.exception.JUploadException;
31  import wjhk.jupload2.policies.UploadPolicy;
32  import wjhk.jupload2.upload.FileUploadManagerThread;
33  import wjhk.jupload2.upload.FileUploadThread;
34  import wjhk.jupload2.upload.UploadFilePacket;
35  
36  /**
37   * @author etienne_sf
38   * 
39   */
40  public class FileUploadThreadTestHelper extends Thread implements
41  		FileUploadThread {
42  	/** */
43  	public BlockingQueue<UploadFilePacket> packetQueue;
44  	/** */
45  	public FileUploadManagerThread fileUploadManagerThread;
46  	/** */
47  	public String responseMsg = UploadPolicy.PROP_STRING_UPLOAD_SUCCESS;
48  
49  	/**
50  	 * @param packetQueue
51  	 */
52  	public FileUploadThreadTestHelper(BlockingQueue<UploadFilePacket> packetQueue) {
53  		this.packetQueue = packetQueue;
54  	}
55  
56  	/**
57  	 * @see wjhk.jupload2.upload.FileUploadThread#close()
58  	 */
59  	public void close() {
60  		// Nothing to do
61  	}
62  
63  	/**
64  	 * @see wjhk.jupload2.upload.FileUploadThread#getPacketQueue()
65  	 */
66  	public BlockingQueue<UploadFilePacket> getPacketQueue() {
67  		return this.packetQueue;
68  	}
69  
70  	/**
71  	 * @see wjhk.jupload2.upload.FileUploadThread#getResponseMsg()
72  	 */
73  	public String getResponseMsg() {
74  		return this.responseMsg;
75  	}
76  
77  	/**
78  	 * @see wjhk.jupload2.upload.FileUploadThread#setFileUploadThreadManager(wjhk.jupload2.upload.FileUploadManagerThread)
79  	 */
80  	public void setFileUploadThreadManager(
81  			FileUploadManagerThread fileUploadManagerThread)
82  			throws JUploadException {
83  		this.fileUploadManagerThread = fileUploadManagerThread;
84  	}
85  
86  }