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

import org.eclipse.core.resources.IFile;
import org.openiaml.model.tests.CodegenTestCase;

/**
* Labels can be shown or hidden.
*
* @implementation Label
* By default, a {@model Label} is visible.
*/
public class LabelHideShow extends CodegenTestCase {

@Override
protected void setUp() throws Exception {
super.setUp();
root = loadAndCodegen(LabelHideShow.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("test value");

}

/**
* @implementation Label
* If a {@model Label} is shown, calling the {@model BuiltinOperation 'hide'}
* operation will hide it from view.
*/
public void testHideLabel() throws Exception {

beginAtSitemapThenPage("Home");
clickButtonWithText("hide");
assertLabelTextNotPresent("test value");

}

/**
* @implementation Label
* If a {@model Label} is already shown, calling the {@model BuiltinOperation 'show'}
* operation has no effect.
*/
public void testShowLabel() throws Exception {

beginAtSitemapThenPage("Home");
clickButtonWithText("show");
assertLabelTextPresent("test value");

}

/**
* @implementation Label
* If a {@model Label} is hidden, calling the {@model BuiltinOperation 'show'}
* operation will place it back into view.
*/
public void testHideThenShow() throws Exception {

beginAtSitemapThenPage("Home");
clickButtonWithText("hide");
assertLabelTextNotPresent("test value");

// now click show
clickButtonWithText("show");
assertLabelTextPresent("test value");

}


/**
* @implementation Label
* If a {@model Label} is hidden, calling the {@model BuiltinOperation 'hide'}
* operation again will have no effect.
*/
public void testHideThenHide() throws Exception {

beginAtSitemapThenPage("Home");
clickButtonWithText("hide");
assertLabelTextNotPresent("test value");

// click it again; no effect
clickButtonWithText("hide");
assertLabelTextNotPresent("test value");

// now click show
clickButtonWithText("show");
assertLabelTextPresent("test value");

}

/**
* @implementation Label
* If a {@model Label} is hidden, the visibility of the Label will
* persist, according to the overall {@model Scope}.
*
* @throws Exception
*/
public void testHiddenPersists() throws Exception {

IFile sitemap = beginAtSitemapThenPage("Home");
clickButtonWithText("hide");
assertLabelTextNotPresent("test value");

// reload the page
reloadPage(sitemap, "Home");

// still not present
assertLabelTextNotPresent("test value");

// reload the application
restartSession(sitemap, "Home");

// still not present
assertLabelTextNotPresent("test value");

}

}

Change log

r3072 by soundasleep on Aug 8, 2011   Diff
fixing references to old metamodel
elements across project documentation
Go to: 
Project members, sign in to write a code review

Older revisions

r1700 by soundasleep on Mar 14, 2010   Diff
adding test cases for LabelHideShow
All revisions of this file

File info

Size: 3093 bytes, 134 lines
Powered by Google Project Hosting