/
GateRequiredPage.java
106 lines (84 loc) · 2.52 KB
/
GateRequiredPage.java
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
/**
*
*/
package org.openiaml.model.tests.codegen.model0_4_2;
import org.eclipse.core.resources.IFile;
import org.openiaml.model.tests.CodegenTestCase;
/**
* Showing how to simplify the EntryGate requirements using
* Model Completion.
*
* @author jmwright
* @example Gate
* If an entry {@model Gate} is connected by an {@model ECARule} called "first",
* then the target {@model Frame} must be viewed at least once before proceeding.
* @implementation Gate,ECARule
* If an entry {@model Gate} is connected by an {@model ECARule} called "first",
* then the target {@model Frame} must be viewed at least once before proceeding.
*/
public class GateRequiredPage extends CodegenTestCase {
@Override
protected void setUp() throws Exception {
super.setUp();
root = loadAndCodegen(GateRequiredPage.class);
}
/**
* The home page is empty.
*
* @throws Exception
*/
public void testHome() throws Exception {
beginAtSitemapThenPage("Home");
assertNoProblem();
}
/**
* If we try to visit 'Page 1', we are forced to visit
* the disclaimer.
*
* @throws Exception
*/
public void testRequired() throws Exception {
beginAtSitemapThenPage("Page 1", "Required Page");
assertNoProblem();
}
/**
* If we try to visit 'Page 1', we have to visit the
* disclaimer; we can then visit 'Page 1' after this.
*
* @throws Exception
*/
public void testRequiredVisit() throws Exception {
IFile sitemap = beginAtSitemapThenPage("Page 1", "Required Page");
assertTitleEquals("Required Page");
// try going to Page 1 now
gotoSitemapThenPage(sitemap, "Page 1");
assertTitleEquals("Page 1");
}
/**
* If we get interrupted, we can resume from where the gate threw us off.
*
* @inference Gate
* If a {@model Gate} is protected by a "first" {@model ECARule},
* then the destination {@model Frame} will have a new {@model Button} created
* called "Continue"
* @throws Exception
*/
public void testRequiredResume() throws Exception {
beginAtSitemapThenPage("Page 2", "Required Page");
assertTitleEquals("Required Page");
// click on the 'resume' button (generated)
clickButtonWithText("Continue");
assertTitleEquals("Page 2");
}
/**
* Visiting the disclaimer is limited to only the session.
*
* @throws Exception
*/
public void testRequiredLimitedToSession() throws Exception {
// first session
testRequiredVisit();
// second session
testRequiredVisit();
}
}