Skip to content

Commit

Permalink
Implemented and tested new logging features.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Reiche committed Jan 20, 2022
1 parent 18a4727 commit ab9e52f
Show file tree
Hide file tree
Showing 6 changed files with 120 additions and 125 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import eu.tsystems.mms.tic.testframework.annotations.Fails;
import eu.tsystems.mms.tic.testframework.events.ContextUpdateEvent;
import eu.tsystems.mms.tic.testframework.internal.Counters;
import eu.tsystems.mms.tic.testframework.logging.Loggable;
import eu.tsystems.mms.tic.testframework.report.FailureCorridor;
import eu.tsystems.mms.tic.testframework.report.Status;
import eu.tsystems.mms.tic.testframework.report.TesterraListener;
Expand Down Expand Up @@ -64,13 +65,7 @@ public enum Type {
private final String threadName;
private TestStep lastFailedStep;
private Class failureCorridorClass = FailureCorridor.High.class;

/**
* @deprecated
*/
public final List<String> infos = new LinkedList<>();
private final List<SessionContext> sessionContexts = new LinkedList<>();
private String priorityMessage = null;
private final TestStepController testStepController = new TestStepController();
private final List<MethodContext> relatedMethodContexts = new LinkedList<>();
private final List<MethodContext> dependsOnMethodContexts = new LinkedList<>();
Expand Down Expand Up @@ -235,14 +230,7 @@ public void addError(ErrorContext errorContext) {

@Deprecated
public void addPriorityMessage(String msg) {

if (priorityMessage == null) {
priorityMessage = "";
}

if (!priorityMessage.contains(msg)) {
priorityMessage += msg;
}
log().info(msg, this, Loggable.prompt);
}

public boolean isConfigMethod() {
Expand Down Expand Up @@ -347,15 +335,24 @@ public String getThreadName() {
return threadName;
}

/**
* @deprecated Use {@link TestStepAction#readEntries()} instead
*/
public Stream<String> readInfos() {
return infos.stream();
return Stream.empty();
}

/**
* @deprecated Use {@link TestStepAction#addLogMessage(LogMessage)} instead
*/
public void addInfo(String info) {
this.infos.add(info);
log().info(info, this, Loggable.prompt);
}

/**
* @deprecated Use {@link TestStepAction#readEntries()} instead
*/
public Optional<String> getPriorityMessage() {
return Optional.ofNullable(priorityMessage);
return Optional.empty();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,7 @@ public MethodContext.Builder buildMethodContext(eu.tsystems.mms.tic.testframewor

apply(methodContext.getRetryCounter(), builder::setRetryNumber);
apply(methodContext.getMethodRunIndex(), builder::setMethodRunIndex);

methodContext.getPriorityMessage().ifPresent(builder::setPriorityMessage);
//methodContext.getPriorityMessage().ifPresent(builder::setPriorityMessage);
apply(methodContext.getThreadName(), builder::setThreadName);

// test steps
Expand All @@ -131,7 +130,6 @@ public MethodContext.Builder buildMethodContext(eu.tsystems.mms.tic.testframewor
builder.setFailureCorridorValue(FailureCorridorValue.FCV_LOW);
}
builder.setClassContextId(methodContext.getClassContext().getId());
methodContext.readInfos().forEach(builder::addInfos);
methodContext.readRelatedMethodContexts().forEach(m -> builder.addRelatedMethodContextIds(m.getId()));
methodContext.readDependsOnMethodContexts().forEach(m -> builder.addDependsOnMethodContextIds(m.getId()));

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit ab9e52f

Please sign in to comment.