My favorites | Sign in
Project Home Wiki Issues Source
Checkout   Browse   Changes    
 
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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
/**
*
*/
package org.openiaml.model.tests.codegen.model0_5_3;

import java.util.Date;

import org.openiaml.model.tests.CodegenTestCase;

/**
* @example Label
* Using a hidden {@model Label} element as a {@model Parameter} for
* {@model ECARule executing} an {@model Operation}.
*
*/
public class HiddenFieldAsParameter extends CodegenTestCase {

@Override
protected void setUp() throws Exception {
super.setUp();
root = loadAndCodegen(getClass());
}

/**
* The home page can be accessed.
*
* @throws Exception
*/
public void testHome() throws Exception {
beginAtSitemapThenPage("Home");
assertNoProblem();
}

/**
* The target page can be accessed.
*
* @throws Exception
*/
public void testTargetPage() throws Exception {
beginAtSitemapThenPage("Target Frame");
assertNoProblem();
}

/**
* Clicking the button will set the target field to "", since
* no parameter has been set.
*
* @throws Exception
*/
public void testSetEmptyClick() throws Exception {
beginAtSitemapThenPage("Target Frame");

{
String target = getLabelIDForText("parameter");
assertLabeledFieldEquals(target, "");
}
{
String target = getLabelIDForText("target");
assertLabeledFieldEquals(target, "");
}

// click the button
clickButtonWithText("update target");

// still empty
{
String target = getLabelIDForText("parameter");
assertLabeledFieldEquals(target, "");
}
{
String target = getLabelIDForText("target");
assertLabeledFieldEquals(target, "");
}

assertNoProblem();

}

/**
* Set the target field, but then reset it to empty.
*
* @throws Exception
*/
public void testSetTargetThenEmptyClick() throws Exception {
beginAtSitemapThenPage("Target Frame");

{
String target = getLabelIDForText("parameter");
assertLabeledFieldEquals(target, "");
}
{
String target = getLabelIDForText("target");
assertLabeledFieldEquals(target, "");
setLabeledFormElementField(target, "to override");
assertLabeledFieldEquals(target, "to override");
}

// click the button
clickButtonWithText("update target");

// still empty
{
String target = getLabelIDForText("parameter");
assertLabeledFieldEquals(target, "");
}
{
String target = getLabelIDForText("target");
assertLabeledFieldEquals(target, ""); // reset to empty
}

assertNoProblem();

}

public void testInput() throws Exception {
beginAtSitemapThenPage("Target Frame");

String input = new Date().toString();
{
String target = getLabelIDForText("parameter");
assertLabeledFieldEquals(target, "");
setLabeledFormElementField(target, input);
}
{
String target = getLabelIDForText("target");
assertLabeledFieldEquals(target, "");
}

// click the button
clickButtonWithText("update target");
assertNoProblem();

// all changed
{
String target = getLabelIDForText("parameter");
assertLabeledFieldEquals(target, input);
}
{
String target = getLabelIDForText("target");
assertLabeledFieldEquals(target, input);
setLabeledFormElementField(target, "should be overridden");
}

// click the button again
clickButtonWithText("update target");
assertNoProblem();

// all changed
{
String target = getLabelIDForText("parameter");
assertLabeledFieldEquals(target, input);
}
{
String target = getLabelIDForText("target");
assertLabeledFieldEquals(target, input);
}

}

}

Change log

r3068 by soundasleep on Aug 8, 2011   Diff
improving modeldoc documentation across
inference rules, codegen templates, ecore,
and additional documentation includes
Go to: 
Project members, sign in to write a code review

Older revisions

r2400 by soundasleep on Jun 30, 2010   Diff
adding HiddenFieldAsParameter codegen
test case
All revisions of this file

File info

Size: 3596 bytes, 160 lines
Powered by Google Project Hosting