au.csiro.netcdf
Class TestNcDefineVariable

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

public class TestNcDefineVariable
extends junit.framework.TestCase

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

Copyright 2010, CSIRO Australia All rights reserved.

Version:
$Revision: 78 $ $Date: 2010-07-24 16:23:13 +1000 (Sat, 24 Jul 2010) $
Author:
Martin Pienaar on 23/03/2010

Field Summary
static String VARIABLE_ATTRIBUTES
          The name of the command line option used for specifying the attributes of the variable.
 
Constructor Summary
TestNcDefineVariable()
           
 
Method Summary
protected  void setUp()
           
protected  void tearDown()
           
 void testCommandName()
          Make sure that the correct command name comes back.
 void testCreateOptions()
          Test that the commands options are used.
 void testFillVar()
          Test that fillVar being set to true pads the variable with the fillVar value.
 void testGetUsage()
          Test the command's usage string
 void testIllegalCreateOptions()
          Test that the commands options are used only when valid.
 void testInvalidVariableAttributesInExecuteCommand()
          Test invalid variableAttributes argument.
 void testMissingOutputFileNameInExecuteCommand()
          Test missing outputFileName argument.
 void testMissingRequiredOption()
          Test required arguments option
 void testNonExistentOutputFileNameInExecuteCommand()
          Test a non-existent outputFileName argument.
 void testStandardInputComplexAttribute()
          Test setting a complex global attribute via standard input
 void testValidCommand()
          Test a valid command creates a netCDF file with the specified Variable name
 void testValidVariableAttributesInExecuteCommand()
          Test valid variableAttributes argument.
 
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
 

Field Detail

VARIABLE_ATTRIBUTES

public static final String VARIABLE_ATTRIBUTES
The name of the command line option used for specifying the attributes of the variable.

See Also:
Constant Field Values
Constructor Detail

TestNcDefineVariable

public TestNcDefineVariable()
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

testCreateOptions

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


testIllegalCreateOptions

public final void testIllegalCreateOptions()
Test that the commands options are used only when valid.


testValidCommand

public final void testValidCommand()
                            throws Exception
Test a valid command creates a netCDF file with the specified Variable name

Throws:
Exception

testNonExistentOutputFileNameInExecuteCommand

public void testNonExistentOutputFileNameInExecuteCommand()
                                                   throws Exception
Test a non-existent outputFileName argument.

Throws:
Exception

testMissingOutputFileNameInExecuteCommand

public void testMissingOutputFileNameInExecuteCommand()
                                               throws Exception
Test missing outputFileName argument.

Throws:
Exception

testValidVariableAttributesInExecuteCommand

public void testValidVariableAttributesInExecuteCommand()
                                                 throws Exception
Test valid variableAttributes argument.

Throws:
Exception

testInvalidVariableAttributesInExecuteCommand

public void testInvalidVariableAttributesInExecuteCommand()
                                                   throws Exception
Test invalid variableAttributes argument.

Throws:
Exception

testFillVar

public final void testFillVar()
                       throws Exception
Test that fillVar being set to true pads the variable with the fillVar value. In the case of a String, the fillVar value is "" (null).

Throws:
Exception

testMissingRequiredOption

public final void testMissingRequiredOption()
Test required arguments option


testCommandName

public void testCommandName()
Make sure that the correct command name comes back.


testGetUsage

public final void testGetUsage()
Test the command's usage string


testStandardInputComplexAttribute

public final void testStandardInputComplexAttribute()
                                             throws IOException
Test setting a complex global attribute via standard input

Throws:
IOException


Copyright © 2010. All Rights Reserved.