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

com.carmatechnologies.commons.testing.logging.junit.CompositeILogStatement Maven / Gradle / Ivy

There is a newer version: 1.0.1
Show newest version
package com.carmatechnologies.commons.testing.logging.junit;

import com.carmatechnologies.commons.testing.logging.api.ILogCapturer;
import org.junit.runners.model.Statement;

import java.util.Set;

import static com.carmatechnologies.commons.testing.utils.Preconditions.checkNotNull;

public class CompositeILogStatement extends ILogStatement implements ILogCapturer {
    private final Set ILogCapturers;

    public CompositeILogStatement(final Statement statement, final Set ILogCapturers) {
        super(statement);
        this.ILogCapturers = checkNotNull(ILogCapturers, "Log capturers must NOT be null set.");
    }

    @Override
    public void enableLogCapture() {
        for (final ILogCapturer ILogCapturer : ILogCapturers)
            ILogCapturer.enableLogCapture();
    }

    @Override
    public void disableLogCapture() {
        for (final ILogCapturer ILogCapturer : ILogCapturers)
            ILogCapturer.disableLogCapture();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy