au.csiro.netcdf
Class TestNcWriteVariable

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by au.csiro.netcdf.TestNcWriteVariable
All Implemented Interfaces:
junit.framework.Test

public class TestNcWriteVariable
extends junit.framework.TestCase

This class is a unit test suite to verify that the NcDefineDimension command operates correctly.

Copyright 2010, CSIRO Australia All rights reserved.

Version:
$Revision: 83 $ $Date: 2010-08-18 15:16:33 +1000 (Wed, 18 Aug 2010) $
Author:
Rita Chen on 23/03/2010

Constructor Summary
TestNcWriteVariable()
           
 
Method Summary
protected  void setUp()
           
protected  void tearDown()
           
 void testConvertStringsToRanges()
          Check that the convertStringsToRanges copes with ranges and single values.
 void testConvertStringsWithSpacesToRanges()
          Check that the convertStringsToRanges copes with strings with spaces.
 void testCreateOptions()
          Test that the commands options are used.
 void testCreateOriginListSingle()
          Test the creation of an origin list for a single range
 void testCreateOriginListThreeRange()
          Test the creation of an origin list for a three dimension range
 void testCreateOriginListTwoRange()
          Test the creation of an origin list for a two dimension range
 void testExecute()
           
 void testExecuteValidCommand()
          Test execute a valid NcWriteVariable command
 void testExecuteValidCommandwithDoubleVar()
          Test execute a valid NcWriteVariable command using Double datatype
 void testExecuteValidCommandwithIntVar()
          Test execute a valid NcWriteVariable command using Long datatype
 void testExecuteWithValidIuputFile()
          Test command execution with a valid input file
 void testFillInvalidRange()
          Test execute command by providing incorrect fillRange
 void testFillValidRange()
          Test validate command with a valid fillRange
 void testInvalidOptionType()
          Test invalid fillRange option
 void testLookupRangeChar()
          Test execute a valid character range lookup
 void testLookupRangeIntegral()
          Test execute a valid integral range lookup
 void testLookupRangeNumeric()
          Test execute a valid numeric range lookup
 void testMismatchedFillRange()
          Test execute with a number of entries in fillrange that does not match the variables dimensions
 void testMissingRequiredOption()
          Test required option
 void testSplitRange()
          Test the splitRange function can cope with negative lookups
 void testThreeDimNCVariable()
          Test create a Variable with three Dimensions
 void testValidIuputFileName()
          Test validate command with valid and invalid file names
 void testWriteDataBinary()
          Test execute a valid integral range lookup
 void testWriteToInvalidVariable()
          Test running command given an invalid Variable name.
 
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
 

Constructor Detail

TestNcWriteVariable

public TestNcWriteVariable()
Method Detail

setUp

protected void setUp()
              throws Exception
Overrides:
setUp in class junit.framework.TestCase
Throws:
Exception

tearDown

protected void tearDown()
                 throws Exception
Overrides:
tearDown in class junit.framework.TestCase
Throws:
Exception

testConvertStringsToRanges

public void testConvertStringsToRanges()
                                throws Exception
Check that the convertStringsToRanges copes with ranges and single values.

Throws:
Exception - If there is an unexpected issue

testConvertStringsWithSpacesToRanges

public void testConvertStringsWithSpacesToRanges()
                                          throws Exception
Check that the convertStringsToRanges copes with strings with spaces.

Throws:
Exception - If there is an unexpected issue

testSplitRange

public void testSplitRange()
Test the splitRange function can cope with negative lookups


testCreateOriginListSingle

public void testCreateOriginListSingle()
                                throws Exception
Test the creation of an origin list for a single range

Throws:
Exception - if the range is invalid

testCreateOriginListTwoRange

public void testCreateOriginListTwoRange()
                                  throws Exception
Test the creation of an origin list for a two dimension range

Throws:
Exception - if the range is invalid

testCreateOriginListThreeRange

public void testCreateOriginListThreeRange()
                                    throws Exception
Test the creation of an origin list for a three dimension range

Throws:
Exception - if the range is invalid

testExecute

public void testExecute()

testCreateOptions

public final void testCreateOptions()
Test that the commands options are used.


testMissingRequiredOption

public final void testMissingRequiredOption()
Test required option


testValidIuputFileName

public final void testValidIuputFileName()
Test validate command with valid and invalid file names


testExecuteWithValidIuputFile

public final void testExecuteWithValidIuputFile()
                                         throws Exception
Test command execution with a valid input file

Throws:
Exception

testInvalidOptionType

public final void testInvalidOptionType()
Test invalid fillRange option


testWriteToInvalidVariable

public final void testWriteToInvalidVariable()
                                      throws Exception
Test running command given an invalid Variable name.

Throws:
Exception

testFillValidRange

public final void testFillValidRange()
Test validate command with a valid fillRange


testFillInvalidRange

public final void testFillInvalidRange()
                                throws Exception
Test execute command by providing incorrect fillRange

Throws:
Exception

testMismatchedFillRange

public final void testMismatchedFillRange()
                                   throws Exception
Test execute with a number of entries in fillrange that does not match the variables dimensions

Throws:
Exception

testExecuteValidCommand

public final void testExecuteValidCommand()
                                   throws Exception
Test execute a valid NcWriteVariable command

Throws:
Exception

testExecuteValidCommandwithDoubleVar

public final void testExecuteValidCommandwithDoubleVar()
                                                throws Exception
Test execute a valid NcWriteVariable command using Double datatype

Throws:
Exception

testExecuteValidCommandwithIntVar

public final void testExecuteValidCommandwithIntVar()
                                             throws Exception
Test execute a valid NcWriteVariable command using Long datatype

Throws:
Exception

testThreeDimNCVariable

public final void testThreeDimNCVariable()
                                  throws Exception
Test create a Variable with three Dimensions

Throws:
Exception

testLookupRangeIntegral

public final void testLookupRangeIntegral()
Test execute a valid integral range lookup


testLookupRangeNumeric

public final void testLookupRangeNumeric()
Test execute a valid numeric range lookup


testLookupRangeChar

public final void testLookupRangeChar()
Test execute a valid character range lookup


testWriteDataBinary

public final void testWriteDataBinary()
Test execute a valid integral range lookup



Copyright © 2010. All Rights Reserved.