forked from hflicka/arden2bytecode
-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathTestCompilerMappings.java
More file actions
136 lines (126 loc) · 3.63 KB
/
TestCompilerMappings.java
File metadata and controls
136 lines (126 loc) · 3.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
package arden.tests.specification.testcompiler;
/**
* Container for test mappings. See each methods comment for more information.
*/
public class TestCompilerMappings {
protected String interfaceMapping;
protected String messageMapping;
protected String destinationMapping;
protected String readMapping;
protected String readMultipleMapping;
private long eventNr = 0;
public TestCompilerMappings() {
}
public TestCompilerMappings(String interfaceMapping, String messageMapping,
String destinationMapping, String readMapping, String readMultipleMapping) {
this.interfaceMapping = interfaceMapping;
this.messageMapping = messageMapping;
this.destinationMapping = destinationMapping;
this.readMapping = readMapping;
this.readMultipleMapping = readMultipleMapping;
}
/**
* This method is used to test <code>INTERFACE</code> mappings. <br>
* It must be possible to <code>CALL</code> the interface for this mapping.
* It must accept parameters and return the following two values: <br>
* <ol>
* <li><code>args[0] + args[1]</code></li>
* <li><code>args[0] * args[1]</code></li>
* </ol>
*
* @return a mapping for an interface
*/
public String getInterfaceMapping() {
return interfaceMapping;
}
/**
* This method is used to test events. <br>
* Test MLMs must be able to subscribe to the event for this mapping via the
* evoke slot. It must also be possible to <code>CALL</code> the event. <br>
* A mapping for a different event should be returned every time.
*
* @return a mapping for an event
*/
public String createEventMapping() {
return "event " + eventNr++;
}
/**
* This method is used to test messages. The message for this mapping must
* contain the text "test message".
*
* @return a mapping for a message
*/
public String getMessageMapping() {
return messageMapping;
}
/**
* This method is used to test destinations.
*
* @return a mapping for a message
*/
public String getDestinationMapping() {
return destinationMapping;
}
/**
* This method is used to test the <code>READ</code> statement. <br>
* When the mapping is read, it must return a list of the following values
* with their respective primary time:
*
* <table summary="database content">
* <tr>
* <th>Value</th><th>Primary Time</th>
* </tr>
* <tr>
* <td>1</td><td>2000-01-01T00:00:00</td>
* </tr>
* <tr>
* <td>2</td><td>1990-01-02T00:00:00</td>
* </tr>
* <tr>
* <td>3</td><td>1990-01-01T00:00:00</td>
* </tr>
* <tr>
* <td>4</td><td>1990-01-03T00:00:00</td>
* </tr>
* <tr>
* <td>5</td><td>1970-01-01T00:00:00</td>
* </tr>
* </table>
*
* @return a mapping for a database query
*/
public String getReadMapping() {
return readMapping;
}
/**
* This method is used to test the <code>READ</code> and
* <code>READ AS</code> statements. <br>
* When the mapping is read, it must return two lists, one for each of the
* following value columns:
*
* <table summary="database content">
* <tr>
* <th>Value1</th><th>Value2</th><th>Primary Time</th>
* </tr>
* <tr>
* <td>1</td><td>"a"</td><td>2000-01-01T00:00:00</td>
* </tr>
* <tr>
* <td>2</td><td>"b"</td><td>1990-01-02T00:00:00</td>
* </tr>
* <tr>
* <td>3</td><td>"c"</td><td>1990-01-01T00:00:00</td>
* </tr>
* <tr>
* <td>4</td><td>"d"</td><td>1990-01-03T00:00:00</td>
* </tr>
* <tr>
* <td>5</td><td>"e"</td><td>1970-01-01T00:00:00</td>
* </tr>
* </table>
* @return a mapping for a database query
*/
public String getReadMultipleMapping() {
return readMultipleMapping;
}
}