All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.ch.export.service.NoOpsExportService Maven / Gradle / Ivy

Go to download

The Charles Hudson Java SDK wraps the REST API in a lightweight library. The Java SDK enables you to develop a fast, flexible, and customized integration with CH cloud solution.

There is a newer version: 1.0.7
Show newest version
package com.ch.export.service;

import java.util.ArrayList;
import java.util.List;
import java.util.logging.Logger;

import com.ch.config.ConfigProperties;
import com.ch.exception.ValidationException;
import com.ch.model.ExecutionReport;
import com.ch.model.Report;
import com.ch.model.TestReport;
import com.ch.service.TestReportService;
import com.ch.service.exception.ServiceException;
import com.ch.validator.ExecutionReportValidator;
import com.ch.validator.TestReportValidator;

public class NoOpsExportService implements TestReportService {
	private static final Logger LOGGER = Logger.getLogger(NoOpsExportService.class.getName());

	@Override
	public void exportExecutionReport(ExecutionReport executionReport, ConfigProperties config)
			throws ServiceException {
		try {
			ExecutionReportValidator.validate(executionReport);
		} catch (Exception e) {
			throw new ServiceException("Exception Processing executionReport", e);
		}
		LOGGER.info("Default No Operation Export Service Configured. Reports will be not logged");
	}

	@Override
	public void exportTestReport(TestReport testReport, ConfigProperties config) throws ServiceException {
		try {
			List reportList = new ArrayList();
			reportList.add(testReport);
			TestReportValidator.validate(reportList);
		} catch (Exception e) {
			throw new ServiceException("Exception Processing testReport", e);
		}
		LOGGER.info("Default No Operation Export Service Configured. Reports will be not logged");
	}

	@Override
	public void exportReport(Report report, ConfigProperties config) throws ServiceException {
		exportExecutionReport(report.getExecutionReport(), config);
		List reportList = report.getTestReports();
		try {
			TestReportValidator.validate(reportList);
		} catch (ValidationException e) {
			throw new ServiceException("Exception Processing testReport", e);
		}
		LOGGER.info("Default No Operation Export Service Configured. Reports will be not logged");
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy