com.athaydes.rawhttp.reqinedit.js.JsTestReporter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of rawhttp-req-in-edit Show documentation
Show all versions of rawhttp-req-in-edit Show documentation
RawHTTP req-in-edit module (Jetbrains HTTP format)
package com.athaydes.rawhttp.reqinedit.js;
import com.athaydes.rawhttp.reqinedit.HttpTestResult;
import com.athaydes.rawhttp.reqinedit.HttpTestsReporter;
import jdk.nashorn.api.scripting.ScriptObjectMirror;
@SuppressWarnings("unused") // used from the JS code
public final class JsTestReporter {
private final HttpTestsReporter httpTestsReporter;
public JsTestReporter(HttpTestsReporter httpTestsReporter) {
this.httpTestsReporter = httpTestsReporter;
}
public void success(ScriptObjectMirror objectMirror) {
long endTime = System.currentTimeMillis();
httpTestsReporter.report(new HttpTestResult(
(String) objectMirror.get("name"),
(long) objectMirror.get("time"),
endTime,
null));
}
public void failure(ScriptObjectMirror objectMirror) {
long endTime = System.currentTimeMillis();
httpTestsReporter.report(new HttpTestResult(
(String) objectMirror.get("name"),
(long) objectMirror.get("time"),
endTime,
objectMirror.get("error").toString()));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy