You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by di...@apache.org on 2003/07/02 21:35:58 UTC

cvs commit: xml-axis/java/test/encoding TestAutoTypes.java PackageTests.java

dims        2003/07/02 12:35:58

  Modified:    java/test/encoding PackageTests.java
  Added:       java/test/encoding TestAutoTypes.java
  Log:
  Test case for Bug 18084 - Auto Typing in TypeMappingImpl only puts types in the default namespace
  from dan@envoisolutions.com (Dan Diephouse)
  
  Revision  Changes    Path
  1.28      +1 -0      xml-axis/java/test/encoding/PackageTests.java
  
  Index: PackageTests.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/test/encoding/PackageTests.java,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- PackageTests.java	8 Jan 2003 16:06:29 -0000	1.27
  +++ PackageTests.java	2 Jul 2003 19:35:57 -0000	1.28
  @@ -40,6 +40,7 @@
           suite.addTestSuite(TestMultiRefIdentity.class);
           suite.addTestSuite(TestArray.class);
           suite.addTestSuite(TestCircularRefs.class);
  +        suite.addTestSuite(TestAutoTypes.class);
           return suite;
       }
   }
  
  
  
  1.1                  xml-axis/java/test/encoding/TestAutoTypes.java
  
  Index: TestAutoTypes.java
  ===================================================================
  package test.encoding;
  
  import junit.framework.TestCase;
  import org.apache.axis.Constants;
  import org.apache.axis.Message;
  import org.apache.axis.MessageContext;
  import org.apache.axis.encoding.TypeMapping;
  import org.apache.axis.encoding.TypeMappingImpl;
  import org.apache.axis.encoding.TypeMappingRegistry;
  import org.apache.axis.message.RPCElement;
  import org.apache.axis.message.RPCParam;
  import org.apache.axis.message.SOAPEnvelope;
  import org.apache.axis.server.AxisServer;
  
  import javax.xml.namespace.QName;
  
  /**
   * Test auto-typing.
   */
  public class TestAutoTypes extends TestCase {
  
      private AxisServer server = new AxisServer();
  
      public TestAutoTypes(String name) {
          super(name);
      }
      
      public void testAutoTypes() throws Exception
      {
          TypeMappingRegistry tmr = server.getTypeMappingRegistry();
          TypeMappingImpl tm = (TypeMappingImpl) tmr.getDefaultTypeMapping();
          tm.setDoAutoTypes(true);
          
          QName qname = tm.getTypeQName( AttributeBean.class );
          assertEquals( "http://encoding.test", 
                        qname.getNamespaceURI() );
          assertEquals( "AttributeBean", qname.getLocalPart() );
          
          assertTrue( tm.getDeserializer(qname) != null );
          assertTrue( tm.getSerializer(AttributeBean.class) != null );
      }
  }