Package com.microsoft.windowsazure.management.util

Examples of com.microsoft.windowsazure.management.util.TestRequestFilter


        // reinitialize configuration from known state
        Configuration config = createConfiguration();

        managementClient = ManagementService.create(config);
       
        TestRequestFilter testFilter = new TestRequestFilter("filter1a");
        ManagementClient filteredService = managementClient.withRequestFilterLast(testFilter);
       
        // Executing operation on the filtered service should execute the filter
        AffinityGroupListResponse response = filteredService.getAffinityGroupsOperations().list();
       
        Assert.assertEquals(200, response.getStatusCode());
        Assert.assertEquals(1, testFilter.getCalled());
       
        // Make sure the filter executes twice
        response = filteredService.getAffinityGroupsOperations().list();
       
        Assert.assertEquals(200, response.getStatusCode());
        Assert.assertEquals(2, testFilter.getCalled());
    }
View Full Code Here


            }
        });

        managementClient = ManagementService.create(config);
       
        TestRequestFilter testFilter1 = new TestRequestFilter("filter1b");
        TestRequestFilter testFilter2 = new TestRequestFilter("filter2b");
        ManagementClient filteredService = managementClient.withRequestFilterLast(testFilter1);
        filteredService = filteredService.withRequestFilterLast(testFilter2);
       
        // Executing operation on the filtered service should execute the filter
        AffinityGroupListResponse response = filteredService.getAffinityGroupsOperations().list();
       
        Assert.assertEquals(200, response.getStatusCode());
        Assert.assertEquals(0, testFilter1.getCalled());
        Assert.assertEquals(1, testFilter2.getCalled());
       
        // Make sure the filter executes twice
        response = filteredService.getAffinityGroupsOperations().list();
       
        Assert.assertEquals(200, response.getStatusCode());
        Assert.assertEquals(0, testFilter1.getCalled());
        Assert.assertEquals(2, testFilter2.getCalled());
    }
View Full Code Here

            }
        });

        managementClient = ManagementService.create(config);
       
        TestRequestFilter testFilter1 = new TestRequestFilter("filter1c");
        TestRequestFilter testFilter2 = new TestRequestFilter("filter2c");
        ManagementClient filteredService = managementClient.withRequestFilterFirst(testFilter1);
        filteredService = filteredService.withRequestFilterFirst(testFilter2);
       
        // Executing operation on the filtered service should execute the filter
        AffinityGroupListResponse response = filteredService.getAffinityGroupsOperations().list();
       
        Assert.assertEquals(200, response.getStatusCode());
        Assert.assertEquals(1, testFilter1.getCalled());
        Assert.assertEquals(0, testFilter2.getCalled());
       
        // Make sure the filter executes twice
        response = filteredService.getAffinityGroupsOperations().list();
       
        Assert.assertEquals(200, response.getStatusCode());
        Assert.assertEquals(2, testFilter1.getCalled());
        Assert.assertEquals(0, testFilter2.getCalled());
    }
View Full Code Here

TOP

Related Classes of com.microsoft.windowsazure.management.util.TestRequestFilter

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.