public class AbstractJUploadTestHelper extends Object
Modifier and Type | Field and Description |
---|---|
FileDataTreeViewModel |
fileDataTreeViewModel |
FilePanel |
filePanel
A default
FilePanel |
FilePanelFlatDataModel2 |
filePanelFlatDataModel2 |
FilePreparationThread |
filePreparationThread
A default
FilePreparationThread |
File |
fileroot
The root for the file to upload
|
List<FileData> |
filesToUpload
The list of files that will be loaded.
|
FileUploadManagerThread |
fileUploadManagerThread
A default
FileUploadManagerThread |
FileUploadThread |
fileUploadThread
A default
FileUploadThread |
JUploadContext |
juploadContext
A default
JUploadContext |
JUploadDaemon |
juploadDaemon
A default
JUploadDaemon |
JUploadPanel |
juploadPanel
A default
JUploadPanel |
protected org.apache.log4j.Logger |
logger
Logger for this class
|
int |
nbSubfoldersForSrcTestResourcesFiles
Indicates the number of subfolders, for the src/test/resources/files.
|
PacketConstructionThread |
packetConstructionThread
A default
PacketConstructionThread |
BlockingQueue<UploadFilePacket> |
packetQueue
A default queue, for the packets to upload
|
static boolean |
postURLHasBeenSet
Indicates whether the postURL system property has been set for the current unit test execution.
|
BlockingQueue<UploadFileData> |
preparedFileQueue
A default queue, for the prepared files
|
UploadPolicy |
uploadPolicy
A default
UploadPolicy |
long |
uploadStartTime
The actual start of this test
|
Constructor and Description |
---|
AbstractJUploadTestHelper() |
Modifier and Type | Method and Description |
---|---|
void |
cleanQueues() |
static File |
getTestFile(String relativeFilePath)
This static class computes create a file instance for the given relative path.
|
static String |
getTestFilePath(String relativeFilePath)
This method returns the absolute path for the given file.
|
static String |
getTestFilesRootPath()
Get the root for the tests files, whatever is the current tool used to run JUnit test: maven, eclipse, any IDE...
|
protected void |
setPostURL()
This method tries to determine if the current computer can access to jupload.sourceforge.net.
|
void |
setupFileList(int nbFiles)
Create a specific list of files, for tests, then set this list into the filePanel.
|
void |
setupFullUploadEnvironment()
Constructs the UploadPolicy, and all threads to simulate a real upload.
|
void |
testLastRegisteredUnload(Class expectedClass)
This method calls a given method onto a given object.
|
void |
testUnload(Object object,
String methodName)
This method calls a given method onto a given object.
|
protected final org.apache.log4j.Logger logger
public static boolean postURLHasBeenSet
public JUploadDaemon juploadDaemon
JUploadDaemon
public JUploadContext juploadContext
JUploadContext
public FilePanel filePanel
FilePanel
public FilePanelFlatDataModel2 filePanelFlatDataModel2
public FileDataTreeViewModel fileDataTreeViewModel
public JUploadPanel juploadPanel
JUploadPanel
public UploadPolicy uploadPolicy
UploadPolicy
public File fileroot
public List<FileData> filesToUpload
setupFileList(int)
.public FilePreparationThread filePreparationThread
FilePreparationThread
public PacketConstructionThread packetConstructionThread
PacketConstructionThread
public FileUploadThread fileUploadThread
FileUploadThread
public FileUploadManagerThread fileUploadManagerThread
FileUploadManagerThread
public long uploadStartTime
public BlockingQueue<UploadFileData> preparedFileQueue
public BlockingQueue<UploadFilePacket> packetQueue
public int nbSubfoldersForSrcTestResourcesFiles
public void setupFullUploadEnvironment() throws Exception
Exception
protected void setPostURL()
public void setupFileList(int nbFiles)
nbFiles
- public void cleanQueues()
public void testLastRegisteredUnload(Class expectedClass) throws IllegalArgumentException, IllegalAccessException, InvocationTargetException, SecurityException, NoSuchMethodException
JUploadContextTestHelper
expectedClass
- Contains the class to which the lastRegisterUnloadObject should belong to.InvocationTargetException
IllegalAccessException
IllegalArgumentException
NoSuchMethodException
SecurityException
public void testUnload(Object object, String methodName) throws IllegalArgumentException, IllegalAccessException, InvocationTargetException, SecurityException, NoSuchMethodException
object
- methodName
- InvocationTargetException
IllegalAccessException
IllegalArgumentException
NoSuchMethodException
SecurityException
public static File getTestFile(String relativeFilePath)
relativeFilePath
- The path of the file, starting from src/test/resources.public static String getTestFilePath(String relativeFilePath)
getTestFile(String)
method.relativeFilePath
- The path of the file, starting from src/test/resources.public static String getTestFilesRootPath()
Copyright © 2015. All rights reserved.