@@ -3669,4 +3669,187 @@ public void testListVpcPolicyResultResponseParser() {
36693669 Assert .assertTrue (false );
36703670 }
36713671 }
3672+
3673+ @ Test
3674+ public void testparseGetBucketInventoryConfig () {
3675+ InputStream instream = null ;
3676+ String respBody ;
3677+
3678+ respBody = "" +
3679+ "<InventoryConfiguration>\n " +
3680+ "</InventoryConfiguration>" ;
3681+
3682+ try {
3683+ instream = new ByteArrayInputStream (respBody .getBytes ("utf-8" ));
3684+ } catch (UnsupportedEncodingException e ) {
3685+ Assert .fail ("UnsupportedEncodingException" );
3686+ }
3687+
3688+ try {
3689+ ResponseParsers .parseGetBucketInventoryConfig (instream );
3690+ Assert .assertTrue (true );
3691+ } catch (ResponseParseException e ) {
3692+ Assert .assertTrue (false );
3693+ } catch (Exception e ) {
3694+ Assert .assertTrue (false );
3695+ }
3696+
3697+ respBody = "" +
3698+ "<InventoryConfiguration>\n " +
3699+ " <Filter>\n " +
3700+ " </Filter>\n " +
3701+ " <Schedule>\n " +
3702+ " </Schedule>\n " +
3703+ " <Destination>\n " +
3704+ " </Destination>\n " +
3705+ "</InventoryConfiguration>" ;
3706+
3707+ try {
3708+ instream = new ByteArrayInputStream (respBody .getBytes ("utf-8" ));
3709+ } catch (UnsupportedEncodingException e ) {
3710+ Assert .fail ("UnsupportedEncodingException" );
3711+ }
3712+
3713+ try {
3714+ ResponseParsers .parseGetBucketInventoryConfig (instream );
3715+ Assert .assertTrue (true );
3716+ } catch (ResponseParseException e ) {
3717+ Assert .assertTrue (false );
3718+ } catch (Exception e ) {
3719+ Assert .assertTrue (false );
3720+ }
3721+
3722+ respBody = "" +
3723+ "<InventoryConfiguration>\n " +
3724+ " <Filter>\n " +
3725+ " </Filter>\n " +
3726+ " <Schedule>\n " +
3727+ " </Schedule>\n " +
3728+ " <Destination>\n " +
3729+ " <OSSBucketDestination>\n " +
3730+ " </OSSBucketDestination>\n " +
3731+ " </Destination>\n " +
3732+ "</InventoryConfiguration>" ;
3733+
3734+ try {
3735+ instream = new ByteArrayInputStream (respBody .getBytes ("utf-8" ));
3736+ } catch (UnsupportedEncodingException e ) {
3737+ Assert .fail ("UnsupportedEncodingException" );
3738+ }
3739+
3740+ try {
3741+ ResponseParsers .parseGetBucketInventoryConfig (instream );
3742+ Assert .assertTrue (true );
3743+ } catch (ResponseParseException e ) {
3744+ Assert .assertTrue (false );
3745+ } catch (Exception e ) {
3746+ Assert .assertTrue (false );
3747+ }
3748+
3749+ respBody = "" +
3750+ "<InventoryConfiguration>\n " +
3751+ " <Filter>\n " +
3752+ " </Filter>\n " +
3753+ " <Schedule>\n " +
3754+ " </Schedule>\n " +
3755+ " <Destination>\n " +
3756+ " <OSSBucketDestination>\n " +
3757+ " <Encryption>\n " +
3758+ " </Encryption>\n " +
3759+ " </OSSBucketDestination>\n " +
3760+ " </Destination>\n " +
3761+ "</InventoryConfiguration>" ;
3762+
3763+ try {
3764+ instream = new ByteArrayInputStream (respBody .getBytes ("utf-8" ));
3765+ } catch (UnsupportedEncodingException e ) {
3766+ Assert .fail ("UnsupportedEncodingException" );
3767+ }
3768+
3769+ try {
3770+ ResponseParsers .parseGetBucketInventoryConfig (instream );
3771+ Assert .assertTrue (true );
3772+ } catch (ResponseParseException e ) {
3773+ Assert .assertTrue (false );
3774+ } catch (Exception e ) {
3775+ Assert .assertTrue (false );
3776+ }
3777+
3778+ respBody = "invalid" ;
3779+
3780+ try {
3781+ instream = new ByteArrayInputStream (respBody .getBytes ("utf-8" ));
3782+ } catch (UnsupportedEncodingException e ) {
3783+ Assert .fail ("UnsupportedEncodingException" );
3784+ }
3785+
3786+ try {
3787+ ResponseParsers .parseGetBucketInventoryConfig (instream );
3788+ Assert .assertTrue (false );
3789+ } catch (ResponseParseException e ) {
3790+ Assert .assertTrue (true );
3791+ } catch (Exception e ) {
3792+ Assert .assertTrue (false );
3793+ }
3794+
3795+ try {
3796+ ResponseParsers .parseGetBucketInventoryConfig (null );
3797+ Assert .assertTrue (false );
3798+ } catch (ResponseParseException e ) {
3799+ Assert .assertTrue (true );
3800+ } catch (Exception e ) {
3801+ Assert .assertTrue (false );
3802+ }
3803+ }
3804+
3805+ @ Test
3806+ public void testparseListBucketInventoryConfigurations () {
3807+ InputStream instream = null ;
3808+ String respBody ;
3809+
3810+ respBody = "" +
3811+ "<ListInventoryConfiguration>\n " +
3812+ "</ListInventoryConfiguration>" ;
3813+
3814+ try {
3815+ instream = new ByteArrayInputStream (respBody .getBytes ("utf-8" ));
3816+ } catch (UnsupportedEncodingException e ) {
3817+ Assert .fail ("UnsupportedEncodingException" );
3818+ }
3819+
3820+ try {
3821+ ResponseParsers .parseListBucketInventoryConfigurations (instream );
3822+ Assert .assertTrue (true );
3823+ } catch (ResponseParseException e ) {
3824+ Assert .assertTrue (false );
3825+ } catch (Exception e ) {
3826+ Assert .assertTrue (false );
3827+ }
3828+
3829+ respBody = "invalid" ;
3830+
3831+ try {
3832+ instream = new ByteArrayInputStream (respBody .getBytes ("utf-8" ));
3833+ } catch (UnsupportedEncodingException e ) {
3834+ Assert .fail ("UnsupportedEncodingException" );
3835+ }
3836+
3837+ try {
3838+ ResponseParsers .parseListBucketInventoryConfigurations (instream );
3839+ Assert .assertTrue (false );
3840+ } catch (ResponseParseException e ) {
3841+ Assert .assertTrue (true );
3842+ } catch (Exception e ) {
3843+ Assert .assertTrue (false );
3844+ }
3845+
3846+ try {
3847+ ResponseParsers .parseListBucketInventoryConfigurations (null );
3848+ Assert .assertTrue (false );
3849+ } catch (ResponseParseException e ) {
3850+ Assert .assertTrue (true );
3851+ } catch (Exception e ) {
3852+ Assert .assertTrue (false );
3853+ }
3854+ }
36723855}
0 commit comments