diff --git a/functional-test/pom.xml b/functional-test/pom.xml index 3a1345b92c..60a78fb901 100644 --- a/functional-test/pom.xml +++ b/functional-test/pom.xml @@ -591,7 +591,7 @@ listener - org.zanata.util.ScreenshotEnabledTestRunListener,org.zanata.util.FeatureInventoryRecorder + org.zanata.util.ScreenshotEnabledTestRunListener,org.zanata.util.FeatureInventoryRecorder,org.zanata.util.TestLogger diff --git a/functional-test/src/test/java/org/zanata/util/TestLogger.java b/functional-test/src/test/java/org/zanata/util/TestLogger.java new file mode 100644 index 0000000000..317c055450 --- /dev/null +++ b/functional-test/src/test/java/org/zanata/util/TestLogger.java @@ -0,0 +1,61 @@ +/* + * Copyright 2014, Red Hat, Inc. and individual contributors as indicated by the + * @author tags. See the copyright.txt file in the distribution for a full + * listing of individual contributors. + * + * This is free software; you can redistribute it and/or modify it under the + * terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 2.1 of the License, or (at your option) + * any later version. + * + * This software is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this software; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF + * site: http://www.fsf.org. + */ +package org.zanata.util; + +import lombok.extern.slf4j.Slf4j; + +import org.junit.runner.Description; +import org.junit.runner.notification.Failure; +import org.junit.runner.notification.RunListener; + +/** + * @author Sean Flanigan + * sflaniga@redhat.com + */ +@Slf4j +public class TestLogger extends RunListener { + @Override + public void testStarted(Description description) throws Exception { + log.info("Test {} starting", description); + } + + @Override + public void testFinished(Description description) throws Exception { + log.info("Test {} finished", description); + } + + @Override + public void testFailure(Failure failure) throws Exception { + log.error("FAILED test " + failure, failure.getException()); + } + + @Override + public void testAssumptionFailure(Failure failure) { + log.error("FAILED ASSUMPTION in test " + failure, + failure.getException()); + } + + @Override + public void testIgnored(Description description) throws Exception { + log.error("Test {} IGNORED", description); + } + +}