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 | * The file that should be equal to expectedFile.
|
---|
18 | */
|
---|
19 | String actualFile = null;
|
---|
20 |
|
---|
21 | /**
|
---|
22 | * The file that is used as the reference.
|
---|
23 | */
|
---|
24 | String expectedFile = null;
|
---|
25 |
|
---|
26 | /**
|
---|
27 | * <p>
|
---|
28 | * Id for object serialization.
|
---|
29 | * </p>
|
---|
30 | */
|
---|
31 | private static final long serialVersionUID = 1L;
|
---|
32 |
|
---|
33 | /**
|
---|
34 | * <p>
|
---|
35 | * Constructor. Creates a new FileEqualsReplay.
|
---|
36 | * </p>
|
---|
37 | *
|
---|
38 | * @param expectedFile
|
---|
39 | * name and path of the expected file
|
---|
40 | * @param actualFile
|
---|
41 | * name and path of the actual file
|
---|
42 | */
|
---|
43 | public FileEqualsReplay(String expectedFile, String actualFile) {
|
---|
44 | this.expectedFile = expectedFile;
|
---|
45 | this.actualFile = actualFile;
|
---|
46 | }
|
---|
47 |
|
---|
48 | /*
|
---|
49 | * (non-Javadoc)
|
---|
50 | *
|
---|
51 | * @see de.ugoe.cs.eventbench.data.IReplayable#getReplay()
|
---|
52 | */
|
---|
53 | public String getReplay() {
|
---|
54 |
|
---|
55 | actualFile = StringTools.xmlEntityReplacement(actualFile);
|
---|
56 | expectedFile = StringTools.xmlEntityReplacement(expectedFile);
|
---|
57 |
|
---|
58 | StringBuilder currentMsgStr = new StringBuilder(800);
|
---|
59 | currentMsgStr.append(" <fileEquals ");
|
---|
60 | currentMsgStr.append("actualFile=\"" + actualFile + "\" ");
|
---|
61 | currentMsgStr.append("expectedFile=\"" + expectedFile + "\"/>");
|
---|
62 | currentMsgStr.append(StringTools.ENDLINE);
|
---|
63 | return currentMsgStr.toString();
|
---|
64 | }
|
---|
65 |
|
---|
66 | /*
|
---|
67 | * (non-Javadoc)
|
---|
68 | *
|
---|
69 | * @see de.ugoe.cs.eventbench.data.IReplayable#getTarget()
|
---|
70 | */
|
---|
71 | @Override
|
---|
72 | public String getTarget() {
|
---|
73 | return "targetNotUsed";
|
---|
74 | }
|
---|
75 |
|
---|
76 | }
|
---|