use of org.finra.herd.model.api.xml.EmrClusterDefinition in project herd by FINRAOS.
the class EmrClusterDefinitionHelperTest method testValidateEmrClusterDefinitionConfigurationMasterSpotPriceAndMaxSearchPriceSpecified.
/**
* Tests case where validation is run against the definition generated by createValidEmrClusterDefinition() The master instance spot price and max search
* price is specified. The definition is not valid. The two parameters are exclusive.
*/
@Test
public void testValidateEmrClusterDefinitionConfigurationMasterSpotPriceAndMaxSearchPriceSpecified() {
EmrClusterDefinition emrClusterDefinition = createValidEmrClusterDefinition();
emrClusterDefinition.getInstanceDefinitions().getMasterInstances().setInstanceSpotPrice(BigDecimal.ONE);
emrClusterDefinition.getInstanceDefinitions().getMasterInstances().setInstanceMaxSearchPrice(BigDecimal.ONE);
try {
emrClusterDefinitionHelper.validateEmrClusterDefinitionConfiguration(emrClusterDefinition);
fail("expected IllegalArgumentException, but no exception was thrown");
} catch (Exception e) {
assertEquals("thrown exception", IllegalArgumentException.class, e.getClass());
}
}
use of org.finra.herd.model.api.xml.EmrClusterDefinition in project herd by FINRAOS.
the class EmrClusterDefinitionHelperTest method testValidateEmrClusterDefinitionConfigurationMasterMaxSearchPriceAndOnDemandThresholdSpecified.
/**
* Tests case where validation is run against the definition generated by createValidEmrClusterDefinition() The master instance max search price and
* on-demand threshold is specified The definition should be valid because on-demand threshold can be used with max search price.
*/
@Test
public void testValidateEmrClusterDefinitionConfigurationMasterMaxSearchPriceAndOnDemandThresholdSpecified() {
EmrClusterDefinition emrClusterDefinition = createValidEmrClusterDefinition();
emrClusterDefinition.getInstanceDefinitions().getMasterInstances().setInstanceMaxSearchPrice(BigDecimal.ONE);
emrClusterDefinition.getInstanceDefinitions().getMasterInstances().setInstanceOnDemandThreshold(BigDecimal.ONE);
try {
emrClusterDefinitionHelper.validateEmrClusterDefinitionConfiguration(emrClusterDefinition);
} catch (Exception e) {
fail("expected no exception, but " + e.getClass() + " was thrown. " + e);
}
}
use of org.finra.herd.model.api.xml.EmrClusterDefinition in project herd by FINRAOS.
the class EmrClusterDefinitionHelperTest method testValidateEmrClusterDefinitionConfigurationNullSubnet.
@Test
public void testValidateEmrClusterDefinitionConfigurationNullSubnet() {
EmrClusterDefinition emrClusterDefinition = createValidEmrClusterDefinition();
emrClusterDefinition.setSubnetId(null);
try {
emrClusterDefinitionHelper.validateEmrClusterDefinitionConfiguration(emrClusterDefinition);
fail("expected IllegalArgumentException, but no exception was thrown");
} catch (Exception e) {
assertEquals("thrown exception", IllegalArgumentException.class, e.getClass());
}
}
use of org.finra.herd.model.api.xml.EmrClusterDefinition in project herd by FINRAOS.
the class EmrClusterDefinitionHelperTest method testValidateEmrClusterDefinitionConfigurationMasterSpotPriceNegative.
/**
* Tests case where validation is run against the definition generated by createValidEmrClusterDefinition() The master spot price is negative. The
* definition is not valid. All prices must be positive.
*/
@Test
public void testValidateEmrClusterDefinitionConfigurationMasterSpotPriceNegative() {
EmrClusterDefinition emrClusterDefinition = createValidEmrClusterDefinition();
emrClusterDefinition.getInstanceDefinitions().getMasterInstances().setInstanceSpotPrice(BigDecimal.ONE.negate());
try {
emrClusterDefinitionHelper.validateEmrClusterDefinitionConfiguration(emrClusterDefinition);
fail("expected IllegalArgumentException, but no exception was thrown");
} catch (Exception e) {
assertEquals("thrown exception", IllegalArgumentException.class, e.getClass());
}
}
use of org.finra.herd.model.api.xml.EmrClusterDefinition in project herd by FINRAOS.
the class EmrClusterDefinitionHelperTest method testValidateEmrClusterDefinitionConfigurationBlankSubnet.
/**
* Tests case where validation is run against the definition generated by createValidEmrClusterDefinition() The subnet is whitespace only. The definition is
* not valid. Subnet is required.
*/
@Test
public void testValidateEmrClusterDefinitionConfigurationBlankSubnet() {
EmrClusterDefinition emrClusterDefinition = createValidEmrClusterDefinition();
emrClusterDefinition.setSubnetId(" \r\t\n");
try {
emrClusterDefinitionHelper.validateEmrClusterDefinitionConfiguration(emrClusterDefinition);
fail("expected IllegalArgumentException, but no exception was thrown");
} catch (Exception e) {
assertEquals("thrown exception", IllegalArgumentException.class, e.getClass());
}
}
Aggregations