FileDocCategorySizeDatePackage
TestNonPositiveInteger.javaAPI DocApache Axis 1.42561Sat Apr 22 18:57:28 BST 2006test.types

TestNonPositiveInteger

public class TestNonPositiveInteger extends TestCase
Test validation of types.NonNegativeInteger

Fields Summary
Constructors Summary
public TestNonPositiveInteger(String name)

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

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

        NonPositiveInteger oNonPositiveInteger = null;
        try {
            oNonPositiveInteger = new NonPositiveInteger(value);
        }
        catch (Exception e) { // catch the validation exception
        }
        assertEquals("unsigned int not equal" +
                value, oNonPositiveInteger.toString(), value);
    
public voidtestAboveMaxInclusive()
Test that a number above MaxInclusive fails

       runFailTest("1");
    
public voidtestMaxInclusive()
Test that a number at MaxInclusive succeeds

       runPassTest("0");
    
public voidtestPositiveValue()
Test that a positive number fails

        runFailTest("123");
    
public voidtestnonPositiveValue()
Test that a Negative value succeeeds

        runPassTest("-12345678901234567890");