當前位置: 首頁>>代碼示例>>Java>>正文


Java DescribeInstancesResult.setReservations方法代碼示例

本文整理匯總了Java中com.amazonaws.services.ec2.model.DescribeInstancesResult.setReservations方法的典型用法代碼示例。如果您正苦於以下問題:Java DescribeInstancesResult.setReservations方法的具體用法?Java DescribeInstancesResult.setReservations怎麽用?Java DescribeInstancesResult.setReservations使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.amazonaws.services.ec2.model.DescribeInstancesResult的用法示例。


在下文中一共展示了DescribeInstancesResult.setReservations方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: testTagsAssociated

import com.amazonaws.services.ec2.model.DescribeInstancesResult; //導入方法依賴的package包/類
@Test
     public void testTagsAssociated() {
    MockAmazonEc2Client client = new MockAmazonEc2Client(null);
    Collection<Instance> instances = Arrays.asList(new Instance());
    DescribeInstancesResult describeInstancesResult = new DescribeInstancesResult();
    Reservation reservation = new Reservation();
    describeInstancesResult.setReservations(Arrays.asList(reservation));
    reservation.setInstances(instances);
    client.setDescribeInstances(describeInstancesResult);
    Properties properties = new Properties();
    properties.setProperty("tagAccounting","key,value");
    properties.setProperty("function_tag","foo2");
    properties.setProperty("product_tag","foo3");
    AwsTagReporter reporter = new AwsTagReporter("testUuid",client,instances,properties);
    reporter.run();
}
 
開發者ID:RetailMeNot,項目名稱:SeleniumGridScaler,代碼行數:17,代碼來源:AwsTagReporterTest.java

示例2: testExceptionCaught

import com.amazonaws.services.ec2.model.DescribeInstancesResult; //導入方法依賴的package包/類
@Test
public void testExceptionCaught() {
    MockAmazonEc2Client client = new MockAmazonEc2Client(null);
    Collection<Instance> instances = Arrays.asList(new Instance());
    DescribeInstancesResult describeInstancesResult = new DescribeInstancesResult();
    Reservation reservation = new Reservation();
    describeInstancesResult.setReservations(Arrays.asList(reservation));
    reservation.setInstances(instances);
    client.setDescribeInstances(describeInstancesResult);
    Properties properties = new Properties();
    properties.setProperty("tagAccounting","key");
    properties.setProperty("function_tag","foo2");
    properties.setProperty("product_tag","foo3");
    AwsTagReporter reporter = new AwsTagReporter("testUuid",client,instances,properties);
    reporter.run();
}
 
開發者ID:RetailMeNot,項目名稱:SeleniumGridScaler,代碼行數:17,代碼來源:AwsTagReporterTest.java

示例3: testClientThrowsErrors

import com.amazonaws.services.ec2.model.DescribeInstancesResult; //導入方法依賴的package包/類
@Test
public void testClientThrowsErrors() {
    MockAmazonEc2Client client = new MockAmazonEc2Client(null);
    client.setDescribeInstancesToThrowError();
    Collection<Instance> instances = Arrays.asList(new Instance());
    DescribeInstancesResult describeInstancesResult = new DescribeInstancesResult();
    Reservation reservation = new Reservation();
    describeInstancesResult.setReservations(Arrays.asList(reservation));
    reservation.setInstances(instances);
    client.setDescribeInstances(describeInstancesResult);
    Properties properties = new Properties();
    properties.setProperty("accounting_tag","foo");
    properties.setProperty("function_tag","foo2");
    properties.setProperty("product_tag","foo3");
    AwsTagReporter reporter = new AwsTagReporter("testUuid",client,instances,properties) {
        @Override
        void sleep() throws InterruptedException {
            // do nothing
        }
    };
    reporter.run();
}
 
開發者ID:RetailMeNot,項目名稱:SeleniumGridScaler,代碼行數:23,代碼來源:AwsTagReporterTest.java

示例4: testSleepThrowsErrors

import com.amazonaws.services.ec2.model.DescribeInstancesResult; //導入方法依賴的package包/類
@Test
public void testSleepThrowsErrors() {
    MockAmazonEc2Client client = new MockAmazonEc2Client(null);
    client.setDescribeInstancesToThrowError();
    Collection<Instance> instances = Arrays.asList(new Instance());
    DescribeInstancesResult describeInstancesResult = new DescribeInstancesResult();
    Reservation reservation = new Reservation();
    describeInstancesResult.setReservations(Arrays.asList(reservation));
    reservation.setInstances(instances);
    client.setDescribeInstances(describeInstancesResult);
    Properties properties = new Properties();
    properties.setProperty("accounting_tag","foo");
    properties.setProperty("function_tag","foo2");
    properties.setProperty("product_tag","foo3");
    AwsTagReporter reporter = new AwsTagReporter("testUuid",client,instances,properties) {
        @Override
        void sleep() throws InterruptedException {
            throw new InterruptedException();
        }
    };
    reporter.run();
}
 
開發者ID:RetailMeNot,項目名稱:SeleniumGridScaler,代碼行數:23,代碼來源:AwsTagReporterTest.java

示例5: testThreadTimesOut

import com.amazonaws.services.ec2.model.DescribeInstancesResult; //導入方法依賴的package包/類
@Test()
public void testThreadTimesOut() {
    MockAmazonEc2Client client = new MockAmazonEc2Client(null);
    Collection<Instance> instances = Arrays.asList(new Instance());
    DescribeInstancesResult describeInstancesResult = new DescribeInstancesResult();
    Reservation reservation = new Reservation();
    describeInstancesResult.setReservations(Arrays.asList(reservation));
    // Make count mismatch
    reservation.setInstances(Arrays.asList(new Instance(),new Instance()));
    client.setDescribeInstances(describeInstancesResult);
    Properties properties = new Properties();
    properties.setProperty("accounting_tag","foo");
    properties.setProperty("function_tag","foo2");
    properties.setProperty("product_tag","foo3");
    AwsTagReporter reporter = new AwsTagReporter("testUuid",client,instances,properties);
    AwsTagReporter.TIMEOUT_IN_SECONDS = 1;
    try{
        reporter.run();
    } catch(RuntimeException e) {
        Assert.assertEquals("Error waiting for instances to exist to add tags",e.getMessage());
        return;
    }
    Assert.fail("Exception should have been thrown since tags were never filed");
}
 
開發者ID:RetailMeNot,項目名稱:SeleniumGridScaler,代碼行數:25,代碼來源:AwsTagReporterTest.java


注:本文中的com.amazonaws.services.ec2.model.DescribeInstancesResult.setReservations方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。