Debian Codegraph @

test/encoding/TestDefaultTM.java

raw
1 /*
2 * Copyright 2002-2004 The Apache Software Foundation.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17 package test.encoding;
18
19 import junit.framework.TestCase;
20 import org.apache.axis.encoding.TypeMappingRegistryImpl;
21 import org.apache.axis.Constants;
22
23 import javax.xml.rpc.encoding.TypeMapping;
24
25 /**
26 * Default Type Mapping tests
27 */
28 public class TestDefaultTM extends TestCase {
29 /**
30 * This test makes sure that there aren't any SOAPENC types
31 * mapped in the default type mappings for any of the valid
32 * "version" strings.
33 *
34 * @throws Exception
35 */
36 public void testNoSOAPENCTypes() throws Exception {
37 checkTypes(null);
38 checkTypes("1.0");
39 checkTypes("1.1");
40 checkTypes("1.2");
41 checkTypes("1.3");
42 }
43
44 private void checkTypes(String version) throws Exception {
45 TypeMappingRegistryImpl tmr = new TypeMappingRegistryImpl();
46 tmr.doRegisterFromVersion(version);
47 TypeMapping tm = tmr.getDefaultTypeMapping();
48 assertNull("Found mapping for soapenc:string in TM version " + version,
49 tm.getDeserializer(null, Constants.SOAP_STRING));
50 }
51 }