use of javax.validation.ConstraintViolationException in project apex-malhar by apache.
the class ApplicationTest method testApplication.
@Test
@Ignore
public void testApplication() throws IOException, Exception {
try {
LocalMode lma = LocalMode.newInstance();
Configuration conf = new Configuration(false);
conf.addResource(this.getClass().getResourceAsStream("/META-INF/properties-SimpleJdbcToHDFSApp.xml"));
lma.prepareDAG(new JdbcHDFSApp(), conf);
LocalMode.Controller lc = lma.getController();
// runs for 10 seconds and quits
lc.run(10000);
} catch (ConstraintViolationException e) {
Assert.fail("constraint violations: " + e.getConstraintViolations());
}
}
use of javax.validation.ConstraintViolationException in project apex-malhar by apache.
the class ApplicationTest method testApplication.
@Test
public void testApplication() throws Exception {
try {
// delete output file if it exists
File file = new File(FILE_PATH);
file.delete();
// write messages to Kafka topic
writeToTopic();
// run app asynchronously; terminate after results are checked
LocalMode.Controller lc = asyncRun();
// check for presence of output file
chkOutput();
// compare output lines to input
compare();
lc.shutdown();
} catch (ConstraintViolationException e) {
Assert.fail("constraint violations: " + e.getConstraintViolations());
}
}
use of javax.validation.ConstraintViolationException in project apex-malhar by apache.
the class JdbcOperatorTest method testApplication.
@Test
public void testApplication() throws Exception {
try {
LocalMode lma = LocalMode.newInstance();
Configuration conf = new Configuration(false);
conf.addResource(this.getClass().getResourceAsStream("/META-INF/properties-JdbcToJdbcApp.xml"));
lma.prepareDAG(new JdbcToJdbcApp(), conf);
LocalMode.Controller lc = lma.getController();
lc.runAsync();
// wait for records to be added to table
Thread.sleep(5000);
Assert.assertEquals("Events in store", 10, getNumOfEventsInStore());
dropTable();
} catch (ConstraintViolationException e) {
Assert.fail("constraint violations: " + e.getConstraintViolations());
}
}
use of javax.validation.ConstraintViolationException in project apex-malhar by apache.
the class ApplicationTest method testApplication.
@Test
public void testApplication() throws IOException, Exception {
try {
createTopics();
// run app asynchronously; terminate after results are checked
Configuration conf = getConfig();
LocalMode lma = LocalMode.newInstance();
lma.prepareDAG(new Application(), conf);
ValidationToFile validationToFile = (ValidationToFile) lma.getDAG().getOperatorMeta("validationToFile").getOperator();
LocalMode.Controller lc = lma.getController();
lc.runAsync();
// waits for the validation application to be done before shutting it down and checking its output
int count = 1;
int maxSleepRounds = 300;
while (!validationToFile.validationDone) {
logger.info("Sleeping ....");
Thread.sleep(500);
if (count > maxSleepRounds) {
fail("validationDone flag did not get set to true in ValidationToFile operator");
}
count++;
}
lc.shutdown();
checkOutput();
} catch (ConstraintViolationException e) {
fail("constraint violations: " + e.getConstraintViolations());
}
}
use of javax.validation.ConstraintViolationException in project apex-malhar by apache.
the class ApplicationTest method testApplication.
@Test
public void testApplication() throws IOException, Exception {
try {
LocalMode lma = LocalMode.newInstance();
Configuration conf = new Configuration(false);
conf.addResource(this.getClass().getResourceAsStream("/META-INF/properties.xml"));
lma.prepareDAG(new Application(), conf);
LocalMode.Controller lc = lma.getController();
// runs for 30 seconds and quits
lc.run(10 * 1000);
} catch (ConstraintViolationException e) {
Assert.fail("constraint violations: " + e.getConstraintViolations());
}
}
Aggregations