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
/**
*
*/
package org.openiaml.model.tests.codegen.model0_4_4;

import org.openiaml.model.tests.CodegenTestCase;

/**
* @implementation InputTextField
* An {@model InputTextField} can contain additional {@model Label}s.
* @example InputTextField
* An {@model InputTextField} can contain additional {@model Label}s.
*/
public class TextFieldAnnotation extends CodegenTestCase {

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

/**
* The home page can be accessed.
*
* @throws Exception
*/
public void testHome() throws Exception {

beginAtSitemapThenPage("Home");
assertNoProblem();

}

public void testLabelIsPresent() throws Exception {

beginAtSitemapThenPage("Home");
assertLabelTextPresent("hello, world!");

}

/**
* If we update the 'update annotation' text field, the
* label is also updated.
*
* @throws Exception
*/
public void testUpdateAnnotation() throws Exception {

beginAtSitemapThenPage("Home");

{
String target = getLabelIDForText("update annotation");
assertLabeledFieldEquals(target, "hello, world!");
setLabeledFormElementField(target, "a new annotation");
}

// label should have changed
assertLabelTextNotPresent("hello, world!");
assertLabelTextPresent("a new annotation");

}

/**
* If we update the annotation, the containing text field of the
* label does not change.
*
* @throws Exception
*/
public void testUpdateAnnotationDoesNotChangeContainingLabel() throws Exception {

beginAtSitemapThenPage("Home");

{
String target = getLabelIDForText("text field");
assertLabeledFieldEquals(target, ""); // empty
setLabeledFormElementField(target, "should not change");
}

// update the annotation
{
String target = getLabelIDForText("update annotation");
assertLabeledFieldEquals(target, "hello, world!");
setLabeledFormElementField(target, "a new annotation");
}

// label should have changed
assertLabelTextNotPresent("hello, world!");
assertLabelTextPresent("a new annotation");

// but the containing text field should not have
{
String target = getLabelIDForText("text field");
assertLabeledFieldEquals(target, "should not change");
}

}

}

Change log

r2297 by soundasleep on May 25, 2010   Diff
updating failing test cases
Go to: 
Project members, sign in to write a code review

Older revisions

r1704 by soundasleep on Mar 14, 2010   Diff
adding test case for
TextFieldAnnotation
VisibleThings now also render
contained children
All revisions of this file

File info

Size: 2411 bytes, 98 lines
Powered by Google Project Hosting