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

TestNegativeInteger

public class TestNegativeInteger extends TestCase
Test validation of types.NonNegativeInteger

Fields Summary
Constructors Summary
public TestNegativeInteger(String name)

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

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

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

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

       runPassTest("-1");
    
public voidtestNegativeValue()
Test that a Negative value succeeeds

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

        runFailTest("123");