use of org.apache.beam.validate.runner.service.ModeTestService in project beam by apache.
the class Main method main.
public static void main(String[] args) {
try {
final Logger logger = LoggerFactory.getLogger(Main.class);
String outputFile;
if (args.length == 0) {
logger.info("Output file name missing. Output will be saved to capability.json");
outputFile = "capability";
} else {
outputFile = args[0];
logger.info("Output will be saved to {}.json", outputFile);
}
JSONArray outputDetails = new JSONArray();
logger.info("Processing Batch Jobs:");
ModeTestService batchTestService = new ModeTestService("batch");
outputDetails.add(batchTestService.getTests());
logger.info("Processing Stream Jobs:");
ModeTestService streamTestService = new ModeTestService("stream");
outputDetails.add(streamTestService.getTests());
try (FileWriter file = new FileWriter(outputFile + ".json")) {
file.write(outputDetails.toString(3));
file.flush();
} catch (IOException e) {
e.printStackTrace();
}
} catch (Exception ex) {
ex.printStackTrace();
}
}
Aggregations