01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one
03: * or more contributor license agreements. See the NOTICE file
04: * distributed with this work for additional information
05: * regarding copyright ownership. The ASF licenses this file
06: * to you under the Apache License, Version 2.0 (the
07: * "License"); you may not use this file except in compliance
08: * with the License. You may obtain a copy of the License at
09: *
10: * http://www.apache.org/licenses/LICENSE-2.0
11: *
12: * Unless required by applicable law or agreed to in writing,
13: * software distributed under the License is distributed on an
14: * * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15: * KIND, either express or implied. See the License for the
16: * specific language governing permissions and limitations
17: * under the License.
18: */
19: package org.apache.synapse.mediators.xquery;
20:
21: import org.apache.synapse.mediators.AbstractTestCase;
22:
23: /**
24: *
25: */
26:
27: public class XQueryMediatorSerializationTest extends AbstractTestCase {
28: private XQueryMediatorFactory factory;
29: private XQueryMediatorSerializer serializer;
30:
31: public XQueryMediatorSerializationTest() {
32: factory = new XQueryMediatorFactory();
33: serializer = new XQueryMediatorSerializer();
34: }
35:
36: public void testXQueryMediatorSerializationSenarioOne()
37: throws Exception {
38: String inputXml = "<xquery xmlns=\"http://ws.apache.org/ns/synapse\" key=\"querykey\" target=\"target\">"
39: + "<dataSource>"
40: + "<property name=\"username\" value=\"valueone\" />"
41: + "</dataSource>"
42: + "<variable name=\"b1\" value=\"23\" type=\"INT\" />"
43: + "<variable name=\"b1\" value=\"true\" type=\"BOOLEAN\" />"
44: + "<variable name=\"b1\" value=\"23.44\" type=\"DOUBLE\" />"
45: + "<variable name=\"b1\" value=\"23\" type=\"LONG\" />"
46: + "<variable name=\"b1\" value=\"23.1\" type=\"FLOAT\" />"
47: + "<variable name=\"b1\" value=\"23\" type=\"SHORT\" />"
48: + "<variable name=\"b1\" value=\"23\" type=\"BYTE\" />"
49: + "<variable name=\"b1\" value=\"synapse\" type=\"STRING\" />"
50: + "<variable name=\"b1\" key=\"xmlkey\" type=\"DOCUMENT\" />"
51: + "<variable name=\"b1\" key=\"xmlkey\" type=\"DOCUMENT_ELEMENT\" />"
52: + "<variable name=\"b1\" key=\"xmlkey\" type=\"ELEMENT\" />"
53: + "</xquery>";
54: assertTrue(serialization(inputXml, factory, serializer));
55:
56: }
57:
58: }
|