[RM] Feature Th2-related changes for report
MODIFY
BackEnd/Core/sailfish-core/src/main/java/com/exactpro/sf/scriptrunner/AbstractScriptRunner.java
BackEnd/Core/sailfish-core/src/main/java/com/exactpro/sf/scriptrunner/AbstractScriptRunner.java
@@ -280,7 +280,7 @@ public abstract class AbstractScriptRunner implements IDisposable {
reportListeners.addAll(userListeners);
}
- reportListeners.addAll(sfContext.getScriptReportLoader().createScriptReports(reportFolder, workspaceDispatcher, dictionaryManager, scriptDescription.getId()));
+ reportListeners.addAll(sfContext.getScriptReportLoader().createScriptReports(reportFolder, workspaceDispatcher, dictionaryManager, scriptDescription));
// NOTE: ZipReport must be latest
reportListeners.add(new ZipReport(reportFolder, workspaceDispatcher, scriptDescription, ReportOutputFormat.ZIP));

MODIFY
BackEnd/Core/sailfish-core/src/main/java/com/exactpro/sf/scriptrunner/IScriptReportFactory.java
BackEnd/Core/sailfish-core/src/main/java/com/exactpro/sf/scriptrunner/IScriptReportFactory.java
@@ -21,6 +21,6 @@ import com.exactpro.sf.configuration.workspace.IWorkspaceDispatcher;
public interface IScriptReportFactory {
- IScriptReport createScriptReport(String reportFolder, IWorkspaceDispatcher workspaceDispatcher, IDictionaryManager dictionaryManager) throws Exception;
+ IScriptReport createScriptReport(String reportFolder, IWorkspaceDispatcher workspaceDispatcher, IDictionaryManager dictionaryManager, TestScriptDescription testScriptDescription) throws Exception;
}

MODIFY
BackEnd/Core/sailfish-core/src/main/java/com/exactpro/sf/scriptrunner/IScriptReportLoader.java
BackEnd/Core/sailfish-core/src/main/java/com/exactpro/sf/scriptrunner/IScriptReportLoader.java
package com.exactpro.sf.scriptrunner;
-import java.util.Set;
+import java.util.Collection;
import com.exactpro.sf.configuration.IDictionaryManager;
import com.exactpro.sf.configuration.ILoadableManager;
import com.exactpro.sf.configuration.workspace.IWorkspaceDispatcher;
public interface IScriptReportLoader extends ILoadableManager {
- Set<IScriptReport> createScriptReports(String reportFolder, IWorkspaceDispatcher workspaceDispatcher, IDictionaryManager dictionaryManager, long scriptId);
+ Collection<IScriptReport> createScriptReports(String reportFolder, IWorkspaceDispatcher workspaceDispatcher, IDictionaryManager dictionaryManager, TestScriptDescription testScriptDescription);
}

MODIFY
BackEnd/Core/sailfish-core/src/main/java/com/exactpro/sf/scriptrunner/ScriptReportLoader.java
BackEnd/Core/sailfish-core/src/main/java/com/exactpro/sf/scriptrunner/ScriptReportLoader.java
package com.exactpro.sf.scriptrunner;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
import java.util.Objects;
import java.util.ServiceLoader;
import java.util.Set;
@@ -45,23 +48,23 @@ public class ScriptReportLoader implements IScriptReportLoader {
}
@Override
- public Set<IScriptReport> createScriptReports(String reportFolder, IWorkspaceDispatcher workspaceDispatcher, IDictionaryManager dictionaryManager, long scriptId) {
+ public Collection<IScriptReport> createScriptReports(String reportFolder, IWorkspaceDispatcher workspaceDispatcher, IDictionaryManager dictionaryManager, TestScriptDescription testScriptDescription) {
return factories.entries().stream().map(entry ->
createScriptReport(entry.getValue(),
reportFolder,
workspaceDispatcher,
dictionaryManager,
entry.getKey(),
- scriptId)
- ).filter(Objects::nonNull).collect(Collectors.toSet());
+ testScriptDescription)
+ ).filter(Objects::nonNull).collect(Collectors.toCollection(ArrayList::new));
}
- private IScriptReport createScriptReport(IScriptReportFactory factory, String reportFolder, IWorkspaceDispatcher workspaceDispatcher, IDictionaryManager dictionaryManager, String pluginName, long scriptID) {
+ private IScriptReport createScriptReport(IScriptReportFactory factory, String reportFolder, IWorkspaceDispatcher workspaceDispatcher, IDictionaryManager dictionaryManager, String pluginName, TestScriptDescription testScriptDescription) {
try {
- return factory.createScriptReport(reportFolder, workspaceDispatcher, dictionaryManager);
+ return factory.createScriptReport(reportFolder, workspaceDispatcher, dictionaryManager, testScriptDescription);
} catch (Exception e) {
if (logger.isWarnEnabled()) {
- logger.warn("Can not create script report from class '{}' from plugin '{}' for script with id '{}'", factory.getClass().getName(), pluginName, scriptID, e);
+ logger.warn("Can not create script report from class '{}' from plugin '{}' for script with id '{}'", factory.getClass().getName(), pluginName, testScriptDescription.getId(), e);
}
}
return null;

[RM] Feature #69888. Th2-related changes for report

Change-Id: Ic6c499a0cb02200971587202557a3f79ef4be80d