incubator-yoko-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r546976 - in /incubator/yoko/trunk/bindings/src: main/java/org/apache/yoko/bindings/corba/types/ test/java/org/apache/yoko/bindings/corba/
Date Wed, 13 Jun 2007 17:45:21 GMT
Author: bravi
Date: Wed Jun 13 10:45:20 2007
New Revision: 546976

URL: http://svn.apache.org/viewvc?view=rev&rev=546976
Log:
[YOKO-373] - Enabled the StructWithNillables Test case.

Modified:
    incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/types/CorbaUnionEventProducer.java
    incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/types/CorbaUnionListener.java
    incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/types/SkipStartEndEventProducer.java
    incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/AbstractTypeTestClient1.java
    incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/CorbaTypeTest.java

Modified: incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/types/CorbaUnionEventProducer.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/types/CorbaUnionEventProducer.java?view=diff&rev=546976&r1=546975&r2=546976
==============================================================================
--- incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/types/CorbaUnionEventProducer.java
(original)
+++ incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/types/CorbaUnionEventProducer.java
Wed Jun 13 10:45:20 2007
@@ -26,8 +26,7 @@
         CorbaUnionHandler handler = (CorbaUnionHandler) h;
         serviceInfo = sInfo;
         orb = o;
-        name = handler.getName();
-        
+        name = handler.getName();        
         isNil = checkIsNil(handler);
         if (!isNil) {
             CorbaObjectHandler contents = handler.getValue();

Modified: incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/types/CorbaUnionListener.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/types/CorbaUnionListener.java?view=diff&rev=546976&r1=546975&r2=546976
==============================================================================
--- incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/types/CorbaUnionListener.java
(original)
+++ incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/types/CorbaUnionListener.java
Wed Jun 13 10:45:20 2007
@@ -81,7 +81,6 @@
                     content = currentTypeListener.getCorbaObject();
                     ((CorbaUnionHandler)handler).setValue(branchName, content);
                     if (unionType.isSetNillable() && unionType.isNillable()) {
-                        System.out.println("is not nil but nillable element " + name);
                         currentTypeListener.processStartElement(name);
                     }
                 } else {
@@ -155,6 +154,15 @@
                                           null);
             discObj.setValue(Boolean.FALSE);
             ((CorbaUnionHandler)handler).setDiscriminator(discObj);
+            Unionbranch branch = branches.get(0);
+            QName emptyBranchContentQName = 
+                new QName(handler.getName().getNamespaceURI(), branch.getName());
+            CorbaObjectHandler content = CorbaHandlerUtils.initializeObjectHandler(orb,
+                                                                                   emptyBranchContentQName,
+                                                                                   branch.getIdltype(),
+                                                                                   typeMap,
+                                                                                   serviceInfo);
+            ((CorbaUnionHandler)handler).addCase(content);
         } else {
             super.processWriteAttribute(prefix, namespaceURI, localName, val);
         }

Modified: incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/types/SkipStartEndEventProducer.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/types/SkipStartEndEventProducer.java?view=diff&rev=546976&r1=546975&r2=546976
==============================================================================
--- incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/types/SkipStartEndEventProducer.java
(original)
+++ incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/types/SkipStartEndEventProducer.java
Wed Jun 13 10:45:20 2007
@@ -3,15 +3,14 @@
 import java.util.List;
 
 import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamReader;
+//import javax.xml.stream.XMLStreamReader;
 import javax.xml.stream.events.Attribute;
 import javax.xml.stream.events.Namespace;
 
 public class SkipStartEndEventProducer implements CorbaTypeEventProducer {
 
     private final CorbaTypeEventProducer eventProducer;
-    private final QName name;
-    
+    private QName name;   
     private int peekedEvent;
     private boolean hasNext = true;
 
@@ -44,12 +43,15 @@
     }
 
     public int next() {
-        int ret = peekedEvent; 
+        int ret = peekedEvent;
+        name = eventProducer.getName();
         peekedEvent = eventProducer.next();
+        /*
         if (peekedEvent == XMLStreamReader.END_ELEMENT) {
             hasNext = false;
             peekedEvent = 0;
         }
+        */
         return ret;
     }
 

Modified: incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/AbstractTypeTestClient1.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/AbstractTypeTestClient1.java?view=diff&rev=546976&r1=546975&r2=546976
==============================================================================
--- incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/AbstractTypeTestClient1.java
(original)
+++ incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/AbstractTypeTestClient1.java
Wed Jun 13 10:45:20 2007
@@ -128,7 +128,7 @@
         return equalsNilable(x.getVarFloat(), y.getVarFloat())
             && equalsNilable(x.getVarInt(), x.getVarInt())
             && equalsNilable(x.getVarString(), y.getVarString())
-            && equalsNilable(x.getVarStruct(), y.getVarStruct());
+            && equalsNilableStruct(x.getVarStruct(), y.getVarStruct());
     }
     
     public void testStructWithNillables() throws Exception {
@@ -147,7 +147,6 @@
         Holder<StructWithNillables> y = new Holder<StructWithNillables>(yOrig);
         Holder<StructWithNillables> z = new Holder<StructWithNillables>();
         StructWithNillables ret = client.testStructWithNillables(x, y, z);
-
         if (!perfTestOnly) {
             assertTrue("testStructWithNillables(): Incorrect value for inout param",
                        equals(x, y.value));

Modified: incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/CorbaTypeTest.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/CorbaTypeTest.java?view=diff&rev=546976&r1=546975&r2=546976
==============================================================================
--- incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/CorbaTypeTest.java
(original)
+++ incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/CorbaTypeTest.java
Wed Jun 13 10:45:20 2007
@@ -61,11 +61,6 @@
                 
     public void testSimpleAll() throws Exception {
     }
-
-    public void testStructWithNillables() throws Exception {
-        //super.testStructWithNillables();
-    }
-
         
     static abstract class CorbaTypeTestSetup extends TestSetup {
 



Mime
View raw message