Search in sources :

Example 1 with ModeTestService

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();
    }
}
Also used : ModeTestService(org.apache.beam.validate.runner.service.ModeTestService) FileWriter(java.io.FileWriter) JSONArray(net.sf.json.JSONArray) IOException(java.io.IOException) Logger(org.slf4j.Logger) IOException(java.io.IOException)

Aggregations

FileWriter (java.io.FileWriter)1 IOException (java.io.IOException)1 JSONArray (net.sf.json.JSONArray)1 ModeTestService (org.apache.beam.validate.runner.service.ModeTestService)1 Logger (org.slf4j.Logger)1