@BeforeMethod public void setUp() { client = createMock(CloudStackClient.class); guestOSClient = createMock(GuestOSClient.class); expect(client.getGuestOSClient()).andReturn(guestOSClient).times(2); Map<String, String> osCategories = Maps.newHashMap(); osCategories.put("1", "Ubuntu"); osCategories.put("2", "CentOS"); osCategories.put("3", "RHEL"); expect(guestOSClient.listOSCategories()).andReturn(osCategories); Set<OSType> osTypes = ImmutableSet.of( OSType.builder().id("10").OSCategoryId("1").description("Ubuntu 10.04 LTS").build(), OSType.builder().id("20").OSCategoryId("2").description("CentOS 5.4").build(), OSType.builder().id("30").OSCategoryId("3").description("RHEL 6").build() ); expect(guestOSClient.listOSTypes()).andReturn(osTypes); replay(client, guestOSClient); }
@BeforeMethod public void setUp() { client = createMock(CloudStackApi.class); guestOSClient = createMock(GuestOSApi.class); expect(client.getGuestOSApi()).andReturn(guestOSClient).times(2); Map<String, String> osCategories = Maps.newHashMap(); osCategories.put("1", "Ubuntu"); osCategories.put("2", "CentOS"); osCategories.put("3", "RHEL"); expect(guestOSClient.listOSCategories()).andReturn(osCategories); Set<OSType> osTypes = ImmutableSet.of( OSType.builder().id("10").OSCategoryId("1").description("Ubuntu 10.04 LTS").build(), OSType.builder().id("20").OSCategoryId("2").description("CentOS 5.4").build(), OSType.builder().id("30").OSCategoryId("3").description("RHEL 6").build() ); expect(guestOSClient.listOSTypes()).andReturn(osTypes); replay(client, guestOSClient); }
return ImmutableSet .<OSType> builder() .add(OSType.builder().id("69").OSCategoryId("7").description("Asianux 3(32-bit)").build()) .add(OSType.builder().id("70").OSCategoryId("7").description("Asianux 3(64-bit)").build()) .add(OSType.builder().id("1").OSCategoryId("1").description("CentOS 4.5 (32-bit)").build()) .add(OSType.builder().id("2").OSCategoryId("1").description("CentOS 4.6 (32-bit)").build()) .add(OSType.builder().id("3").OSCategoryId("1").description("CentOS 4.7 (32-bit)").build()) .add(OSType.builder().id("4").OSCategoryId("1").description("CentOS 4.8 (32-bit)").build()) .add(OSType.builder().id("5").OSCategoryId("1").description("CentOS 5.0 (32-bit)").build()) .add(OSType.builder().id("6").OSCategoryId("1").description("CentOS 5.0 (64-bit)").build()) .add(OSType.builder().id("7").OSCategoryId("1").description("CentOS 5.1 (32-bit)").build()) .add(OSType.builder().id("8").OSCategoryId("1").description("CentOS 5.1 (64-bit)").build()) .add(OSType.builder().id("9").OSCategoryId("1").description("CentOS 5.2 (32-bit)").build()) .add(OSType.builder().id("10").OSCategoryId("1").description("CentOS 5.2 (64-bit)").build()) .add(OSType.builder().id("11").OSCategoryId("1").description("CentOS 5.3 (32-bit)").build()) .add(OSType.builder().id("12").OSCategoryId("1").description("CentOS 5.3 (64-bit)").build()) .add(OSType.builder().id("13").OSCategoryId("1").description("CentOS 5.4 (32-bit)").build()) .add(OSType.builder().id("14").OSCategoryId("1").description("CentOS 5.4 (64-bit)").build()) .add(OSType.builder().id("111").OSCategoryId("1").description("CentOS 5.5 (32-bit)").build()) .add(OSType.builder().id("112").OSCategoryId("1").description("CentOS 5.5 (64-bit)").build()) .add(OSType.builder().id("73").OSCategoryId("2").description("Debian GNU/Linux 4(32-bit)").build()) .add(OSType.builder().id("74").OSCategoryId("2").description("Debian GNU/Linux 4(64-bit)").build()) .add(OSType.builder().id("72").OSCategoryId("2").description("Debian GNU/Linux 5(64-bit)").build()) .add(OSType.builder().id("15").OSCategoryId("2").description("Debian GNU/Linux 5.0 (32-bit)").build()) .add(OSType.builder().id("132").OSCategoryId("2").description("Debian GNU/Linux 6(32-bit)").build()) .add(OSType.builder().id("133").OSCategoryId("2").description("Debian GNU/Linux 6(64-bit)").build()) .add(OSType.builder().id("102").OSCategoryId("6").description("DOS").build()) .add(OSType.builder().id("118").OSCategoryId("4").description("Fedora 10").build()) .add(OSType.builder().id("117").OSCategoryId("4").description("Fedora 11").build())
return ImmutableSet .<OSType> builder() .add(OSType.builder().id("69").OSCategoryId("7").description("Asianux 3(32-bit)").build()) .add(OSType.builder().id("70").OSCategoryId("7").description("Asianux 3(64-bit)").build()) .add(OSType.builder().id("1").OSCategoryId("1").description("CentOS 4.5 (32-bit)").build()) .add(OSType.builder().id("2").OSCategoryId("1").description("CentOS 4.6 (32-bit)").build()) .add(OSType.builder().id("3").OSCategoryId("1").description("CentOS 4.7 (32-bit)").build()) .add(OSType.builder().id("4").OSCategoryId("1").description("CentOS 4.8 (32-bit)").build()) .add(OSType.builder().id("5").OSCategoryId("1").description("CentOS 5.0 (32-bit)").build()) .add(OSType.builder().id("6").OSCategoryId("1").description("CentOS 5.0 (64-bit)").build()) .add(OSType.builder().id("7").OSCategoryId("1").description("CentOS 5.1 (32-bit)").build()) .add(OSType.builder().id("8").OSCategoryId("1").description("CentOS 5.1 (64-bit)").build()) .add(OSType.builder().id("9").OSCategoryId("1").description("CentOS 5.2 (32-bit)").build()) .add(OSType.builder().id("10").OSCategoryId("1").description("CentOS 5.2 (64-bit)").build()) .add(OSType.builder().id("11").OSCategoryId("1").description("CentOS 5.3 (32-bit)").build()) .add(OSType.builder().id("12").OSCategoryId("1").description("CentOS 5.3 (64-bit)").build()) .add(OSType.builder().id("13").OSCategoryId("1").description("CentOS 5.4 (32-bit)").build()) .add(OSType.builder().id("14").OSCategoryId("1").description("CentOS 5.4 (64-bit)").build()) .add(OSType.builder().id("111").OSCategoryId("1").description("CentOS 5.5 (32-bit)").build()) .add(OSType.builder().id("112").OSCategoryId("1").description("CentOS 5.5 (64-bit)").build()) .add(OSType.builder().id("73").OSCategoryId("2").description("Debian GNU/Linux 4(32-bit)").build()) .add(OSType.builder().id("74").OSCategoryId("2").description("Debian GNU/Linux 4(64-bit)").build()) .add(OSType.builder().id("72").OSCategoryId("2").description("Debian GNU/Linux 5(64-bit)").build()) .add(OSType.builder().id("15").OSCategoryId("2").description("Debian GNU/Linux 5.0 (32-bit)").build()) .add(OSType.builder().id("132").OSCategoryId("2").description("Debian GNU/Linux 6(32-bit)").build()) .add(OSType.builder().id("133").OSCategoryId("2").description("Debian GNU/Linux 6(64-bit)").build()) .add(OSType.builder().id("102").OSCategoryId("6").description("DOS").build()) .add(OSType.builder().id("118").OSCategoryId("4").description("Fedora 10").build()) .add(OSType.builder().id("117").OSCategoryId("4").description("Fedora 11").build())
public T fromOSType(OSType in) { return this .id(in.getId()) .OSCategoryId(in.getOSCategoryId()) .description(in.getDescription()); } }
public T fromOSType(OSType in) { return this .id(in.getId()) .OSCategoryId(in.getOSCategoryId()) .description(in.getDescription()); } }
public T fromOSType(OSType in) { return this .id(in.getId()) .OSCategoryId(in.getOSCategoryId()) .description(in.getDescription()); } }