Changeset 340


Ignore:
Timestamp:
12/21/11 12:25:17 (12 years ago)
Author:
sherbold
Message:
Location:
trunk/EventBenchCore/src/de/ugoe/cs/eventbench/assertions
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/EventBenchCore/src/de/ugoe/cs/eventbench/assertions/FileEqualsReplay.java

    r327 r340  
    11package de.ugoe.cs.eventbench.assertions; 
     2 
     3import java.security.InvalidParameterException; 
    24 
    35import de.ugoe.cs.eventbench.data.IReplayable; 
     
    1921         * </p> 
    2022         */ 
    21         String actualFile = null; 
     23        protected final String actualFile; 
    2224 
    2325        /** 
     
    2628         * </p> 
    2729         */ 
    28         String expectedFile = null; 
     30        protected final String expectedFile; 
    2931 
    3032        /** 
     
    4446         * @param actualFile 
    4547         *            name and path of the actual file 
     48         * @throws InvalidParameterException 
     49         *             thrown if expectedFile or actualFile are null 
    4650         */ 
    4751        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                } 
    4859                this.expectedFile = expectedFile; 
    4960                this.actualFile = actualFile; 
     
    5768        public String getReplay() { 
    5869 
    59                 actualFile = StringTools.xmlEntityReplacement(actualFile); 
    60                 expectedFile = StringTools.xmlEntityReplacement(expectedFile); 
     70                String actualFileTmp = StringTools.xmlEntityReplacement(actualFile); 
     71                String expectedFileTmp = StringTools.xmlEntityReplacement(expectedFile); 
    6172 
    6273                StringBuilder currentMsgStr = new StringBuilder(800); 
    6374                currentMsgStr.append("  <fileEquals "); 
    64                 currentMsgStr.append("actualFile=\"" + actualFile + "\" "); 
    65                 currentMsgStr.append("expectedFile=\"" + expectedFile + "\"/>"); 
     75                currentMsgStr.append("actualFile=\"" + actualFileTmp + "\" "); 
     76                currentMsgStr.append("expectedFile=\"" + expectedFileTmp + "\"/>"); 
    6677                currentMsgStr.append(StringTools.ENDLINE); 
    6778                return currentMsgStr.toString(); 
  • trunk/EventBenchCore/src/de/ugoe/cs/eventbench/assertions/TextEqualsReplay.java

    r229 r340  
    11package de.ugoe.cs.eventbench.assertions; 
     2 
     3import java.security.InvalidParameterException; 
    24 
    35import de.ugoe.cs.eventbench.data.IReplayable; 
     
    1921         * </p> 
    2022         */ 
    21         private String expectedValue; 
     23        protected final String expectedValue; 
    2224 
    2325        /** 
     
    2628         * </p> 
    2729         */ 
    28         private String target; 
     30        protected final String target; 
    2931 
    3032        /** 
     
    3537        private static final long serialVersionUID = 1L; 
    3638 
     39        /** 
     40         * <p> 
     41         * Constructor. Creates a new TextEqualsReplay. 
     42         *  
     43         * @param expectedValue 
     44         *            expected string value 
     45         * @param target 
     46         *            string description of the target whose string value is 
     47         *            compared to the expected value 
     48         * @throws InvalidParameterException 
     49         *             thrown if target is null 
     50         */ 
    3751        public TextEqualsReplay(String expectedValue, String target) { 
     52                if (target == null) { 
     53                        throw new InvalidParameterException("target must not be null"); 
     54                } 
    3855                this.expectedValue = expectedValue; 
    3956                this.target = target; 
     
    4865        public String getReplay() { 
    4966 
    50                 expectedValue = StringTools.xmlEntityReplacement(expectedValue); 
     67                String expectedValueTmp = StringTools.xmlEntityReplacement(expectedValue); 
    5168 
    5269                StringBuilder currentMsgStr = new StringBuilder(400); 
    53                 currentMsgStr.append(" <textEquals expectedValue=\"" + expectedValue 
     70                currentMsgStr.append(" <textEquals expectedValue=\"" + expectedValueTmp 
    5471                                + "\">"); 
    5572                currentMsgStr.append(StringTools.ENDLINE); 
Note: See TracChangeset for help on using the changeset viewer.