Changeset 559 for trunk/quest-core-assertions
- Timestamp:
- 08/17/12 09:05:19 (13 years ago)
- Location:
- trunk/quest-core-assertions/src/main/java/de/ugoe/cs/quest/assertions
- Files:
-
- 4 edited
-
FileEqualsAssertEvent.java (modified) (1 diff)
-
FileEqualsReplay.java (modified) (2 diffs)
-
TextEqualsAssertEventType.java (modified) (1 diff)
-
TextEqualsReplay.java (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/quest-core-assertions/src/main/java/de/ugoe/cs/quest/assertions/FileEqualsAssertEvent.java
r548 r559 1 1 2 package de.ugoe.cs.quest.assertions; 2 3 -
trunk/quest-core-assertions/src/main/java/de/ugoe/cs/quest/assertions/FileEqualsReplay.java
r548 r559 1 1 2 package de.ugoe.cs.quest.assertions; 2 3 … … 16 17 public class FileEqualsReplay implements IReplayable { 17 18 18 /**19 * <p>20 * The file that should be equal to expectedFile.21 * </p>22 */23 protected final String actualFile;19 /** 20 * <p> 21 * The file that should be equal to expectedFile. 22 * </p> 23 */ 24 protected final String actualFile; 24 25 25 /**26 * <p>27 * The file that is used as the reference.28 * </p>29 */30 protected final String expectedFile;26 /** 27 * <p> 28 * The file that is used as the reference. 29 * </p> 30 */ 31 protected final String expectedFile; 31 32 32 /**33 * <p>34 * Id for object serialization.35 * </p>36 */37 private static final long serialVersionUID = 1L;33 /** 34 * <p> 35 * Id for object serialization. 36 * </p> 37 */ 38 private static final long serialVersionUID = 1L; 38 39 39 /** 40 * <p> 41 * Constructor. Creates a new FileEqualsReplay. 42 * </p> 43 * 44 * @param expectedFile 45 * name and path of the expected file 46 * @param actualFile 47 * name and path of the actual file 48 * @throws InvalidParameterException 49 * thrown if expectedFile or actualFile are null 50 */ 51 public FileEqualsReplay(String expectedFile, String actualFile) { 52 if (expectedFile == null) { 53 throw new InvalidParameterException( 54 "expected file must not be null"); 55 } 56 if (actualFile == null) { 57 throw new InvalidParameterException("actual file must not be null"); 58 } 59 this.expectedFile = expectedFile; 60 this.actualFile = actualFile; 61 } 40 /** 41 * <p> 42 * Constructor. Creates a new FileEqualsReplay. 43 * </p> 44 * 45 * @param expectedFile 46 * name and path of the expected file 47 * @param actualFile 48 * name and path of the actual file 49 * @throws InvalidParameterException 50 * thrown if expectedFile or actualFile are null 51 */ 52 public FileEqualsReplay(String expectedFile, String actualFile) { 53 if (expectedFile == null) { 54 throw new InvalidParameterException("expected file must not be null"); 55 } 56 if (actualFile == null) { 57 throw new InvalidParameterException("actual file must not be null"); 58 } 59 this.expectedFile = expectedFile; 60 this.actualFile = actualFile; 61 } 62 62 63 /*64 * (non-Javadoc)65 *66 * @see de.ugoe.cs.quest.eventcore.IReplayable#getReplay()67 */68 public String getReplay() {63 /* 64 * (non-Javadoc) 65 * 66 * @see de.ugoe.cs.quest.eventcore.IReplayable#getReplay() 67 */ 68 public String getReplay() { 69 69 70 String actualFileTmp = StringTools.xmlEntityReplacement(actualFile);71 String expectedFileTmp = StringTools.xmlEntityReplacement(expectedFile);70 String actualFileTmp = StringTools.xmlEntityReplacement(actualFile); 71 String expectedFileTmp = StringTools.xmlEntityReplacement(expectedFile); 72 72 73 StringBuilder currentMsgStr = new StringBuilder(800);74 currentMsgStr.append(" <fileEquals ");75 currentMsgStr.append("actualFile=\"" + actualFileTmp + "\" ");76 currentMsgStr.append("expectedFile=\"" + expectedFileTmp + "\"/>");77 currentMsgStr.append(StringTools.ENDLINE);78 return currentMsgStr.toString();79 }73 StringBuilder currentMsgStr = new StringBuilder(800); 74 currentMsgStr.append(" <fileEquals "); 75 currentMsgStr.append("actualFile=\"" + actualFileTmp + "\" "); 76 currentMsgStr.append("expectedFile=\"" + expectedFileTmp + "\"/>"); 77 currentMsgStr.append(StringTools.ENDLINE); 78 return currentMsgStr.toString(); 79 } 80 80 81 81 } -
trunk/quest-core-assertions/src/main/java/de/ugoe/cs/quest/assertions/TextEqualsAssertEventType.java
r548 r559 1 1 2 package de.ugoe.cs.quest.assertions; 2 3 -
trunk/quest-core-assertions/src/main/java/de/ugoe/cs/quest/assertions/TextEqualsReplay.java
r548 r559 1 1 2 package de.ugoe.cs.quest.assertions; 2 3 … … 16 17 public class TextEqualsReplay implements IReplayable { 17 18 18 /**19 * <p>20 * Reference value which is compared to the targets text.21 * </p>22 */23 protected final String expectedValue;19 /** 20 * <p> 21 * Reference value which is compared to the targets text. 22 * </p> 23 */ 24 protected final String expectedValue; 24 25 25 /**26 * <p>27 * Target to which the text is compared.28 * </p>29 */30 protected final String target;26 /** 27 * <p> 28 * Target to which the text is compared. 29 * </p> 30 */ 31 protected final String target; 31 32 32 /**33 * <p>34 * Id for object serialization.35 * </p>36 */37 private static final long serialVersionUID = 1L;33 /** 34 * <p> 35 * Id for object serialization. 36 * </p> 37 */ 38 private static final long serialVersionUID = 1L; 38 39 39 /**40 * <p>41 * Constructor. Creates a new TextEqualsReplay.42 *43 * @param expectedValue44 * expected string value45 * @param target46 * string description of the target whose string value is 47 * compared to the expectedvalue48 * @throws InvalidParameterException49 * thrown if target is null50 */51 public TextEqualsReplay(String expectedValue, String target) {52 if (target == null) {53 throw new InvalidParameterException("target must not be null");54 }55 this.expectedValue = expectedValue;56 this.target = target;57 }40 /** 41 * <p> 42 * Constructor. Creates a new TextEqualsReplay. 43 * 44 * @param expectedValue 45 * expected string value 46 * @param target 47 * string description of the target whose string value is compared to the expected 48 * value 49 * @throws InvalidParameterException 50 * thrown if target is null 51 */ 52 public TextEqualsReplay(String expectedValue, String target) { 53 if (target == null) { 54 throw new InvalidParameterException("target must not be null"); 55 } 56 this.expectedValue = expectedValue; 57 this.target = target; 58 } 58 59 59 /*60 * (non-Javadoc)61 *62 * @see de.ugoe.cs.quest.eventcore.IReplayable#getReplay()63 */64 @Override65 public String getReplay() {60 /* 61 * (non-Javadoc) 62 * 63 * @see de.ugoe.cs.quest.eventcore.IReplayable#getReplay() 64 */ 65 @Override 66 public String getReplay() { 66 67 67 String expectedValueTmp = StringTools.xmlEntityReplacement(expectedValue);68 String expectedValueTmp = StringTools.xmlEntityReplacement(expectedValue); 68 69 69 StringBuilder currentMsgStr = new StringBuilder(400); 70 currentMsgStr.append(" <textEquals expectedValue=\"" + expectedValueTmp 71 + "\">"); 72 currentMsgStr.append(StringTools.ENDLINE); 73 currentMsgStr.append("<target>"); 74 currentMsgStr.append(StringTools.ENDLINE); 75 currentMsgStr.append(target); 76 currentMsgStr.append(StringTools.ENDLINE); 77 currentMsgStr.append("</target>"); 78 currentMsgStr.append(StringTools.ENDLINE); 79 currentMsgStr.append("</textEquals>"); 80 currentMsgStr.append(StringTools.ENDLINE); 81 return currentMsgStr.toString(); 82 } 70 StringBuilder currentMsgStr = new StringBuilder(400); 71 currentMsgStr.append(" <textEquals expectedValue=\"" + expectedValueTmp + "\">"); 72 currentMsgStr.append(StringTools.ENDLINE); 73 currentMsgStr.append("<target>"); 74 currentMsgStr.append(StringTools.ENDLINE); 75 currentMsgStr.append(target); 76 currentMsgStr.append(StringTools.ENDLINE); 77 currentMsgStr.append("</target>"); 78 currentMsgStr.append(StringTools.ENDLINE); 79 currentMsgStr.append("</textEquals>"); 80 currentMsgStr.append(StringTools.ENDLINE); 81 return currentMsgStr.toString(); 82 } 83 83 84 /*85 * (non-Javadoc)86 *87 * @see de.ugoe.cs.quest.eventcore.IReplayable#getTarget()88 */89 //@Override TODO90 public String getTarget() {91 return target;92 }84 /* 85 * (non-Javadoc) 86 * 87 * @see de.ugoe.cs.quest.eventcore.IReplayable#getTarget() 88 */ 89 // @Override TODO 90 public String getTarget() { 91 return target; 92 } 93 93 94 94 }
Note: See TracChangeset
for help on using the changeset viewer.
