cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bimargul...@apache.org
Subject svn commit: r809790 [3/3] - in /cxf/trunk/rt: databinding/aegis/src/main/java/org/apache/cxf/aegis/ databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/ databinding/aegis/src/main/java/org/apache/cxf/aegis/type/ databinding/aegis/src/main/...
Date Tue, 01 Sep 2009 01:13:10 GMT
Modified: cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/basic/QualificationTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/basic/QualificationTest.java?rev=809790&r1=809789&r2=809790&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/basic/QualificationTest.java
(original)
+++ cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/basic/QualificationTest.java
Tue Sep  1 01:13:06 2009
@@ -27,7 +27,7 @@
 import org.apache.cxf.aegis.Context;
 import org.apache.cxf.aegis.services.AttributeBean;
 import org.apache.cxf.aegis.services.XmlMappedAttributeBean;
-import org.apache.cxf.aegis.type.Type;
+import org.apache.cxf.aegis.type.AegisType;
 import org.apache.cxf.aegis.type.TypeCreationOptions;
 import org.apache.cxf.aegis.type.TypeMapping;
 import org.apache.cxf.common.util.SOAPConstants;
@@ -51,7 +51,7 @@
         context.initialize();
         TypeMapping mapping = context.getTypeMapping();
         
-        Type type = mapping.getTypeCreator().createType(AttributeBean.class);
+        AegisType type = mapping.getTypeCreator().createType(AttributeBean.class);
         type.setSchemaType(new QName("urn:Bean", "bean"));
 
         Context messageContext = new Context(context);
@@ -73,7 +73,7 @@
         context.initialize();
         TypeMapping mapping = context.getTypeMapping();
         
-        Type type = mapping.getTypeCreator().createType(AttributeBean.class);
+        AegisType type = mapping.getTypeCreator().createType(AttributeBean.class);
         type.setSchemaType(new QName("urn:Bean", "bean"));
 
         Context messageContext = new Context(context);
@@ -90,7 +90,7 @@
         context.initialize();
         TypeMapping mapping = context.getTypeMapping();
         
-        Type type = mapping.getTypeCreator().createType(XmlMappedAttributeBean.class);
+        AegisType type = mapping.getTypeCreator().createType(XmlMappedAttributeBean.class);
         type.setSchemaType(new QName("urn:Bean", "bean"));
 
         Context messageContext = new Context(context);
@@ -111,7 +111,7 @@
         context.initialize();
         TypeMapping mapping = context.getTypeMapping();
         
-        Type type = mapping.getTypeCreator().createType(XmlMappedAttributeBean.class);
+        AegisType type = mapping.getTypeCreator().createType(XmlMappedAttributeBean.class);
         type.setSchemaType(new QName("urn:Bean", "bean"));
 
         Context messageContext = new Context(context);

Modified: cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/encoded/AbstractEncodedTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/encoded/AbstractEncodedTest.java?rev=809790&r1=809789&r2=809790&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/encoded/AbstractEncodedTest.java
(original)
+++ cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/encoded/AbstractEncodedTest.java
Tue Sep  1 01:13:06 2009
@@ -22,6 +22,7 @@
 import java.io.UnsupportedEncodingException;
 import java.util.List;
 import java.util.Map;
+
 import javax.xml.stream.XMLStreamException;
 
 import org.w3c.dom.Element;
@@ -30,8 +31,8 @@
 import org.apache.cxf.aegis.AegisContext;
 import org.apache.cxf.aegis.Context;
 import org.apache.cxf.aegis.DatabindingException;
+import org.apache.cxf.aegis.type.AegisType;
 import org.apache.cxf.aegis.type.DefaultTypeMapping;
-import org.apache.cxf.aegis.type.Type;
 import org.apache.cxf.aegis.type.TypeMapping;
 import org.apache.cxf.aegis.xml.MessageReader;
 import org.apache.cxf.aegis.xml.MessageWriter;
@@ -78,7 +79,7 @@
     public <T> T readWriteReadRef(String file, Class<T> typeClass) throws XMLStreamException
{
         Context context = getContext();
         
-        Type type = mapping.getType(typeClass);
+        AegisType type = mapping.getType(typeClass);
         assertNotNull("no type found for " + typeClass.getName());
 
         // read file
@@ -114,9 +115,9 @@
     public Object readRef(ElementReader root) throws XMLStreamException {
         Context context = getContext();
 
-        // get Type based on the element qname
+        // get AegisType based on the element qname
         MessageReader reader = root.getNextElementReader();
-        Type type = this.mapping.getType(reader.getName());
+        AegisType type = this.mapping.getType(reader.getName());
         assertNotNull("type is null", type);
 
         // read ref
@@ -136,7 +137,7 @@
     }
 
     public Element writeRef(Object instance) {
-        Type type = mapping.getType(instance.getClass());
+        AegisType type = mapping.getType(instance.getClass());
         assertNotNull("no type found for " + instance.getClass().getName());
 
         // create the document
@@ -148,7 +149,7 @@
         ElementWriter rootWriter = getElementWriter(element, namespaces);
         Context context = getContext();
 
-        // get Type based on the object instance
+        // get AegisType based on the object instance
         assertNotNull("type is null", type);
 
         // write the ref
@@ -168,7 +169,7 @@
     }
 
     public void verifyInvalid(String resourceName, Class<?> expectedType) throws XMLStreamException
{
-        Type type = mapping.getType(expectedType);
+        AegisType type = mapping.getType(expectedType);
         assertNotNull("type is null", type);
 
         Context context = getContext();

Modified: cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/encoded/SoapArrayTypeTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/encoded/SoapArrayTypeTest.java?rev=809790&r1=809789&r2=809790&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/encoded/SoapArrayTypeTest.java
(original)
+++ cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/encoded/SoapArrayTypeTest.java
Tue Sep  1 01:13:06 2009
@@ -24,7 +24,7 @@
 import javax.xml.namespace.QName;
 
 import org.apache.cxf.aegis.Context;
-import org.apache.cxf.aegis.type.Type;
+import org.apache.cxf.aegis.type.AegisType;
 import org.apache.cxf.aegis.type.basic.BeanTypeInfo;
 import org.apache.cxf.aegis.xml.stax.ElementReader;
 import org.junit.Test;
@@ -326,7 +326,7 @@
     }
 
     private SoapArrayType createArrayType(Class<?> typeClass, QName schemaType) {
-        Type type = mapping.getType(typeClass);
+        AegisType type = mapping.getType(typeClass);
         if (type != null) {
             return (SoapArrayType) type;
         }

Modified: cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/AnnotatedTypeTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/AnnotatedTypeTest.java?rev=809790&r1=809789&r2=809790&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/AnnotatedTypeTest.java
(original)
+++ cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/AnnotatedTypeTest.java
Tue Sep  1 01:13:06 2009
@@ -26,7 +26,7 @@
 
 import org.apache.cxf.aegis.AbstractAegisTest;
 import org.apache.cxf.aegis.databinding.AegisDatabinding;
-import org.apache.cxf.aegis.type.Type;
+import org.apache.cxf.aegis.type.AegisType;
 import org.apache.cxf.aegis.type.TypeCreationOptions;
 import org.apache.cxf.aegis.type.TypeMapping;
 import org.apache.cxf.aegis.type.XMLTypeCreator;
@@ -69,7 +69,7 @@
         QName element = (QName)elements.next();
         assertTrue(elements.hasNext());
 
-        Type custom = info.getType(element);
+        AegisType custom = info.getType(element);
 
         if ("bogusProperty".equals(element.getLocalPart())) {
             assertTrue(custom instanceof StringType);

Modified: cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/CollectionTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/CollectionTest.java?rev=809790&r1=809789&r2=809790&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/CollectionTest.java
(original)
+++ cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/CollectionTest.java
Tue Sep  1 01:13:06 2009
@@ -39,8 +39,8 @@
 import org.apache.cxf.aegis.AbstractAegisTest;
 import org.apache.cxf.aegis.databinding.AegisDatabinding;
 import org.apache.cxf.aegis.databinding.XFireCompatibilityServiceConfiguration;
+import org.apache.cxf.aegis.type.AegisType;
 import org.apache.cxf.aegis.type.DefaultTypeMapping;
-import org.apache.cxf.aegis.type.Type;
 import org.apache.cxf.aegis.type.TypeCreationOptions;
 import org.apache.cxf.aegis.type.collection.CollectionType;
 import org.apache.cxf.aegis.type.collection.MapType;
@@ -49,6 +49,7 @@
 import org.apache.cxf.aegis.type.java5.dto.ObjectDTO;
 import org.apache.cxf.common.util.SOAPConstants;
 import org.apache.cxf.frontend.ClientProxyFactoryBean;
+
 import org.junit.Before;
 import org.junit.Test;
 
@@ -73,7 +74,7 @@
     public void testType() throws Exception {
         Method m = CollectionService.class.getMethod("getStrings", new Class[0]);
 
-        Type type = creator.createType(m, -1);
+        AegisType type = creator.createType(m, -1);
         tm.register(type);
         assertTrue(type instanceof CollectionType);
 
@@ -93,7 +94,7 @@
     public void testRecursiveCollections() throws Exception {
         Method m = CollectionService.class.getMethod("getStringCollections", new Class[0]);
 
-        Type type = creator.createType(m, -1);
+        AegisType type = creator.createType(m, -1);
         tm.register(type);
         assertTrue(type instanceof CollectionType);
 
@@ -120,7 +121,7 @@
     public void testPDType() throws Exception {
         PropertyDescriptor pd = Introspector.getBeanInfo(CollectionDTO.class, Object.class)
             .getPropertyDescriptors()[0];
-        Type type = creator.createType(pd);
+        AegisType type = creator.createType(pd);
         tm.register(type);
         assertTrue(type instanceof CollectionType);
 
@@ -138,10 +139,10 @@
         creator.setConfiguration(new TypeCreationOptions());
         tm.setTypeCreator(creator);
 
-        Type dto = creator.createType(CollectionDTO.class);
+        AegisType dto = creator.createType(CollectionDTO.class);
         Set deps = dto.getDependencies();
 
-        Type type = (Type)deps.iterator().next();
+        AegisType type = (AegisType)deps.iterator().next();
 
         assertTrue(type instanceof CollectionType);
 
@@ -150,7 +151,7 @@
         deps = dto.getDependencies();
         assertEquals(1, deps.size());
 
-        Type comType = colType.getComponentType();
+        AegisType comType = colType.getComponentType();
         assertEquals(String.class, comType.getTypeClass());
     }
 
@@ -161,12 +162,12 @@
         creator.setConfiguration(new TypeCreationOptions());
         tm.setTypeCreator(creator);
 
-        Type dto = creator.createType(ObjectDTO.class);
+        AegisType dto = creator.createType(ObjectDTO.class);
         Set deps = dto.getDependencies();
 
         assertFalse(deps.isEmpty());
 
-        Type type = (Type)deps.iterator().next();
+        AegisType type = (AegisType)deps.iterator().next();
 
         assertTrue(type instanceof CollectionType);
 
@@ -175,7 +176,7 @@
         deps = dto.getDependencies();
         assertEquals(1, deps.size());
 
-        Type comType = colType.getComponentType();
+        AegisType comType = colType.getComponentType();
         assertEquals(Object.class, comType.getTypeClass());
     }
 
@@ -262,11 +263,11 @@
     public void testNestedMapType() throws Exception {
         Method m = CollectionService.class.getMethod("mapOfMapWithStringAndPojo", 
                                                      new Class[] {Map.class});
-        Type type = creator.createType(m, 0);
+        AegisType type = creator.createType(m, 0);
         tm.register(type);
         assertTrue(type instanceof MapType);
         MapType mapType = (MapType) type;
-        Type valueType = mapType.getValueType();
+        AegisType valueType = mapType.getValueType();
         assertFalse(valueType.getSchemaType().getLocalPart().contains("any"));
     }
     

Modified: cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/ConfigurationTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/ConfigurationTest.java?rev=809790&r1=809789&r2=809790&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/ConfigurationTest.java
(original)
+++ cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/ConfigurationTest.java
Tue Sep  1 01:13:06 2009
@@ -22,12 +22,13 @@
 
 import org.apache.cxf.aegis.AbstractAegisTest;
 import org.apache.cxf.aegis.AegisContext;
+import org.apache.cxf.aegis.type.AegisType;
 import org.apache.cxf.aegis.type.DefaultTypeMapping;
-import org.apache.cxf.aegis.type.Type;
 import org.apache.cxf.aegis.type.TypeCreationOptions;
 import org.apache.cxf.aegis.type.XMLTypeCreator;
 import org.apache.cxf.aegis.type.basic.BeanType;
 import org.apache.cxf.aegis.type.basic.BeanTypeInfo;
+
 import org.junit.Before;
 import org.junit.Test;
 
@@ -59,7 +60,7 @@
     public void testNillableDefaultTrue() throws Exception {
         config.setDefaultNillable(true);
 
-        Type type = tm.getTypeCreator().createType(AnnotatedBean1.class);
+        AegisType type = tm.getTypeCreator().createType(AnnotatedBean1.class);
         BeanTypeInfo info = ((BeanType)type).getTypeInfo();
 
         assertTrue(info.isNillable(new QName(info.getDefaultNamespace(), "bogusProperty")));
@@ -68,7 +69,7 @@
     @Test
     public void testNillableDefaultFalse() throws Exception {
         config.setDefaultNillable(false);
-        Type type = tm.getTypeCreator().createType(AnnotatedBean1.class);
+        AegisType type = tm.getTypeCreator().createType(AnnotatedBean1.class);
         BeanTypeInfo info = ((BeanType)type).getTypeInfo();
 
         assertFalse(info.isNillable(new QName(info.getDefaultNamespace(), "bogusProperty")));
@@ -77,7 +78,7 @@
     @Test
     public void testMinOccursDefault0() throws Exception {
         config.setDefaultMinOccurs(0);
-        Type type = tm.getTypeCreator().createType(AnnotatedBean1.class);
+        AegisType type = tm.getTypeCreator().createType(AnnotatedBean1.class);
         BeanTypeInfo info = ((BeanType)type).getTypeInfo();
 
         assertEquals(info.getMinOccurs(new QName(info.getDefaultNamespace(), "bogusProperty")),
0);
@@ -86,7 +87,7 @@
     @Test
     public void testMinOccursDefault1() throws Exception {
         config.setDefaultMinOccurs(1);
-        Type type = tm.getTypeCreator().createType(AnnotatedBean1.class);
+        AegisType type = tm.getTypeCreator().createType(AnnotatedBean1.class);
         BeanTypeInfo info = ((BeanType)type).getTypeInfo();
 
         assertEquals(info.getMinOccurs(new QName(info.getDefaultNamespace(), "bogusProperty")),
1);
@@ -96,7 +97,7 @@
     public void testExtensibleDefaultTrue() throws Exception {
         config.setDefaultExtensibleElements(true);
         config.setDefaultExtensibleAttributes(true);
-        Type type = tm.getTypeCreator().createType(AnnotatedBean1.class);
+        AegisType type = tm.getTypeCreator().createType(AnnotatedBean1.class);
         BeanTypeInfo info = ((BeanType)type).getTypeInfo();
         assertTrue(info.isExtensibleElements());
         assertTrue(info.isExtensibleAttributes());
@@ -106,7 +107,7 @@
     public void testExtensibleDefaultFalse() throws Exception {
         config.setDefaultExtensibleElements(false);
         config.setDefaultExtensibleAttributes(false);
-        Type type = tm.getTypeCreator().createType(AnnotatedBean1.class);
+        AegisType type = tm.getTypeCreator().createType(AnnotatedBean1.class);
         BeanTypeInfo info = ((BeanType)type).getTypeInfo();
         assertFalse(info.isExtensibleElements());
         assertFalse(info.isExtensibleAttributes());

Modified: cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/EnumTypeTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/EnumTypeTest.java?rev=809790&r1=809789&r2=809790&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/EnumTypeTest.java
(original)
+++ cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/EnumTypeTest.java
Tue Sep  1 01:13:06 2009
@@ -25,8 +25,8 @@
 import org.w3c.dom.Element;
 
 import org.apache.cxf.aegis.AbstractAegisTest;
+import org.apache.cxf.aegis.type.AegisType;
 import org.apache.cxf.aegis.type.DefaultTypeMapping;
-import org.apache.cxf.aegis.type.Type;
 import org.apache.cxf.aegis.type.TypeCreationOptions;
 import org.apache.cxf.aegis.type.java5.CurrencyService.Currency;
 import org.apache.cxf.aegis.xml.stax.ElementReader;
@@ -82,14 +82,14 @@
 
     @Test
     public void testAutoCreation() throws Exception {
-        Type type = tm.getTypeCreator().createType(smallEnum.class);
+        AegisType type = tm.getTypeCreator().createType(smallEnum.class);
 
         assertTrue(type instanceof EnumType);
     }
 
     @Test
     public void testTypeAttributeOnEnum() throws Exception {
-        Type type = tm.getTypeCreator().createType(TestEnum.class);
+        AegisType type = tm.getTypeCreator().createType(TestEnum.class);
 
         assertEquals("urn:xfire:foo", type.getSchemaType().getNamespaceURI());
 
@@ -98,7 +98,7 @@
 
     @Test
     public void testXFireTypeAttributeOnEnum() throws Exception {
-        Type type = tm.getTypeCreator().createType(XFireTestEnum.class);
+        AegisType type = tm.getTypeCreator().createType(XFireTestEnum.class);
 
         assertEquals("urn:xfire:foo", type.getSchemaType().getNamespaceURI());
 
@@ -107,7 +107,7 @@
 
     @Test
     public void testJaxbTypeAttributeOnEnum() throws Exception {
-        Type type = tm.getTypeCreator().createType(JaxbTestEnum.class);
+        AegisType type = tm.getTypeCreator().createType(JaxbTestEnum.class);
 
         assertEquals("urn:xfire:foo", type.getSchemaType().getNamespaceURI());
 
@@ -145,7 +145,7 @@
 
     @Test
     public void testNillable() throws Exception {
-        Type type = tm.getTypeCreator().createType(EnumBean.class);
+        AegisType type = tm.getTypeCreator().createType(EnumBean.class);
 
         tm.register(type);
 

Modified: cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/JaxbTypeTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/JaxbTypeTest.java?rev=809790&r1=809789&r2=809790&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/JaxbTypeTest.java
(original)
+++ cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/JaxbTypeTest.java
Tue Sep  1 01:13:06 2009
@@ -26,7 +26,7 @@
 
 import org.apache.cxf.aegis.AbstractAegisTest;
 import org.apache.cxf.aegis.databinding.AegisDatabinding;
-import org.apache.cxf.aegis.type.Type;
+import org.apache.cxf.aegis.type.AegisType;
 import org.apache.cxf.aegis.type.TypeCreationOptions;
 import org.apache.cxf.aegis.type.TypeMapping;
 import org.apache.cxf.aegis.type.XMLTypeCreator;
@@ -69,7 +69,7 @@
         QName element = (QName)elements.next();
         assertTrue(elements.hasNext());
 
-        Type custom = info.getType(element);
+        AegisType custom = info.getType(element);
 
         if ("bogusProperty".equals(element.getLocalPart())) {
             assertTrue(custom instanceof StringType);

Modified: cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/JaxbXmlParamTypeTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/JaxbXmlParamTypeTest.java?rev=809790&r1=809789&r2=809790&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/JaxbXmlParamTypeTest.java
(original)
+++ cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/JaxbXmlParamTypeTest.java
Tue Sep  1 01:13:06 2009
@@ -19,15 +19,17 @@
 package org.apache.cxf.aegis.type.java5;
 
 import java.lang.reflect.Method;
+
 import javax.jws.WebParam;
 import javax.jws.WebResult;
 import javax.xml.namespace.QName;
 
 import org.apache.cxf.aegis.AbstractAegisTest;
+import org.apache.cxf.aegis.type.AegisType;
 import org.apache.cxf.aegis.type.DefaultTypeCreator;
 import org.apache.cxf.aegis.type.DefaultTypeMapping;
-import org.apache.cxf.aegis.type.Type;
 import org.apache.cxf.aegis.type.TypeCreationOptions;
+
 import org.junit.Before;
 import org.junit.Test;
 
@@ -50,7 +52,7 @@
     public void testType() throws Exception {
         Method m = CustomTypeService.class.getMethod("doFoo", new Class[] {String.class});
 
-        Type type = creator.createType(m, 0);
+        AegisType type = creator.createType(m, 0);
         tm.register(type);
         assertTrue(type instanceof org.apache.cxf.aegis.type.basic.BeanType);
         assertEquals(new QName("urn:xfire:foo", "custom"), type.getSchemaType());

Modified: cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/MapTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/MapTest.java?rev=809790&r1=809789&r2=809790&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/MapTest.java
(original)
+++ cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/MapTest.java
Tue Sep  1 01:13:06 2009
@@ -28,13 +28,14 @@
 import javax.xml.namespace.QName;
 
 import org.apache.cxf.aegis.AbstractAegisTest;
+import org.apache.cxf.aegis.type.AegisType;
 import org.apache.cxf.aegis.type.DefaultTypeMapping;
-import org.apache.cxf.aegis.type.Type;
 import org.apache.cxf.aegis.type.TypeCreationOptions;
 import org.apache.cxf.aegis.type.collection.CollectionType;
 import org.apache.cxf.aegis.type.collection.MapType;
 import org.apache.cxf.aegis.type.java5.dto.MapDTO;
 import org.apache.cxf.aegis.type.java5.dto.MapDTOService;
+
 import org.junit.Before;
 import org.junit.Test;
 
@@ -57,7 +58,7 @@
     public void testType() throws Exception {
         Method m = MapService.class.getMethod("getMap", new Class[0]);
 
-        Type type = creator.createType(m, -1);
+        AegisType type = creator.createType(m, -1);
         tm.register(type);
         assertTrue(type instanceof MapType);
 
@@ -78,7 +79,7 @@
     public void testRecursiveType() throws Exception {
         Method m = MapService.class.getMethod("getMapOfCollections", new Class[0]);
 
-        Type type = creator.createType(m, -1);
+        AegisType type = creator.createType(m, -1);
         tm.register(type);
         assertTrue(type instanceof MapType);
 
@@ -102,7 +103,7 @@
     public void testPDType() throws Exception {
         PropertyDescriptor pd = Introspector.getBeanInfo(MapDTO.class,
                                                          Object.class).getPropertyDescriptors()[0];
-        Type type = creator.createType(pd);
+        AegisType type = creator.createType(pd);
         tm.register(type);
         assertTrue(type instanceof MapType);
 
@@ -127,10 +128,10 @@
         creator.setConfiguration(new TypeCreationOptions());
         tm.setTypeCreator(creator);
 
-        Type dto = creator.createType(MapDTO.class);
+        AegisType dto = creator.createType(MapDTO.class);
         Set deps = dto.getDependencies();
 
-        Type type = (Type)deps.iterator().next();
+        AegisType type = (AegisType)deps.iterator().next();
         assertTrue(type instanceof MapType);
 
         MapType mapType = (MapType)type;

Modified: cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/XFireTypeTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/XFireTypeTest.java?rev=809790&r1=809789&r2=809790&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/XFireTypeTest.java
(original)
+++ cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/XFireTypeTest.java
Tue Sep  1 01:13:06 2009
@@ -26,7 +26,7 @@
 
 import org.apache.cxf.aegis.AbstractAegisTest;
 import org.apache.cxf.aegis.databinding.AegisDatabinding;
-import org.apache.cxf.aegis.type.Type;
+import org.apache.cxf.aegis.type.AegisType;
 import org.apache.cxf.aegis.type.TypeCreationOptions;
 import org.apache.cxf.aegis.type.TypeMapping;
 import org.apache.cxf.aegis.type.XMLTypeCreator;
@@ -69,7 +69,7 @@
         QName element = (QName)elements.next();
         assertTrue(elements.hasNext());
 
-        Type custom = info.getType(element);
+        AegisType custom = info.getType(element);
 
         if ("bogusProperty".equals(element.getLocalPart())) {
             assertTrue(custom instanceof StringType);

Modified: cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/XFireXmlParamTypeTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/XFireXmlParamTypeTest.java?rev=809790&r1=809789&r2=809790&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/XFireXmlParamTypeTest.java
(original)
+++ cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/XFireXmlParamTypeTest.java
Tue Sep  1 01:13:06 2009
@@ -19,13 +19,16 @@
 package org.apache.cxf.aegis.type.java5;
 
 import java.lang.reflect.Method;
+
 import javax.xml.namespace.QName;
+
 import org.w3c.dom.Document;
 
 import org.apache.cxf.aegis.AbstractAegisTest;
+import org.apache.cxf.aegis.type.AegisType;
 import org.apache.cxf.aegis.type.DefaultTypeCreator;
 import org.apache.cxf.aegis.type.DefaultTypeMapping;
-import org.apache.cxf.aegis.type.Type;
+
 import org.junit.Before;
 import org.junit.Test;
 
@@ -49,7 +52,7 @@
     public void testType() throws Exception {
         Method m = CustomTypeService.class.getMethod("doFoo", new Class[] {String.class});
 
-        Type type = creator.createType(m, 0);
+        AegisType type = creator.createType(m, 0);
         tm.register(type);
         assertTrue(type instanceof CustomStringType);
         assertEquals(new QName("urn:xfire:foo", "custom"), type.getSchemaType());

Modified: cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/XmlParamTypeTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/XmlParamTypeTest.java?rev=809790&r1=809789&r2=809790&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/XmlParamTypeTest.java
(original)
+++ cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/XmlParamTypeTest.java
Tue Sep  1 01:13:06 2009
@@ -25,10 +25,11 @@
 import org.w3c.dom.Document;
 
 import org.apache.cxf.aegis.AbstractAegisTest;
+import org.apache.cxf.aegis.type.AegisType;
 import org.apache.cxf.aegis.type.DefaultTypeCreator;
 import org.apache.cxf.aegis.type.DefaultTypeMapping;
-import org.apache.cxf.aegis.type.Type;
 import org.apache.cxf.aegis.type.TypeCreationOptions;
+
 import org.junit.Before;
 import org.junit.Test;
 
@@ -51,7 +52,7 @@
     public void testType() throws Exception {
         Method m = CustomTypeService.class.getMethod("doFoo", new Class[] {String.class});
 
-        Type type = creator.createType(m, 0);
+        AegisType type = creator.createType(m, 0);
         tm.register(type);
         assertTrue(type instanceof CustomStringType);
         assertEquals(new QName("urn:xfire:foo", "custom"), type.getSchemaType());

Modified: cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/xmlconfig/TestDateMapping.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/xmlconfig/TestDateMapping.java?rev=809790&r1=809789&r2=809790&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/xmlconfig/TestDateMapping.java
(original)
+++ cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/xmlconfig/TestDateMapping.java
Tue Sep  1 01:13:06 2009
@@ -28,7 +28,7 @@
 
 import org.apache.cxf.aegis.AegisContext;
 import org.apache.cxf.aegis.AegisWriter;
-import org.apache.cxf.aegis.type.Type;
+import org.apache.cxf.aegis.type.AegisType;
 import org.apache.cxf.test.TestUtilities;
 import org.apache.ws.commons.schema.XmlSchema;
 
@@ -50,14 +50,14 @@
     @Test
     public void testWriteSqlDateAsDate() throws Exception {
         context = new AegisContext();
-        Set<Class<?>> rootClasses = new HashSet<Class<?>>();
+        Set<java.lang.reflect.Type> rootClasses = new HashSet<java.lang.reflect.Type>();
         rootClasses.add(BeanWithDate.class);
         context.setRootClasses(rootClasses);
         context.initialize();
         BeanWithDate bean = new BeanWithDate();
         java.sql.Date date = new java.sql.Date(0);
         bean.setFig(date);
-        Type sbType = context.getTypeMapping().getType(bean.getClass());
+        AegisType sbType = context.getTypeMapping().getType(bean.getClass());
         AegisWriter<XMLStreamWriter> writer = context.createXMLStreamWriter();
         StringWriter stringWriter = new StringWriter();
         XMLStreamWriter xmlWriter = xmlOutputFactory.createXMLStreamWriter(stringWriter);
@@ -70,14 +70,14 @@
     @Test
     public void testWriteCustomTypeSchemaType() throws Exception {
         context = new AegisContext();
-        Set<Class<?>> rootClasses = new HashSet<Class<?>>();
+        Set<java.lang.reflect.Type> rootClasses = new HashSet<java.lang.reflect.Type>();
         rootClasses.add(BeanWithDate.class);
         context.setRootClasses(rootClasses);
         context.initialize();
         BeanWithDate bean = new BeanWithDate();
         java.sql.Date date = new java.sql.Date(0);
         bean.setFig(date);
-        Type sbType = context.getTypeMapping().getType(bean.getClass());
+        AegisType sbType = context.getTypeMapping().getType(bean.getClass());
         XmlSchema root = new XmlSchema(); // dummy to put schema in.
      /* will explode if the type object created for the custom mapping isn't fully initialized.
       */

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/AbstractAegisProvider.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/AbstractAegisProvider.java?rev=809790&r1=809789&r2=809790&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/AbstractAegisProvider.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/AbstractAegisProvider.java
Tue Sep  1 01:13:06 2009
@@ -20,9 +20,6 @@
 package org.apache.cxf.jaxrs.provider;
 
 import java.lang.annotation.Annotation;
-import java.lang.reflect.Array;
-import java.lang.reflect.GenericArrayType;
-import java.lang.reflect.ParameterizedType;
 import java.lang.reflect.Type;
 import java.util.HashSet;
 import java.util.Map;
@@ -40,7 +37,8 @@
 public abstract class AbstractAegisProvider 
     implements MessageBodyReader<Object>, MessageBodyWriter<Object> {
     
-    private static Map<Class<?>, AegisContext> classContexts = new WeakHashMap<Class<?>,
AegisContext>();
+    private static Map<java.lang.reflect.Type, AegisContext> classContexts      
+        = new WeakHashMap<java.lang.reflect.Type, AegisContext>();
     
     protected boolean writeXsiType = true;
     protected boolean readXsiType = true;
@@ -67,68 +65,38 @@
         return -1;
     }
 
-    protected AegisContext getAegisContext(Class<?> type, Type genericType) {
+    protected AegisContext getAegisContext(Class<?> plainClass, Type genericType) {
         
         if (resolver != null) {
-            AegisContext context = resolver.getContext(type);
+            /* wierdly, the JAX-RS API keys on Class, not AegisType, so it can't possibly
+             * keep generics straight. Should we ignore the resolver?
+             */
+            AegisContext context = resolver.getContext(plainClass);
             // it's up to the resolver to keep its contexts in a map
             if (context != null) {
                 return context;
             }
         }
         
-        return getClassContext(type, genericType);
+        if (genericType == null) {
+            genericType = plainClass;
+        }
+        return getClassContext(genericType);
     }
     
     
-    private void addType(Set<Class<?>> rootClasses, Type cls, boolean allowArray)
{
-        if (cls instanceof Class) {
-            if (((Class)cls).isArray() && !allowArray) {
-                rootClasses.add(((Class)cls).getComponentType());
-            } else {
-                rootClasses.add((Class)cls);
-            }
-        } else if (cls instanceof ParameterizedType) {
-            for (Type t2 : ((ParameterizedType)cls).getActualTypeArguments()) {
-                addType(rootClasses, t2, false);
-            }
-        } else if (cls instanceof GenericArrayType) {
-            GenericArrayType gt = (GenericArrayType)cls;
-            Class ct = (Class) gt.getGenericComponentType();
-            ct = Array.newInstance(ct, 0).getClass();
-
-            rootClasses.add(ct);
-        }
-    }
-    private AegisContext getClassContext(Class<?> type, Type reflectionType) {
+    private AegisContext getClassContext(Type reflectionType) {
         synchronized (classContexts) {
-            AegisContext context = classContexts.get(type);
+            AegisContext context = classContexts.get(reflectionType);
             if (context == null) {
                 context = new AegisContext();
                 context.setWriteXsiTypes(writeXsiType); 
                 context.setReadXsiTypes(readXsiType);
-                Set<Class<?>> rootClasses = new HashSet<Class<?>>();
-                /* we do not want raw collection types in here.
-                 * so we only add the 'type' to the root classes if the 
-                 * un-erased (reflection) type is non-generic.
-                 * Now, perhaps we should tolerate non-collection
-                 * generic types.  
-                 */
-                if (reflectionType == null || reflectionType instanceof Class) {
-                    rootClasses.add(type);
-                } else {
-                    addType(rootClasses, reflectionType, true);
-                }
+                Set<java.lang.reflect.Type> rootClasses = new HashSet<java.lang.reflect.Type>();
+                rootClasses.add(reflectionType);
                 context.setRootClasses(rootClasses);
                 context.initialize();
-                /* It's not enough, in the presence of generic types, to just add it as a
root.
-                    a mapping is also needed */
-                if (reflectionType != null) {
-                    org.apache.cxf.aegis.type.Type aegisType;
-                    aegisType = context.getTypeMapping().getTypeCreator().createType(reflectionType);
-                    context.getTypeMapping().register(aegisType);
-                }
-                classContexts.put(type, context);
+                classContexts.put(reflectionType, context);
             }
             return context;
         }

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/AegisElementProvider.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/AegisElementProvider.java?rev=809790&r1=809789&r2=809790&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/AegisElementProvider.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/AegisElementProvider.java
Tue Sep  1 01:13:06 2009
@@ -73,8 +73,10 @@
         }
         AegisContext context = getAegisContext(type, genericType);
         // we need special cases for collection types.
+        // until we clean up mapping management.
         
-        org.apache.cxf.aegis.type.Type aegisType = TypeUtil.getWriteTypeStandalone(context,
obj, genericType);
+        org.apache.cxf.aegis.type.AegisType aegisType 
+            = TypeUtil.getWriteTypeStandalone(context, obj, genericType);
         AegisWriter<XMLStreamWriter> aegisWriter = context.createXMLStreamWriter();
         try {
             XMLStreamWriter xmlStreamWriter = createStreamWriter(aegisType.getSchemaType(),
os);



Mime
View raw message