edu.sdsc.inca.util
Class ExpandablePatternTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by edu.sdsc.inca.util.ExpandablePatternTest
All Implemented Interfaces:
junit.framework.Test

public class ExpandablePatternTest
extends junit.framework.TestCase

A JUnit for the ExpandablePattern class.


Constructor Summary
ExpandablePatternTest()
           
 
Method Summary
 java.lang.String compare(java.util.HashSet h, java.lang.String[] correct)
          Tests a HashSet to see if it contains the expected members.
 void testAlternation()
          Tests expand for alternation.
 void testAlternationAndCatenation()
          Tests expand for a mix of alternation and catenation.
 void testCharSets()
          Tests expand for character sets.
 void testConcatenation()
          Tests expand for concatenation.
 void testDuplicates()
          Tests expand for duplicate filtering.
 void testEmptyPattern()
          Tests expand for an empty pattern.
 void testEscape()
          Tests escaping of special characters.
 void testGlob()
          Tests that translation from glob to regexp is done correctly.
 void testInfinite()
          Tests expand for patterns that match an infinite set of strings.
 void testNesting()
          Tests expand for nesting.
 void testNumericEscape()
          Tests numeric escape characters.
 void testOptional()
          Tests expand for the ? qualifier.
 void testRange()
          Tests expand for the {} qualifier.
 void testSimplePattern()
          Tests expand for a simple pattern.
 void testSpecialEscape()
          Tests special escape characters.
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, setUp, tearDown, 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

ExpandablePatternTest

public ExpandablePatternTest()
Method Detail

compare

public java.lang.String compare(java.util.HashSet h,
                                java.lang.String[] correct)
Tests a HashSet to see if it contains the expected members.

Parameters:
h - the HashSet to test
correct - the strings expected to be found in the HashSet
Returns:
null on success, an error message otherwise

testGlob

public void testGlob()
Tests that translation from glob to regexp is done correctly.


testEmptyPattern

public void testEmptyPattern()
                      throws java.lang.Exception
Tests expand for an empty pattern.

Throws:
java.lang.Exception

testSimplePattern

public void testSimplePattern()
                       throws java.lang.Exception
Tests expand for a simple pattern.

Throws:
java.lang.Exception

testConcatenation

public void testConcatenation()
                       throws java.lang.Exception
Tests expand for concatenation.

Throws:
java.lang.Exception

testAlternation

public void testAlternation()
                     throws java.lang.Exception
Tests expand for alternation.

Throws:
java.lang.Exception

testAlternationAndCatenation

public void testAlternationAndCatenation()
                                  throws java.lang.Exception
Tests expand for a mix of alternation and catenation.

Throws:
java.lang.Exception

testNesting

public void testNesting()
                 throws java.lang.Exception
Tests expand for nesting.

Throws:
java.lang.Exception

testDuplicates

public void testDuplicates()
                    throws java.lang.Exception
Tests expand for duplicate filtering.

Throws:
java.lang.Exception

testOptional

public void testOptional()
                  throws java.lang.Exception
Tests expand for the ? qualifier.

Throws:
java.lang.Exception

testRange

public void testRange()
               throws java.lang.Exception
Tests expand for the {} qualifier.

Throws:
java.lang.Exception

testInfinite

public void testInfinite()
                  throws java.lang.Exception
Tests expand for patterns that match an infinite set of strings.

Throws:
java.lang.Exception

testEscape

public void testEscape()
                throws java.lang.Exception
Tests escaping of special characters.

Throws:
java.lang.Exception

testSpecialEscape

public void testSpecialEscape()
                       throws java.lang.Exception
Tests special escape characters.

Throws:
java.lang.Exception

testNumericEscape

public void testNumericEscape()
                       throws java.lang.Exception
Tests numeric escape characters.

Throws:
java.lang.Exception

testCharSets

public void testCharSets()
                  throws java.lang.Exception
Tests expand for character sets.

Throws:
java.lang.Exception