Java tutorial
/** * Put your copyright and license info here. */ package github.ananthc.sampleapps.apex.kuduoutput; import java.io.IOException; import javax.validation.ConstraintViolationException; import org.junit.Assert; import org.junit.Test; import org.apache.hadoop.conf.Configuration; import com.datatorrent.api.LocalMode; /** * Test the DAG declaration in local mode. */ public class KafkaToKuduOutputApplicationTest { @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 github.ananthc.sampleapps.apex.kuduoutput.KafkaToKuduOutputApplication(), conf); LocalMode.Controller lc = lma.getController(); lc.run(1000000); // runs for 10 seconds and quits } catch (ConstraintViolationException e) { Assert.fail("constraint violations: " + e.getConstraintViolations()); } } }