use of org.apache.heron.api.Config in project heron by twitter.
the class EcoSubmitterTest method submitHeronTopology_AllGood_BehavesAsExpected.
@Test
public void submitHeronTopology_AllGood_BehavesAsExpected() throws Exception {
Config config = new Config();
HeronTopology topology = new HeronTopology(null);
PowerMockito.spy(HeronSubmitter.class);
PowerMockito.doNothing().when(HeronSubmitter.class, "submitTopology", any(String.class), any(Config.class), any(HeronTopology.class));
subject.submitHeronTopology("name", config, topology);
PowerMockito.verifyStatic(times(1));
HeronSubmitter.submitTopology(anyString(), any(Config.class), any(HeronTopology.class));
}
use of org.apache.heron.api.Config in project heron by twitter.
the class ConfigBuilderTest method testBuildConfig_MBAllocationTooSmall_ExceptionThrown.
@Test(expected = IllegalArgumentException.class)
public void testBuildConfig_MBAllocationTooSmall_ExceptionThrown() throws Exception {
Config config = null;
try {
EcoParser ecoParser = new EcoParser();
InputStream inputStream = new ByteArrayInputStream(INCORRECT_RAM_MEGABYTES.getBytes());
FileInputStream mockPropsStream = PowerMockito.mock(FileInputStream.class);
EcoTopologyDefinition ecoTopologyDefinition = ecoParser.parseFromInputStream(inputStream, mockPropsStream, false);
config = subject.buildConfig(ecoTopologyDefinition);
} finally {
assertNull(config);
}
}
use of org.apache.heron.api.Config in project heron by twitter.
the class ConfigBuilderTest method testBuildConfig_ByteAllocationTooSmall_ExceptionThrown.
@Test(expected = IllegalArgumentException.class)
public void testBuildConfig_ByteAllocationTooSmall_ExceptionThrown() throws Exception {
Config config = null;
try {
EcoParser ecoParser = new EcoParser();
InputStream inputStream = new ByteArrayInputStream(INCORRECT_RAM_BYTES.getBytes());
FileInputStream mockPropsStream = PowerMockito.mock(FileInputStream.class);
EcoTopologyDefinition ecoTopologyDefinition = ecoParser.parseFromInputStream(inputStream, mockPropsStream, false);
config = subject.buildConfig(ecoTopologyDefinition);
} finally {
assertNull(config);
}
}
use of org.apache.heron.api.Config in project heron by twitter.
the class ConfigBuilderTest method testBuildConfig_IncorrectByteResourceFormat_ExceptionThrow.
@Test(expected = IllegalArgumentException.class)
public void testBuildConfig_IncorrectByteResourceFormat_ExceptionThrow() throws Exception {
Config config = null;
try {
EcoParser ecoParser = new EcoParser();
InputStream inputStream = new ByteArrayInputStream(INCORRECT_BYTES_FORMAT_YAML.getBytes());
FileInputStream mockPropsStream = PowerMockito.mock(FileInputStream.class);
EcoTopologyDefinition ecoTopologyDefinition = ecoParser.parseFromInputStream(inputStream, mockPropsStream, false);
config = subject.buildConfig(ecoTopologyDefinition);
} finally {
assertNull(config);
}
}
use of org.apache.heron.api.Config in project heron by twitter.
the class ConfigBuilderTest method testBuildConfig_IncorrectMBResourceFormat_ExceptionThrow.
@Test(expected = IllegalArgumentException.class)
public void testBuildConfig_IncorrectMBResourceFormat_ExceptionThrow() throws Exception {
Config config = null;
try {
EcoParser ecoParser = new EcoParser();
InputStream inputStream = new ByteArrayInputStream(INCORRECT_MB_FORMAT_YAML.getBytes());
FileInputStream mockPropsStream = PowerMockito.mock(FileInputStream.class);
EcoTopologyDefinition ecoTopologyDefinition = ecoParser.parseFromInputStream(inputStream, mockPropsStream, false);
config = subject.buildConfig(ecoTopologyDefinition);
} finally {
assertNull(config);
}
}
Aggregations