use of org.apache.heron.eco.parser.EcoParser in project heron by twitter.
the class ConfigBuilderTest method testBuildConfig_IncorrectComponentJVMOptions_ExceptionThrown.
@Test(expected = IllegalArgumentException.class)
public void testBuildConfig_IncorrectComponentJVMOptions_ExceptionThrown() throws Exception {
Config config = null;
try {
EcoParser ecoParser = new EcoParser();
InputStream inputStream = new ByteArrayInputStream(INCORRECT_JVM_OPTIONS_CONFIG.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.eco.parser.EcoParser in project heron by twitter.
the class Eco method main.
public static void main(String[] args) throws Exception {
Options options = constructOptions();
CommandLineParser parser = new DefaultParser();
CommandLine cmd;
try {
cmd = parser.parse(options, args);
} catch (ParseException e) {
throw new RuntimeException("Error parsing command line options: ", e);
}
FileInputStream fin = new FileInputStream(new File(cmd.getOptionValue(ECO_CONFIG_FILE)));
String propsFile = cmd.getOptionValue(PROPS);
FileInputStream propsInputStream = null;
if (propsFile != null) {
propsInputStream = new FileInputStream(new File(propsFile));
}
Boolean filterFromEnv = cmd.hasOption(ENV_PROPS);
Eco eco = new Eco(new EcoParser(), new EcoSubmitter());
eco.submit(fin, propsInputStream, filterFromEnv);
}
use of org.apache.heron.eco.parser.EcoParser 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.eco.parser.EcoParser 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.eco.parser.EcoParser 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);
}
}
Aggregations