jpl.pds.server
Class RawFileHandlerTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by jpl.pds.server.RawFileHandlerTest
All Implemented Interfaces:
junit.framework.Test

public class RawFileHandlerTest
extends junit.framework.TestCase

Unit tests for RawFileHandler.

Author:
Kelly.

Field Summary
protected static String LABEL_FILE_NAME
          Name of label file.
protected  File labelFile
          Temporary label file for testing.
protected  File tempDir
          Temporary product dir for testing.
protected static String[] TEST_FILES
          Name of test files.
protected  File[] testFiles
          Temporary test data files for testing.
 
Constructor Summary
RawFileHandlerTest(String name)
          Creates a new RawFileHandlerTest instance.
 
Method Summary
protected  jpl.eda.xmlquery.XMLQuery createQuery(String filename)
          Create an XML query for a named file.
 void setUp()
           
 void tearDown()
           
 void testHandler()
          Test the raw file handler.
 void testTimer()
          This test exposes an OutOfMemoryError in CVS version 1.2 of ChunkedFileHandler.java.
 
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, failNotEquals, failNotSame, failSame, format
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

tempDir

protected File tempDir
Temporary product dir for testing.


labelFile

protected File labelFile
Temporary label file for testing.


testFiles

protected File[] testFiles
Temporary test data files for testing.


LABEL_FILE_NAME

protected static final String LABEL_FILE_NAME
Name of label file.

See Also:
Constant Field Values

TEST_FILES

protected static final String[] TEST_FILES
Name of test files.

Constructor Detail

RawFileHandlerTest

public RawFileHandlerTest(String name)
Creates a new RawFileHandlerTest instance.

Parameters:
name - a String value.
Method Detail

setUp

public void setUp()
           throws Exception
Throws:
Exception

tearDown

public void tearDown()
              throws Exception
Throws:
Exception

testHandler

public void testHandler()
Test the raw file handler.


testTimer

public void testTimer()
               throws IOException
This test exposes an OutOfMemoryError in CVS version 1.2 of ChunkedFileHandler.java. All those expiration task objects that get created, canceled, and newly created causes an array in java.util.Timer to grow and grow and grow. Version 1.3 fixes the problem. You can enable this test case (change "false" to "true") and verify. It's "false" now because it takes awhile to run.

Throws:
IOException - if an error occurs.

createQuery

protected jpl.eda.xmlquery.XMLQuery createQuery(String filename)
Create an XML query for a named file.

Parameters:
filename - Name of file.
Returns:
a XMLQuery value.


Copyright © 2005-2012 Planetary Data System. All Rights Reserved.