incubator-yoko-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r535196 - in /incubator/yoko/trunk/bindings/src: main/java/org/apache/yoko/bindings/corba/runtime/CorbaStaxObject.java test/java/org/apache/yoko/bindings/corba/AbstractTypeTestClient1.java
Date Fri, 04 May 2007 12:09:52 GMT
Author: bravi
Date: Fri May  4 05:09:51 2007
New Revision: 535196

URL: http://svn.apache.org/viewvc?view=rev&rev=535196
Log:
[YOKO-365] - Fixing the issue with sending empty string within an array.

Modified:
    incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/runtime/CorbaStaxObject.java
    incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/AbstractTypeTestClient1.java

Modified: incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/runtime/CorbaStaxObject.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/runtime/CorbaStaxObject.java?view=diff&rev=535196&r1=535195&r2=535196
==============================================================================
--- incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/runtime/CorbaStaxObject.java
(original)
+++ incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/runtime/CorbaStaxObject.java
Fri May  4 05:09:51 2007
@@ -357,11 +357,11 @@
             String value;
             if (evt.isCharacters()) {
                 value = evt.asCharacters().getData();
-            } else {
-                value = "";
-            }
-            if (reader.peek().isEndElement()) {
                 reader.nextEvent().asEndElement();
+            } else if (evt.isEndElement()) {
+                value = "";
+            } else {
+                throw new CorbaBindingException("Unexpected Element when reading " + idlType);
             }
             CorbaPrimitiveHandler obj = new CorbaPrimitiveHandler(name, idlType, tc, null);
             obj.setValueFromData(value);

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=535196&r1=535195&r2=535196
==============================================================================
--- 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
Fri May  4 05:09:51 2007
@@ -85,7 +85,7 @@
         return (Double.compare(x.getVarFloat(), y.getVarFloat()) == 0)
             && (x.getVarInt().compareTo(y.getVarInt()) == 0)
             && (x.getVarString().equals(y.getVarString()));
-	//&& (equalsNilable(x.getVarAttrString(), y.getVarAttrString()));
+        //&& (equalsNilable(x.getVarAttrString(), y.getVarAttrString()));
     }
     
     public void testSimpleStruct() throws Exception {
@@ -329,8 +329,14 @@
     //org.apache.type_test.types1.NestedArray
     
     public void testNestedArray() throws Exception {
-        String[][] xs = {{"AAA", "BBB", "CCC"}, {"aaa", "bbb", "ccc"}, {"a_a_a", "b_b_b",
"c_c_c"}};
-        String[][] ys = {{"XXX", "YYY", "ZZZ"}, {"xxx", "yyy", "zzz"}, {"x_x_x", "y_y_y",
"z_z_z"}};
+        String[][] xs = {{"AAA", "BBB", "CCC"},
+                         {"aaa", "bbb", "ccc"},
+                         {"a_a_a", "b_b_b", "c_c_c"},
+                         {"", "", ""}};
+        String[][] ys = {{"XXX", "YYY", "ZZZ"},
+                         {"xxx", "yyy", "zzz"},
+                         {"x_x_x", "y_y_y", "z_z_z"},
+                         {"", "", ""}};
 
         NestedArray x = new NestedArray();
         NestedArray yOrig = new NestedArray();
@@ -338,7 +344,7 @@
         List<UnboundedArray> xList = x.getSubarray();
         List<UnboundedArray> yList = yOrig.getSubarray();
         
-        for (int i = 0; i < 3; i++) {
+        for (int i = 0; i < xs.length; i++) {
             UnboundedArray xx = new UnboundedArray();
             xx.getItem().addAll(Arrays.asList(xs[i]));
             xList.add(xx);
@@ -352,7 +358,7 @@
         NestedArray ret = client.testNestedArray(x, y, z);
 
         if (!perfTestOnly) {
-            for (int i = 0; i < 3; i++) {
+            for (int i = 0; i < xs.length; i++) {
                 for (int j = 0; j < 3; j++) {
                     assertEquals("testNestedArray(): Incorrect value for inout param",
                         x.getSubarray().get(i).getItem().get(j), 



Mime
View raw message