Package test.sample.invalid

Examples of test.sample.invalid.NullParameterForRequiredBeanArray


    }
   
    public void testNullParameterForRequiredBeanArray() throws Exception
    {
        final Element element = this.getRootElement( "/incorrect/test9.xml" );
        final NullParameterForRequiredBeanArray cfg = XML2Java.bind( element, NullParameterForRequiredBeanArray.class );

        this.assertArrayValues( cfg );
        try
        {
            cfg.setProperties( null );
            Assert.fail( "This test method had to fail!" );
        }
        catch ( Exception e )
        {
            final String[] expectedSubstrings = new String[]
            {
                "Cannot accept null value for bean",
                "marked as required",
            };
            Helper.assertContains( e, expectedSubstrings );
        }
        this.assertArrayValues( cfg );
        try
        {
            cfg.setProperties( new Integer[] {} );
            Assert.fail( "This test method had to fail!" );
        }
        catch ( Exception e )
        {
            final String[] expectedSubstrings = new String[]
            {
                "Cannot accept zero length array for bean",
                "marked as required. Array size have to be at least 1",
            };
            Helper.assertContains( e, expectedSubstrings );
        }
        this.assertArrayValues( cfg );
        try
        {
            final Integer[] newValues = new Integer[]
            {
                1, null,
            };
            cfg.setProperties( newValues );
            Assert.fail( "This test method had to fail!" );
        }
        catch ( Exception e )
        {
            final String[] expectedSubstrings = new String[]
View Full Code Here

TOP

Related Classes of test.sample.invalid.NullParameterForRequiredBeanArray

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.