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

import java.util.Date;

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

/**
* SetWires connecting to SyncWires operating over multiple pages,
* both client and server.
*
* @example SetWire,SyncWire
* Chaining {@model SetWire SetWires} and {@model SyncWire SyncWires}
* together across multiple {@model Frame Frames}.
*
* @author jmwright
*
*/
public class SetWireSyncChained extends CodegenTestCase {

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

/**
* Check the initial state of the application.
*
* @throws Exception
*/
public void testInitial() throws Exception {
IFile sitemap = beginAtSitemapThenPage("page3");

// page 3
String changed = getLabelIDForText("changed"); // sync
assertLabeledFieldEquals(changed, "");

// page 2
gotoSitemapThenPage(sitemap, "page2");
String target = getLabelIDForText("target"); //set
assertLabeledFieldEquals(target, "");

// Home
gotoSitemapThenPage(sitemap, "Home");
String source = getLabelIDForText("source");
assertLabeledFieldEquals(source, "");
}

/**
* Set a value and check each page in succession.
*
* @throws Exception
*/
public void testSuccessive() throws Exception {
IFile sitemap = beginAtSitemapThenPage("Home");

String test = "test1 " + new Date();
String source = getLabelIDForText("source");
assertLabeledFieldEquals(source, "");
setLabeledFormElementField(source, test);

// page 2
gotoSitemapThenPage(sitemap, "page2");
String target = getLabelIDForText("target"); //set
assertLabeledFieldEquals(target, test);

// page 3
gotoSitemapThenPage(sitemap, "page3");
String changed = getLabelIDForText("changed"); // sync
assertLabeledFieldEquals(changed, test);
}

/**
* Set a value and check the pages randomly.
*
* @throws Exception
*/
public void testRandomly() throws Exception {
IFile sitemap = beginAtSitemapThenPage("Home");

String test = "test1 " + new Date();
String source = getLabelIDForText("source");
assertLabeledFieldEquals(source, "");
setLabeledFormElementField(source, test);

// page 3
gotoSitemapThenPage(sitemap, "page3");
String changed = getLabelIDForText("changed"); // sync
assertLabeledFieldEquals(changed, test);

// page 2
gotoSitemapThenPage(sitemap, "page2");
String target = getLabelIDForText("target"); //set
assertLabeledFieldEquals(target, test);
}

/**
* Setting only the SyncWire does not change the SetWire.
*
* @throws Exception
*/
public void testSyncNotSet() throws Exception {
IFile sitemap = beginAtSitemapThenPage("page3");

String test = "test1 " + new Date();
String changed = getLabelIDForText("changed"); // sync
assertLabeledFieldEquals(changed, "");
setLabeledFormElementField(changed, test);

// page 2
gotoSitemapThenPage(sitemap, "page2");
String target = getLabelIDForText("target"); //set
assertLabeledFieldEquals(target, test);

// Home
gotoSitemapThenPage(sitemap, "Home");
String source = getLabelIDForText("source");
assertLabeledFieldEquals(source, "");

}

}

Change log

r1640 by soundasleep on Mar 7, 2010   Diff
fixing all broken @model links in javadoc,
and genmodel docs
Go to: 
Project members, sign in to write a code review

Older revisions

r1231 by soundasleep on Sep 30, 2009   Diff
adding operational semantics and
examples to most other model 0.4
codegen test cases
r992 by soundasleep on Aug 13, 2009   Diff
SetWire codegen tests now pass
adding inference test for SetWire
SetWire is now also a
WireEdgeDestination
r991 by soundasleep on Aug 12, 2009   Diff
adding failing SetWire test cases
All revisions of this file

File info

Size: 3366 bytes, 126 lines
Powered by Google Project Hosting