Commit 2086b425 authored by Kammleiter's avatar Kammleiter
Browse files

enable testing

parent e1d4c672
...@@ -27,31 +27,31 @@ public class TaskUpload { ...@@ -27,31 +27,31 @@ public class TaskUpload {
@PostConstruct @PostConstruct
public void startTest() { public void startTest() {
// String env = System.getenv("job_id"); String env = System.getenv("job_id");
// if(env == null || env.equals("")) { if(env == null || env.equals("")) {
// throw new IllegalArgumentException("Environment variable env not set"); throw new IllegalArgumentException("Environment variable env not set");
// } }
// LOG.info("Running jobId: " + env); LOG.info("Running jobId: " + env);
// UserResult jUnitResult = null; UserResult jUnitResult = null;
// try { try {
// jUnitResult = jUnitTestHelper.runUnitTests(); jUnitResult = jUnitTestHelper.runUnitTests();
// LOG.info("jUnitResult: " + jUnitResult.getCompilationErrors() + jUnitResult.getTestResults()); LOG.info("jUnitResult: " + jUnitResult.getCompilationErrors() + jUnitResult.getTestResults());
// } catch (IOException | ClassNotFoundException e) { } catch (IOException | ClassNotFoundException e) {
// LOG.error("Error while compiling or testing", e); LOG.error("Error while compiling or testing", e);
// } }
// LOG.info("Posting UserResult to backend at: " + this.backendUrl); LOG.info("Posting UserResult to backend at: " + this.backendUrl);
// ResponseEntity<Void> response = null; ResponseEntity<Void> response = null;
// try { try {
// response = new RestTemplate().postForEntity(this.backendUrl + "?jobID=" + env, jUnitResult, Void.class); response = new RestTemplate().postForEntity(this.backendUrl + "?jobID=" + env, jUnitResult, Void.class);
// } catch (Exception e) { } catch (Exception e) {
// LOG.error("Error while Posting to backend: " + e.getMessage()); LOG.error("Error while Posting to backend: " + e.getMessage());
//// System.exit(0); System.exit(0);
// } }
// if (response.getStatusCode() != HttpStatus.OK) { if (response.getStatusCode() != HttpStatus.OK) {
// LOG.error("Error while Posting to backend: " + response.toString()); LOG.error("Error while Posting to backend: " + response.toString());
// } else { } else {
// LOG.info("Successfully tested and sent"); LOG.info("Successfully tested and sent");
// } }
//// System.exit(0); System.exit(0);
} }
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment