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

import java.util.Date;

import org.openiaml.model.tests.CodegenTestCase;

/**
* SetWires connecting to SyncWires.
*
* @implementation SetWire
* If a {@model SetWire} is chained with a {@model SyncWire},
* changes from the SetWire source will update the target of the
* SyncWire.
*
* @author jmwright
*
*/
public class SetWireSync extends CodegenTestCase {

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

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

String source = getLabelIDForText("source");
assertLabeledFieldEquals(source, "");

String sync1 = getLabelIDForText("sync1");
assertLabeledFieldEquals(sync1, "");

String sync2 = getLabelIDForText("sync2");
assertLabeledFieldEquals(sync2, "");
}

/**
* Set 'source' to a value should set the other fields.
*
* @throws Exception
*/
public void testSetSync() throws Exception {
beginAtSitemapThenPage("Home");

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

String sync1 = getLabelIDForText("sync1");
assertLabeledFieldEquals(sync1, test);

String sync2 = getLabelIDForText("sync2");
assertLabeledFieldEquals(sync2, test);
}

/**
* Set 'sync1' to a value should not set the 'source'
* field, but set 'sync2' (since they're connected with
* SyncWires)
*
* @throws Exception
*/
public void testSyncNoSet() throws Exception {
beginAtSitemapThenPage("Home");

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

// should have changed (SyncWire)
String sync2 = getLabelIDForText("sync2");
assertLabeledFieldEquals(sync2, test);

// should not have changed
String source = getLabelIDForText("source");
assertLabeledFieldEquals(source, "");

}


}

Change log

r1561 by soundasleep on Feb 22, 2010   Diff
replacing '@operational' modeldoc tag with
'@implementation'
fixing some broken '@link' javadoc tags,
which were causing problems with generated
modeldoc
modeldoc no longer displays Operational
Semantics unless there are some
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
r991 by soundasleep on Aug 12, 2009   Diff
adding failing SetWire test cases
All revisions of this file

File info

Size: 2273 bytes, 93 lines
Powered by Google Project Hosting