package de.ugoe.cs.quest.assertions; import java.security.InvalidParameterException; import de.ugoe.cs.quest.eventcore.IReplayable; import de.ugoe.cs.util.StringTools; /** *

* This class defines the replay for file equals assertions. *

* * @author Jeffrey Hall, Steffen Herbold * @version 2.0 */ public class FileEqualsReplay implements IReplayable { /** *

* The file that should be equal to expectedFile. *

*/ protected final String actualFile; /** *

* The file that is used as the reference. *

*/ protected final String expectedFile; /** *

* Id for object serialization. *

*/ private static final long serialVersionUID = 1L; /** *

* Constructor. Creates a new FileEqualsReplay. *

* * @param expectedFile * name and path of the expected file * @param actualFile * name and path of the actual file * @throws InvalidParameterException * thrown if expectedFile or actualFile are null */ public FileEqualsReplay(String expectedFile, String actualFile) { if (expectedFile == null) { throw new InvalidParameterException( "expected file must not be null"); } if (actualFile == null) { throw new InvalidParameterException("actual file must not be null"); } this.expectedFile = expectedFile; this.actualFile = actualFile; } /* * (non-Javadoc) * * @see de.ugoe.cs.quest.eventcore.IReplayable#getReplay() */ public String getReplay() { String actualFileTmp = StringTools.xmlEntityReplacement(actualFile); String expectedFileTmp = StringTools.xmlEntityReplacement(expectedFile); StringBuilder currentMsgStr = new StringBuilder(800); currentMsgStr.append(" "); currentMsgStr.append(StringTools.ENDLINE); return currentMsgStr.toString(); } /* * (non-Javadoc) * * @see de.ugoe.cs.quest.eventcore.IReplayable#getTarget() */ @Override public String getTarget() { return "targetNotUsed"; } }