    1   package org.seasar.remoting.axis.connector;
    2
    3   import javax.xml.rpc.encoding.TypeMapping;
    4
    5   import junit.framework.TestCase;
    6
    7   import org.apache.axis.client.Service;
    8   import org.apache.axis.enum.Use;
    9   import org.seasar.remoting.axis.encoding.AutoRegisterTypeMappingImpl;
    10
    11  /***
    12   * @author koichik
    13   */
    14  public class AxisConnectorTest extends TestCase {
    15      public AxisConnectorTest() {
    16      }
    17
    18      public AxisConnectorTest(String name) {
    19          super(name);
    20      }
    21
    22      public void testSetService() {
    23          Service service = new Service();
    24
    25          AxisConnector connector = new AxisConnector();
    26          connector.setService(service);
    27
    28          TypeMapping tm = service.getTypeMappingRegistry().getTypeMapping(Use.DEFAULT.getEncoding());
    29          assertTrue(tm instanceof AutoRegisterTypeMappingImpl);
    30
    31          connector = new AxisConnector();
    32          connector.setService(service);
    33          assertSame(tm, service.getTypeMappingRegistry().getTypeMapping(Use.DEFAULT.getEncoding()));
    34      }
    35  }