40093367 |
1 | #INTERFACE CAF |
2 | puts "================" |
3 | puts "OCC1228" |
4 | puts "================" |
5 | puts "" |
6 | |
7 | # Tree construction attributes |
8 | # |
9 | # Testing attribute: TDataStd_TreeNode |
10 | # |
11 | # Testing command: SetNode |
12 | # |
13 | # Testing command: RootNode |
14 | # |
15 | |
16 | # ANALOG: puts "caf005-C2" |
17 | |
18 | # Create a new document and set UndoLimit |
19 | NewDocument Doc BinOcaf |
20 | UndoLimit Doc 100 |
21 | |
22 | # Open a transaction |
23 | NewCommand Doc |
24 | |
25 | # Add an attribute to a data framework |
26 | set aLabel_Root 0:2 |
27 | set aName_Root Label_1 |
28 | Label Doc ${aLabel_Root} |
29 | SetName Doc ${aLabel_Root} ${aName_Root} |
30 | SetNode Doc ${aLabel_Root} |
31 | |
32 | # Close/Open the transaction |
33 | NewCommand Doc |
34 | |
35 | # Save the document |
8418c617 |
36 | set aFile ${imagedir}/OCC1228-[file tail [info script]].cbf |
40093367 |
37 | file delete ${aFile} |
38 | catch {SaveAs Doc ${aFile}} |
39 | if { ![file exists ${aFile}] } { |
40 | puts "There is not ${aFile} file; SaveAs command: Error" |
41 | puts "OCC1228: ERROR (case 1)" |
42 | } |
43 | #catch {exec chmod 777 ${aFile}} |
44 | |
45 | # Restore the document |
46 | Close Doc |
47 | catch {Open ${aFile} DDoc} |
48 | |
49 | # Get a value of the attribute |
50 | set aGetLabel_Root "" |
51 | set IsDone [catch {set aGetLabel_Root [RootNode DDoc ${aLabel_Root}]} aResult] |
52 | if { ${IsDone} != 0 || |
53 | ${aLabel_Root}!=${aGetLabel_Root} } { |
54 | puts "aLabel_Root=${aLabel_Root} aGetLabel_Root=${aGetLabel_Root}" |
55 | puts ${aResult} |
56 | puts "Get a value of TDataStd_TreeNode attribute from restoring document: Error" |
57 | puts "OCC1228: ERROR (case 2)" |
58 | } else { |
59 | puts "Get a value of TDataStd_TreeNode attribute from restoring document: OK" |
60 | puts "OCC1228: OK" |
61 | } |