org.ourgrid.gridmachine.useragent.test
Class UserAgentClientTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.ourgrid.gridmachine.useragent.test.UserAgentClientTest
All Implemented Interfaces:
junit.framework.Test, GumPreCommitTest, PreCommitTest, SelectiveTest, StressTest, UniqueTest

public class UserAgentClientTest
extends junit.framework.TestCase
implements GumPreCommitTest, UniqueTest

Tests just a little part of the UserAgentClient class, exactly at methods where exists some information process. This little test range is because of the tested class functions just like a proxy to GridMachines.


Field Summary
static java.lang.String TEST_ALL_TEST_TYPE
           
 
Constructor Summary
UserAgentClientTest(java.lang.String name)
          Creates a default Processor object that will be used at all the test without tests.
 
Method Summary
protected  void setUp()
          Set up the environment to run one test!
protected  void tearDown()
          Clean what it have to clean!
 void testGetFile()
          Tests the GetFile method...
 void testPutAndStoreFilesWithGuMTypeLinux()
          Tests if a put and store file occurs with success in a linux GuM.
 void testPutAndStoreFilesWithGuMTypeWindows()
          Tests if a put and store file occurs with success in a windows GuM.
 void testPutFile_MultipleOfReadBlock_Size()
          Tests if the putFile algorithm is fragmenting correctly the file! In this case test for a file that has exactly the lenght of the block and 2 times it.
 void testPutFile_Size0()
          Tests if the putFile algorithm is fragmenting correctly the file! In this case test for an empty file.
 void testPutFileStreamCloseWithException()
          Tests if the stream is closed.
 void testPutFileStreamCloseWithoutException()
          Tests if the stream is closed.
 void testRealGetFile()
          Tests the GetFile method...
 void testRealPutFile_MultipleOfReadBlock_Size()
          Tests if the putFile algorithm is fragmenting correctly the file! In this case test for a file that has exactly the lenght of the block and 2 times it.
 void testRealPutFile_Size0()
          Tests if the putFile algorithm is fragmenting correctly the file! In this case test for an empty file.
 void testRealPutFileStreamCloseWithException()
          Tests if the stream is closed.
 void testRealPutFileStreamCloseWithoutException()
          Tests if the stream is closed.
 void testRealStoreCloseWithException()
          Tests if the RandomAccessFile is not open when File does not exist.
 void testRealStoreCloseWithoutException()
          Tests if the RandomAccessFile is closed and the FileLock is not released.
 void testStoreCloseWithException()
          Tests if the RandomAccessFile is not open when File does not exist.
 void testStoreCloseWithoutException()
          Tests if the RandomAccessFile is closed and the FileLock is not released.
 void testUserAgerClient()
           
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface junit.framework.Test
countTestCases, run
 

Field Detail

TEST_ALL_TEST_TYPE

public static final java.lang.String TEST_ALL_TEST_TYPE
See Also:
Constant Field Values
Constructor Detail

UserAgentClientTest

public UserAgentClientTest(java.lang.String name)
Creates a default Processor object that will be used at all the test without tests.

Method Detail

setUp

protected void setUp()
              throws java.lang.Exception
Set up the environment to run one test!

Overrides:
setUp in class junit.framework.TestCase
Throws:
java.lang.Exception

tearDown

protected void tearDown()
                 throws java.lang.Exception
Clean what it have to clean!

Overrides:
tearDown in class junit.framework.TestCase
Throws:
java.lang.Exception

testUserAgerClient

public void testUserAgerClient()
                        throws java.lang.Exception
Throws:
java.lang.Exception

testPutFile_Size0

public void testPutFile_Size0()
                       throws UnavailableGumException,
                              FileTransferException,
                              java.rmi.RemoteException
Tests if the putFile algorithm is fragmenting correctly the file! In this case test for an empty file.

Throws:
UnavailableGumException
FileTransferException
java.rmi.RemoteException

testPutFile_MultipleOfReadBlock_Size

public void testPutFile_MultipleOfReadBlock_Size()
                                          throws java.io.IOException
Tests if the putFile algorithm is fragmenting correctly the file! In this case test for a file that has exactly the lenght of the block and 2 times it.

Throws:
java.io.IOException

testPutFileStreamCloseWithException

public void testPutFileStreamCloseWithException()
                                         throws java.io.IOException
Tests if the stream is closed. The stream must be closed when an exception occurs. The idea is to avoid the "too many open files" message bothers the users!

Throws:
java.io.IOException

testPutFileStreamCloseWithoutException

public void testPutFileStreamCloseWithoutException()
                                            throws java.io.IOException
Tests if the stream is closed. The stream must be closed even when no exception occurs. The idea is to avoid the "too many open files" message bothers the users!

Throws:
java.io.IOException

testGetFile

public void testGetFile()
                 throws java.rmi.RemoteException
Tests the GetFile method... It is testing just about the thrown exeptions at some times like: the local dir does not exist, or has not permition to write in it...

Throws:
java.rmi.RemoteException

testStoreCloseWithoutException

public void testStoreCloseWithoutException()
                                    throws java.io.IOException,
                                           UnableToExecuteException,
                                           UnavailableGumException,
                                           FileTransferException,
                                           java.io.FileNotFoundException
Tests if the RandomAccessFile is closed and the FileLock is not released. The file must be closed even if the exception does not occur. The idea is to avoid the "too many open files" and "Bad Descriptor File" errors hang the entire system. The similar behavior will occurs if the FileLock is not released. Therefore, CLOSE and RELEASE!!! TESTS: BID #136

Throws:
java.io.IOException
UnavailableGumException
java.io.FileNotFoundException
FileTransferException
UnableToExecuteException

testPutAndStoreFilesWithGuMTypeWindows

public void testPutAndStoreFilesWithGuMTypeWindows()
                                            throws UnableToExecuteException,
                                                   UnavailableGumException,
                                                   FileTransferException,
                                                   java.io.FileNotFoundException,
                                                   java.rmi.RemoteException
Tests if a put and store file occurs with success in a windows GuM.

Throws:
java.io.FileNotFoundException
UnavailableGumException
FileTransferException
java.io.FileNotFoundException
UnableToExecuteException
java.rmi.RemoteException

testPutAndStoreFilesWithGuMTypeLinux

public void testPutAndStoreFilesWithGuMTypeLinux()
                                          throws UnableToExecuteException,
                                                 UnavailableGumException,
                                                 FileTransferException,
                                                 java.io.FileNotFoundException,
                                                 java.rmi.RemoteException
Tests if a put and store file occurs with success in a linux GuM.

Throws:
java.io.FileNotFoundException
UnavailableGumException
FileTransferException
java.io.FileNotFoundException
UnableToExecuteException
java.rmi.RemoteException

testStoreCloseWithException

public void testStoreCloseWithException()
                                 throws java.rmi.RemoteException
Tests if the RandomAccessFile is not open when File does not exist. TESTS: BID #136

Throws:
java.rmi.RemoteException

testRealPutFile_Size0

public void testRealPutFile_Size0()
                           throws java.rmi.RemoteException,
                                  java.io.IOException,
                                  UnavailableGumException,
                                  FileTransferException
Tests if the putFile algorithm is fragmenting correctly the file! In this case test for an empty file.

Throws:
UnavailableGumException
FileTransferException
java.rmi.RemoteException
java.io.IOException

testRealPutFile_MultipleOfReadBlock_Size

public void testRealPutFile_MultipleOfReadBlock_Size()
                                              throws java.io.IOException
Tests if the putFile algorithm is fragmenting correctly the file! In this case test for a file that has exactly the lenght of the block and 2 times it.

Throws:
java.io.IOException

testRealPutFileStreamCloseWithException

public void testRealPutFileStreamCloseWithException()
                                             throws java.io.IOException
Tests if the stream is closed. The stream must be closed when an exception occurs. The idea is to avoid the "too many open files" message bothers the users!

Throws:
java.io.IOException

testRealPutFileStreamCloseWithoutException

public void testRealPutFileStreamCloseWithoutException()
                                                throws java.io.IOException
Tests if the stream is closed. The stream must be closed even when no exception occurs. The idea is to avoid the "too many open files" message bothers the users!

Throws:
java.io.IOException

testRealGetFile

public void testRealGetFile()
                     throws java.rmi.RemoteException
Tests the GetFile method... It is testing just about the thrown exeptions at some times like: the local dir does not exist, or has not permition to write in it...

Throws:
java.rmi.RemoteException

testRealStoreCloseWithoutException

public void testRealStoreCloseWithoutException()
                                        throws java.io.IOException,
                                               UnableToExecuteException,
                                               UnavailableGumException,
                                               FileTransferException,
                                               java.io.FileNotFoundException
Tests if the RandomAccessFile is closed and the FileLock is not released. The file must be closed even if the exception does not occur. The idea is to avoid the "too many open files" and "Bad Descriptor File" errors hang the entire system. The similar behavior will occurs if the FileLock is not released. Therefore, CLOSE and RELEASE!!! TESTS: BID #136

Throws:
java.io.IOException
UnavailableGumException
java.io.FileNotFoundException
FileTransferException
UnableToExecuteException

testRealStoreCloseWithException

public void testRealStoreCloseWithException()
                                     throws java.lang.Exception
Tests if the RandomAccessFile is not open when File does not exist. TESTS: BID #136

Throws:
java.rmi.RemoteException
UnavailableGumException
java.io.FileNotFoundException
FileTransferException
UnableToExecuteException
java.lang.Exception