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

TestPositiveInteger

public class TestPositiveInteger extends TestCase
Test validation of types.positiveInteger

Fields Summary
Constructors Summary
public TestPositiveInteger(String name)

        super(name);
    
Methods Summary
public voidTestPositiveValue()
Test that a positive value succeeeds

        runPassTest("12345678901234567890");
    
private voidrunFailTest(java.lang.String value)
Run a failure test. value should be invalid.

        PositiveInteger oPositiveInteger = null;
        try {
            oPositiveInteger = new PositiveInteger(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.", oPositiveInteger);
    
private voidrunPassTest(java.lang.String value)
Run a successful test. value should be valid.

        PositiveInteger oPositiveInteger = null;
        try {
            oPositiveInteger = new PositiveInteger(value);
        }
        catch (Exception e) { // catch the validation exception
        }
        assertEquals("positive integer not equal" +
                value, oPositiveInteger.toString(), value);
    
public voidtestBelowMinExclusive()
Test that a number less than MinInclusive fails

       runFailTest("0");
    
public voidtestMinExclusive()
Test that a number at MinInclusive succeeds

       runPassTest("1");
    
public voidtestNegativeValue()
Test that a negative number fails

        runFailTest("-123");