package jetbrains.mps.make.unittest;
/*Generated by MPS */
import org.junit.runner.RunWith;
import org.jmock.integration.junit4.JMock;
import org.junit.Test;
import jetbrains.mps.internal.make.runtime.script.LoggingProgressStrategy;
import org.jmock.Expectations;
import jetbrains.mps.make.script.IProgress;
@RunWith(JMock.class)
public class LogReporting_Test extends MockTestCase {
@Test
public void test_basic() throws Exception {
final LoggingProgressStrategy.Log logger = context.mock(LoggingProgressStrategy.Log.class);
context.checking(new Expectations() {
{
oneOf(logger).info(with(Expectations.equal("∞/Top -- started")));
oneOf(logger).info(with(Expectations.equal("∞ -- done 30%")));
oneOf(logger).info(with(Expectations.equal("∞/Top -- done 30%")));
oneOf(logger).info(with(Expectations.equal("∞/Top/Mid -- started")));
oneOf(logger).info(with(Expectations.equal("∞ -- done 40%")));
oneOf(logger).info(with(Expectations.equal("∞/Top -- done 40%")));
oneOf(logger).info(with(Expectations.equal("∞/Top/Mid -- done 20%")));
oneOf(logger).info(with(Expectations.equal("∞ -- done 80%")));
oneOf(logger).info(with(Expectations.equal("∞/Top -- done 80%")));
oneOf(logger).info(with(Expectations.equal("∞/Top/Mid -- done 100%")));
oneOf(logger).info(with(Expectations.equal("∞/Top/Mid -- finished")));
oneOf(logger).info(with(Expectations.equal("∞/Top/Bot -- started")));
oneOf(logger).info(with(Expectations.equal("∞ -- done 90%")));
oneOf(logger).info(with(Expectations.equal("∞/Top -- done 90%")));
oneOf(logger).info(with(Expectations.equal("∞/Top/Bot -- done 10%")));
oneOf(logger).info(with(Expectations.equal("∞ -- done 100%")));
oneOf(logger).info(with(Expectations.equal("∞/Top -- done 100%")));
oneOf(logger).info(with(Expectations.equal("∞/Top/Bot -- done 100%")));
oneOf(logger).info(with(Expectations.equal("∞/Top -- done 100%")));
oneOf(logger).info(with(Expectations.equal("∞/Top -- finished")));
}
});
LoggingProgressStrategy strat = new LoggingProgressStrategy(logger);
IProgress pro = strat.currentProgress();
pro.beginWork("Top", 10, 1000);
pro.advanceWork("Top", 3);
pro.beginWork("Mid", 10, 5);
pro.advanceWork("Mid", 2);
pro.finishWork("Mid");
pro.beginWork("Bot", 10, 10);
pro.advanceWork("Bot", 1);
pro.advanceWork("Bot", 9);
pro.finishWork("Top");
}
public LogReporting_Test() {
}
}