FileDocCategorySizeDatePackage
TestName.javaAPI DocApache Axis 1.43822Sat Apr 22 18:57:26 BST 2006test.types

TestName

public class TestName extends TestCase
Test validation of types.Name

Fields Summary
Constructors Summary
public TestName(String name)

        super(name);
    
Methods Summary
private voidrunFailTest(java.lang.String value)
Run a failure test. value should be invalid.

        Name oToken = null;
        try {
            oToken = new Name(value);
        }
        catch (Exception e) { // catch the validation exception
        }
        assertNull(
                "Name validation restriction failed. did not restrict bad value [" +
                   value + "] did not restrict bad value", oToken);
    
private voidrunPassTest(java.lang.String value)
Run a successful test. value should be valid.

        Name oToken = null;
        try {
            oToken = new Name(value);
        }
        catch (Exception e) { // catch the validation exception
        }
        assertEquals("Name strings not equal. orig value:" + value, oToken.toString(), value);
    
public voidtestDoubleSpace()
this is to differentiate from normalized string which cannot accept double spaces.

        runFailTest("a   B"); // note: \r fails
    
public voidtestLineFeed()
this is to differentiate from normalized string which cannot accept a \n

        runFailTest("line one\n line two");
    
public voidtestPunctuationString()
Test a simple string with allowed punctuation.

        runPassTest("Atlanta:_Braves.Home-Team10");
    
public voidtestSimpleString()
Test a simple string.

        runPassTest("Atlanta");
    
public voidtestStartColon()
Test a start character ':'

        runPassTest(":_Braves.Home-Team:1");
    
public voidtestStartDigit()
Test a start Digit

        runFailTest("1_Braves");
    
public voidtestStartUnderscore()
Test a start character '_'

        runPassTest("_Braves.Home-Team:1");
    
public voidtestStringWithLeadingAndTrailingSpaces()
this is to differentiate from normalized string which cannot accept leading and trailing spaces.

        runFailTest("          centered          ");
    
public voidtestStringWithLeadingSpaces()
this is to differentiate from normalized string which cannot accept leading spaces.

        runFailTest("  a failure case");
    
public voidtestStringWithTabs()
this is to differentiate from normalized string which cannot accept a \t

        runFailTest("this has \t a tab");
    
public voidtestStringWithTrailingSpaces()
this is to differentiate from normalized string which cannot accept trailing spaces.

        runFailTest("this is a  ");