cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bimargul...@apache.org
Subject svn commit: r687910 - in /cxf/trunk/rt: databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/ databinding/aegis/src/main/java/org/apache/cxf/aegis/type/ databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/ frontend/simple/src/ma...
Date Fri, 22 Aug 2008 00:08:06 GMT
Author: bimargulies
Date: Thu Aug 21 17:08:06 2008
New Revision: 687910

URL: http://svn.apache.org/viewvc?rev=687910&view=rev
Log:
Add some test code to try to make Generics lose in Javascript.

Make Aegis push minOccurs and maxOccurs out to the MPI.


Added:
    cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/fortest/GenericGenericClass.java
  (with props)
    cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/fortest/GenericInterface.java
  (with props)
    cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/fortest/SpecificGenericClass.java
  (with props)
Modified:
    cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/AegisDatabinding.java
    cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/Type.java
    cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/ArrayType.java
    cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/BeanType.java
    cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/BeanTypeInfo.java
    cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/DefaultServiceConfiguration.java
    cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/fortest/SimpleDocLitWrapped.java
    cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/fortest/SimpleDocLitWrappedImpl.java

Modified: cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/AegisDatabinding.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/AegisDatabinding.java?rev=687910&r1=687909&r2=687910&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/AegisDatabinding.java
(original)
+++ cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/AegisDatabinding.java
Thu Aug 21 17:08:06 2008
@@ -383,6 +383,14 @@
                     part.setElementQName(type.getSchemaType());
                 }
             }
+            
+            part.setProperty("nillable", Boolean.valueOf(type.isNillable()));
+            if (type.hasMinOccurs()) {
+                part.setProperty("minOccurs", Long.valueOf(type.getMinOccurs()).toString());
+            }
+            if (type.hasMaxOccurs()) {
+                part.setProperty("maxOccurs", Long.valueOf(type.getMaxOccurs()).toString());
+            }
 
             part2Type.put(part, type);
 

Modified: cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/Type.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/Type.java?rev=687910&r1=687909&r2=687910&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/Type.java (original)
+++ cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/Type.java Thu Aug
21 17:08:06 2008
@@ -212,6 +212,22 @@
     public boolean usesXmime() {
         return false;
     }
+    
+    public boolean hasMinOccurs() {
+        return false;
+    }
+    
+    public boolean hasMaxOccurs() {
+        return false;
+    }
+    
+    public long getMinOccurs() {
+        return 0; // not valid in general
+    }
+    
+    public long getMaxOccurs() {
+        return 0;
+    }
 
     @Override
     public String toString() {

Modified: cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/ArrayType.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/ArrayType.java?rev=687910&r1=687909&r2=687910&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/ArrayType.java
(original)
+++ cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/ArrayType.java
Thu Aug 21 17:08:06 2008
@@ -416,4 +416,14 @@
         setWriteOuter(!flat);
         this.flat = flat;
     }
+    
+    @Override
+    public boolean hasMaxOccurs() {
+        return true;
+    }
+
+    @Override
+    public boolean hasMinOccurs() {
+        return true;
+    }
 }

Modified: cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/BeanType.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/BeanType.java?rev=687910&r1=687909&r2=687910&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/BeanType.java
(original)
+++ cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/BeanType.java
Thu Aug 21 17:08:06 2008
@@ -753,4 +753,14 @@
         element.setAttribute("namespace", AbstractXOPType.XML_MIME_NS);
         root.addNamespaceDeclaration(Namespace.getNamespace("xmime", AbstractXOPType.XML_MIME_NS));
     }
+
+    @Override
+    public long getMinOccurs() {
+        return info.getMinOccurs();
+    }
+
+    @Override
+    public boolean hasMinOccurs() {
+        return true;
+    }
 }

Modified: cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/BeanTypeInfo.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/BeanTypeInfo.java?rev=687910&r1=687909&r2=687910&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/BeanTypeInfo.java
(original)
+++ cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/BeanTypeInfo.java
Thu Aug 21 17:08:06 2008
@@ -382,6 +382,10 @@
     public int getMinOccurs(QName name) {
         return minOccurs;
     }
+    
+    public long getMinOccurs() {
+        return minOccurs;
+    }
 
     public void setDefaultMinOccurs(int m) {
         this.minOccurs = m;

Modified: cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/DefaultServiceConfiguration.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/DefaultServiceConfiguration.java?rev=687910&r1=687909&r2=687910&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/DefaultServiceConfiguration.java
(original)
+++ cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/DefaultServiceConfiguration.java
Thu Aug 21 17:08:06 2008
@@ -304,7 +304,13 @@
     }
     public Long getWrapperPartMinOccurs(MessagePartInfo mpi) {
         String min = (String)mpi.getProperty("minOccurs");
+        
         long mini = 1;
+        
+        if (min != null) {
+            mini = Long.parseLong(min);
+        }
+        
         if (min == null && mpi.getTypeClass() != null && !mpi.getTypeClass().isPrimitive())
{
             mini = 0;
         }

Added: cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/fortest/GenericGenericClass.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/fortest/GenericGenericClass.java?rev=687910&view=auto
==============================================================================
--- cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/fortest/GenericGenericClass.java
(added)
+++ cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/fortest/GenericGenericClass.java
Thu Aug 21 17:08:06 2008
@@ -0,0 +1,43 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.javascript.fortest;
+
+import javax.xml.bind.annotation.XmlType;
+
+/**
+ * 
+ */
+@XmlType(namespace = "uri:org.apache.cxf.javascript.testns")
+public class GenericGenericClass<T> implements GenericInterface<T> {
+    private T value;
+    
+    public void doSomethingGeneric(T t) {
+        value = t;
+    }
+
+    public T getValue() {
+        return value;
+    }
+
+    public void setValue(T value) {
+        this.value = value;
+    }
+
+}

Propchange: cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/fortest/GenericGenericClass.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/fortest/GenericGenericClass.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/fortest/GenericInterface.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/fortest/GenericInterface.java?rev=687910&view=auto
==============================================================================
--- cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/fortest/GenericInterface.java
(added)
+++ cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/fortest/GenericInterface.java
Thu Aug 21 17:08:06 2008
@@ -0,0 +1,27 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.javascript.fortest;
+
+/**
+ * Test interface of generic interface.
+ */
+public interface GenericInterface<T> {
+    void doSomethingGeneric(T t);
+}

Propchange: cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/fortest/GenericInterface.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/fortest/GenericInterface.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/fortest/SimpleDocLitWrapped.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/fortest/SimpleDocLitWrapped.java?rev=687910&r1=687909&r2=687910&view=diff
==============================================================================
--- cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/fortest/SimpleDocLitWrapped.java
(original)
+++ cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/fortest/SimpleDocLitWrapped.java
Thu Aug 21 17:08:06 2008
@@ -66,4 +66,8 @@
     @WebMethod
     void beanFunction(@WebParam(name = "bean1") TestBean1 bean, 
                       @WebParam(name = "beanArray") TestBean1[] beans);
+    
+    @WebMethod
+    void genericTestFunction(@WebParam(name = "g1") SpecificGenericClass sgc,
+                             @WebParam(name = "g2") GenericGenericClass<Double> ggc);
 }

Modified: cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/fortest/SimpleDocLitWrappedImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/fortest/SimpleDocLitWrappedImpl.java?rev=687910&r1=687909&r2=687910&view=diff
==============================================================================
--- cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/fortest/SimpleDocLitWrappedImpl.java
(original)
+++ cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/fortest/SimpleDocLitWrappedImpl.java
Thu Aug 21 17:08:06 2008
@@ -21,14 +21,11 @@
 
 import javax.jws.WebService;
 
-//import org.apache.cxf.feature.Features;
-
 /**
  * 
  */
 @WebService(endpointInterface = "org.apache.cxf.javascript.fortest.SimpleDocLitWrapped",
             targetNamespace = "uri:org.apache.cxf.javascript.fortest")
-//@org.apache.cxf.feature.Features(features = "org.apache.cxf.feature.LoggingFeature") 
 public class SimpleDocLitWrappedImpl implements SimpleDocLitWrapped {
     
     private String lastString;
@@ -38,6 +35,8 @@
     private double lastDouble;
     private TestBean1 lastBean1;
     private TestBean1[] lastBean1Array;
+    private SpecificGenericClass lastSpecificGeneric;
+    private GenericGenericClass<Double> lastGenericGeneric;
 
     /** {@inheritDoc}*/
     public int basicTypeFunctionReturnInt(String s, int i, long l, float f, double d) {
@@ -115,4 +114,17 @@
     public TestBean1[] getLastBean1Array() {
         return lastBean1Array;
     }
+
+    public void genericTestFunction(SpecificGenericClass sgc, GenericGenericClass<Double>
ggc) {
+        lastSpecificGeneric = sgc;
+        lastGenericGeneric = ggc;
+    }
+
+    public SpecificGenericClass getLastSpecificGeneric() {
+        return lastSpecificGeneric;
+    }
+
+    public GenericGenericClass<Double> getLastGenericGeneric() {
+        return lastGenericGeneric;
+    }
 }

Added: cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/fortest/SpecificGenericClass.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/fortest/SpecificGenericClass.java?rev=687910&view=auto
==============================================================================
--- cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/fortest/SpecificGenericClass.java
(added)
+++ cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/fortest/SpecificGenericClass.java
Thu Aug 21 17:08:06 2008
@@ -0,0 +1,41 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.javascript.fortest;
+
+import javax.xml.bind.annotation.XmlType;
+
+@XmlType(namespace = "uri:org.apache.cxf.javascript.testns")
+public class SpecificGenericClass implements GenericInterface<String> {
+    
+    private String value;
+
+    public void doSomethingGeneric(String t) {
+        
+    }
+
+    public String getValue() {
+        return value;
+    }
+
+    public void setValue(String value) {
+        this.value = value;
+    }
+
+}

Propchange: cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/fortest/SpecificGenericClass.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/fortest/SpecificGenericClass.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date



Mime
View raw message