public void testParse_osFamilyRepeated() { try { parse("osFamily=UBUNTU, osFamily=LINUX"); fail("Expected exception"); } catch (IllegalArgumentException expected) { // expected } }
public void testParse_osVersionMatchesRepeated() { try { parse("osVersionMatches=11.04, osVersionMatches=.*[Aa]utomated SSH Access.*"); fail("Expected exception"); } catch (IllegalArgumentException expected) { // expected } }
public void testParse_osDescriptionMatchesRepeated() { try { parse("osDescriptionMatches=^((?!MGC).)*$, osDescriptionMatches=.*[Aa]utomated SSH Access.*"); fail("Expected exception"); } catch (IllegalArgumentException expected) { // expected } }
public void testParse_loginUserRepeated() { try { parse("loginUser=aws-user,loginUser=ubuntu"); fail("Expected exception"); } catch (IllegalArgumentException expected) { // expected } }
public void testParse_minRamRepeated() { try { parse("minRam=10, minRam=20"); fail("Expected exception"); } catch (IllegalArgumentException expected) { // expected } }
public void testParse_osArchMatchesRepeated() { try { parse("osArchMatches=x86, osArchMatches=foo"); fail("Expected exception"); } catch (IllegalArgumentException expected) { // expected } }
public void testParse_authenticateSudoWithoutLoginUser() { try { parse("authenticateSudo=true"); fail("Expected exception"); } catch (IllegalArgumentException expected) { // expected } }
public void testParse_hardwareIdRepeated() { try { parse("hardwareId=m1.small, hardwareId=t1.micro"); fail("Expected exception"); } catch (IllegalArgumentException expected) { // expected } }
public void testParse_minCoresRepeated() { try { parse("minCores=10, minCores=20"); fail("Expected exception"); } catch (IllegalArgumentException expected) { // expected } }
public void testParse_hypervisorMatchesRepeated() { try { parse("hypervisorMatches=VSphere, hypervisorMatches=OpenVZ"); fail("Expected exception"); } catch (IllegalArgumentException expected) { // expected } }
public void testParse_imageIdRepeated() { try { parse("imageId=us-east-1/ami-fffffff, imageId=ami-eeeeeee"); fail("Expected exception"); } catch (IllegalArgumentException expected) { // expected } }
public void testParse_unknownKey() { try { parse("foo=17"); fail("Expected exception"); } catch (IllegalArgumentException expected) { // expected } }
public void testParse_imageNameMatchesRepeated() { try { parse("imageNameMatches=hello, imageNameMatches=.*w/ None.*"); fail("Expected exception"); } catch (IllegalArgumentException expected) { // expected } }
public void testParse_os64BitRepeated() { try { parse("os64Bit=false, os64Bit=true"); fail("Expected exception"); } catch (IllegalArgumentException expected) { // expected } }
public void testParse_authenticateSudoRepeated() { try { parse("loginUser=root:toor,authenticateSudo=true,authenticateSudo=false"); fail("Expected exception"); } catch (IllegalArgumentException expected) { // expected } }
public void testParse_locationIdRepeated() { try { parse("locationId=stub, locationId=stub"); fail("Expected exception"); } catch (IllegalArgumentException expected) { // expected } }
public void testNiceJson() { TemplateBuilderSpec spec = parse("osFamily=UBUNTU,osVersionMatches=1[012].[01][04],imageNameMatches=.*w/ None.*"); assertEquals(new Gson().toJson(spec), "{\"imageNameMatches\":\".*w/ None.*\",\"osFamily\":\"UBUNTU\",\"osVersionMatches\":\"1[012].[01][04]\"}"); assertEquals(new Gson().fromJson(new Gson().toJson(spec), TemplateBuilderSpec.class), spec); }
@Override protected Properties setupProperties() { Properties overrides = super.setupProperties(); String ebsSpec = checkNotNull(setIfTestSystemPropertyPresent(overrides, provider + ".ebs-template"), provider + ".ebs-template"); ebsTemplate = TemplateBuilderSpec.parse(ebsSpec); return overrides; }
public void testParse_minDiskIsNotEqual() { TemplateBuilderSpec spec1 = parse("minDisk=10"); TemplateBuilderSpec spec2 = parse("minDisk=20"); assertTemplateBuilderEquivalence(templateBuilders.get().minDisk(10), templateBuilders.get().from(spec1)); assertTemplateBuilderEquivalence(templateBuilders.get().minDisk(20), templateBuilders.get().from(spec2)); assertNotEquals(spec1.minDisk, spec2.minDisk); }
@Override protected Properties setupProperties() { Properties overrides = super.setupProperties(); String ebsSpec = setIfTestSystemPropertyPresent(overrides, provider + ".ebs-template"); if (ebsSpec != null) ebsTemplate = TemplateBuilderSpec.parse(ebsSpec); return overrides; }