au.csiro.netcdf
Class TestNcDefineAttributes

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

public class TestNcDefineAttributes
extends junit.framework.TestCase

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

Copyright 2010, CSIRO Australia

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

Constructor Summary
TestNcDefineAttributes()
           
 
Method Summary
protected  void setUp()
           
protected  void tearDown()
           
 void testCreateOptions()
          Test that the commands options are used.
 void testDeleteGlobalAttribute()
          Test delete a global attribute
 void testDeleteVariableAttribute()
          Test delete a variable attribute
 void testExecuteExistingFile()
          Test a valid command creates a netCDF file with the specified Dimension name and size
 void testExecuteInvalidType()
          Test a valid command creates a netCDF file with an integer attribute
 void testExecuteNoAttr()
          Test a valid command creates a netCDF file with the specified Dimension name and size
 void testExecuteValidFloatAttr()
          Test a valid command creates a netCDF file with a float attribute
 void testExecuteValidIntAttr()
          Test a valid command creates a netCDF file with an integer attribute
 void testExecuteValidMultiAttr()
          Test a valid command creates a netCDF file with the specified Dimension name and size
 void testExecuteValidShortAttr()
          Test a valid command creates a netCDF file with a short attribute
 void testGetUsage()
          Test the command's usage string
 void testInvalidAttr()
          Test that an invalid attribute is rejected
 void testMissingAttr()
          Test that a missing optional attribute is accepted
 void testMissingRequiredOption()
          Test that required options are reported if missing
 void testStandardInputAttribute()
          Test setting global attribute via standard input
 void testStandardInputComplexAttribute()
          Test setting a complex global attribute via standard input
 void testVariableAttribute()
          Test adding attributes to an existing variable
 void testVariableAttributeNoVar()
          Test adding attributes to a non-existing variable
 
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

TestNcDefineAttributes

public TestNcDefineAttributes()
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.


testExecuteNoAttr

public final void testExecuteNoAttr()
Test a valid command creates a netCDF file with the specified Dimension name and size


testExecuteExistingFile

public final void testExecuteExistingFile()
Test a valid command creates a netCDF file with the specified Dimension name and size


testExecuteValidMultiAttr

public final void testExecuteValidMultiAttr()
Test a valid command creates a netCDF file with the specified Dimension name and size


testExecuteValidFloatAttr

public final void testExecuteValidFloatAttr()
                                     throws Exception
Test a valid command creates a netCDF file with a float attribute

Throws:
Exception - If there is an error running the test

testExecuteValidShortAttr

public final void testExecuteValidShortAttr()
                                     throws Exception
Test a valid command creates a netCDF file with a short attribute

Throws:
Exception - If there is an error running the test

testExecuteValidIntAttr

public final void testExecuteValidIntAttr()
                                   throws Exception
Test a valid command creates a netCDF file with an integer attribute

Throws:
Exception - If there is an error running the test

testExecuteInvalidType

public final void testExecuteInvalidType()
                                  throws Exception
Test a valid command creates a netCDF file with an integer attribute

Throws:
Exception - If there is an error running the test

testMissingRequiredOption

public final void testMissingRequiredOption()
Test that required options are reported if missing


testInvalidAttr

public final void testInvalidAttr()
Test that an invalid attribute is rejected


testMissingAttr

public final void testMissingAttr()
Test that a missing optional attribute is accepted


testGetUsage

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


testStandardInputAttribute

public final void testStandardInputAttribute()
                                      throws IOException
Test setting global attribute via standard input

Throws:
IOException

testStandardInputComplexAttribute

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

Throws:
IOException

testDeleteGlobalAttribute

public final void testDeleteGlobalAttribute()
                                     throws Exception
Test delete a global attribute

Throws:
Exception

testDeleteVariableAttribute

public final void testDeleteVariableAttribute()
                                       throws IOException
Test delete a variable attribute

Throws:
IOException

testVariableAttribute

public final void testVariableAttribute()
                                 throws IOException
Test adding attributes to an existing variable

Throws:
IOException

testVariableAttributeNoVar

public final void testVariableAttributeNoVar()
                                      throws Exception
Test adding attributes to a non-existing variable

Throws:
Exception


Copyright © 2010. All Rights Reserved.