1 | package de.ugoe.cs.eventbench.assertions;
|
---|
2 |
|
---|
3 | import de.ugoe.cs.eventbench.data.IReplayable;
|
---|
4 | import de.ugoe.cs.util.StringTools;
|
---|
5 |
|
---|
6 | /**
|
---|
7 | * <p>
|
---|
8 | * This class defines the replay for file equals assertions.
|
---|
9 | * </p>
|
---|
10 | *
|
---|
11 | * @author Jeffrey Hall, Steffen Herbold
|
---|
12 | * @version 2.0
|
---|
13 | */
|
---|
14 | public class FileEqualsReplay implements IReplayable {
|
---|
15 |
|
---|
16 | /**
|
---|
17 | * <p>
|
---|
18 | * The file that should be equal to expectedFile.
|
---|
19 | * </p>
|
---|
20 | */
|
---|
21 | String actualFile = null;
|
---|
22 |
|
---|
23 | /**
|
---|
24 | * <p>
|
---|
25 | * The file that is used as the reference.
|
---|
26 | * </p>
|
---|
27 | */
|
---|
28 | String expectedFile = null;
|
---|
29 |
|
---|
30 | /**
|
---|
31 | * <p>
|
---|
32 | * Id for object serialization.
|
---|
33 | * </p>
|
---|
34 | */
|
---|
35 | private static final long serialVersionUID = 1L;
|
---|
36 |
|
---|
37 | /**
|
---|
38 | * <p>
|
---|
39 | * Constructor. Creates a new FileEqualsReplay.
|
---|
40 | * </p>
|
---|
41 | *
|
---|
42 | * @param expectedFile
|
---|
43 | * name and path of the expected file
|
---|
44 | * @param actualFile
|
---|
45 | * name and path of the actual file
|
---|
46 | */
|
---|
47 | public FileEqualsReplay(String expectedFile, String actualFile) {
|
---|
48 | this.expectedFile = expectedFile;
|
---|
49 | this.actualFile = actualFile;
|
---|
50 | }
|
---|
51 |
|
---|
52 | /*
|
---|
53 | * (non-Javadoc)
|
---|
54 | *
|
---|
55 | * @see de.ugoe.cs.eventbench.data.IReplayable#getReplay()
|
---|
56 | */
|
---|
57 | public String getReplay() {
|
---|
58 |
|
---|
59 | actualFile = StringTools.xmlEntityReplacement(actualFile);
|
---|
60 | expectedFile = StringTools.xmlEntityReplacement(expectedFile);
|
---|
61 |
|
---|
62 | StringBuilder currentMsgStr = new StringBuilder(800);
|
---|
63 | currentMsgStr.append(" <fileEquals ");
|
---|
64 | currentMsgStr.append("actualFile=\"" + actualFile + "\" ");
|
---|
65 | currentMsgStr.append("expectedFile=\"" + expectedFile + "\"/>");
|
---|
66 | currentMsgStr.append(StringTools.ENDLINE);
|
---|
67 | return currentMsgStr.toString();
|
---|
68 | }
|
---|
69 |
|
---|
70 | /*
|
---|
71 | * (non-Javadoc)
|
---|
72 | *
|
---|
73 | * @see de.ugoe.cs.eventbench.data.IReplayable#getTarget()
|
---|
74 | */
|
---|
75 | @Override
|
---|
76 | public String getTarget() {
|
---|
77 | return "targetNotUsed";
|
---|
78 | }
|
---|
79 |
|
---|
80 | }
|
---|