Bump to 1.14.1
[platform/upstream/augeas.git] / lenses / tests / test_activemq_xml.aug
1 (*
2 Module: Test_ActiveMQ_XML
3   Provides unit tests and examples for the <ActiveMQ_XML> lens.
4 *)
5
6 module Test_ActiveMQ_XML =
7
8 (* Variable: conf *)
9 let conf = "<beans>
10  <broker xmlns=\"http://activemq.apache.org/schema/core\" brokerName=\"localhost\" dataDirectory=\"${activemq.data}\">
11   <transportConnectors>
12    <transportConnector name=\"openwire\" uri=\"tcp://0.0.0.0:61616\"/>
13   </transportConnectors>
14  </broker>
15 </beans>
16 "
17
18 (* Variable: new_conf *) 
19 let new_conf = "<beans>
20  <broker xmlns=\"http://activemq.apache.org/schema/core\" brokerName=\"localhost\" dataDirectory=\"${activemq.data}\">
21   <transportConnectors>
22    <transportConnector name=\"openwire\" uri=\"tcp://127.0.0.1:61616\"/>
23   </transportConnectors>
24  </broker>
25 </beans>
26 "
27
28 let lns = ActiveMQ_XML.lns 
29
30 (* Test: ActiveMQ_XML.lns  
31  * Get test against tree structure
32 *)
33 test lns get conf = 
34   { "beans"
35     { "#text" = "
36  " }
37     { "broker"
38       { "#attribute"
39         { "xmlns" = "http://activemq.apache.org/schema/core" }
40         { "brokerName" = "localhost" }
41         { "dataDirectory" = "${activemq.data}" }
42       }
43       { "#text" = "
44   " }
45       { "transportConnectors"
46         { "#text" = "
47    " }
48         { "transportConnector" = "#empty"
49           { "#attribute"
50             { "name" = "openwire" }
51             { "uri" = "tcp://0.0.0.0:61616" }
52           }
53         }
54         { "#text" = "  " }
55       }
56       { "#text" = " " }
57     }
58   }
59
60 (* Test: ActiveMQ_XML.lns  
61  * Put test changing transport connector to localhost
62 *)
63 test lns put conf after set "/beans/broker/transportConnectors/transportConnector/#attribute/uri" "tcp://127.0.0.1:61616" = new_conf
64
65 (* vim: set ts=4  expandtab  sw=4: *)