001package org.w3.ldp.testsuite.exception;
002
003import java.io.PrintWriter;
004import java.text.DateFormat;
005import java.util.Date;
006
007/**
008 * Custom SkipException, just to log the skipped tests
009 */
010public class SkipException extends org.testng.SkipException {
011
012        private static final long serialVersionUID = 1L;
013
014        public static final DateFormat df = DateFormat.getDateTimeInstance();
015
016        public SkipException(String test, String skipMessage) {
017                this(test, skipMessage, null);
018        }
019
020        public SkipException(String test, String skipMessage, PrintWriter skipLog) {
021                super(skipMessage);
022                if (skipLog != null) {
023                        skipLog.println(String.format("[%s] skipped test %s: %s", df.format(new Date()), test, skipMessage));
024                }
025        }
026
027}