inputFile2 = ServerTestUtils.createInputFile(INPUT_DIRECTORY, sizeOfInput);
outputFile = new File(ServerTestUtils.getTempDir() + File.separator + ServerTestUtils.getRandomFilename());
jarFile = ServerTestUtils.createJarFile(forwardClassName);
// Create job graph
final JobGraph jg = new JobGraph("Job Graph 1");
// input vertex
final JobFileInputVertex i1 = new JobFileInputVertex("Input 1", jg);
i1.setFileInputClass(FileLineReader.class);
i1.setFilePath(new Path(new File(testDirectory).toURI()));
// task vertex 1
final JobTaskVertex t1 = new JobTaskVertex("Task 1", jg);
t1.setTaskClass(ForwardTask.class);
// task vertex 2
final JobTaskVertex t2 = new JobTaskVertex("Task 2", jg);
t2.setTaskClass(ForwardTask.class);
// output vertex
JobFileOutputVertex o1 = new JobFileOutputVertex("Output 1", jg);
o1.setFileOutputClass(FileLineWriter.class);
o1.setFilePath(new Path(outputFile.toURI()));
t1.setVertexToShareInstancesWith(i1);
t2.setVertexToShareInstancesWith(i1);
o1.setVertexToShareInstancesWith(i1);
// connect vertices
try {
i1.connectTo(t1, ChannelType.NETWORK);
t1.connectTo(t2, ChannelType.IN_MEMORY);
t2.connectTo(o1, ChannelType.IN_MEMORY);
} catch (JobGraphDefinitionException e) {
e.printStackTrace();
}
// add jar
jg.addJar(new Path(new File(ServerTestUtils.getTempDir() + File.separator + forwardClassName + ".jar").toURI()));
// Create job client and launch job
jobClient = new JobClient(jg, configuration);
jobClient.submitJobAndWait();