axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r648700 - /webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/engine/MessageContextChangeTest.java
Date Wed, 16 Apr 2008 14:01:00 GMT
Author: dims
Date: Wed Apr 16 07:00:53 2008
New Revision: 648700

URL: http://svn.apache.org/viewvc?rev=648700&view=rev
Log:
get kernel tests to pass with Apache Harmony

Modified:
    webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/engine/MessageContextChangeTest.java

Modified: webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/engine/MessageContextChangeTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/engine/MessageContextChangeTest.java?rev=648700&r1=648699&r2=648700&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/engine/MessageContextChangeTest.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/engine/MessageContextChangeTest.java
Wed Apr 16 07:00:53 2008
@@ -25,6 +25,7 @@
 import org.apache.commons.logging.LogFactory;
 
 import java.lang.reflect.Field;
+import java.util.Arrays;
 
 public class MessageContextChangeTest extends TestCase {
     protected static final Log log = LogFactory.getLog(MessageContextChangeTest.class);
@@ -109,9 +110,9 @@
             new FieldDescription("boolean", "executedPhasesReset"),
             new FieldDescription("java.lang.String", "selfManagedDataDelimiter"),
             new FieldDescription("java.lang.Class",
-                                 "class$org$apache$axis2$context$MessageContext"),
+                                 new String[] {"class$org$apache$axis2$context$MessageContext","class$0"}),
             new FieldDescription("java.lang.Class",
-                                 "class$org$apache$axis2$context$SelfManagedDataManager"),
+                                 new String[] {"class$org$apache$axis2$context$SelfManagedDataManager","class$1"}),
             new FieldDescription("java.lang.Exception", "failureReason"),
     };
 
@@ -144,19 +145,22 @@
 
         for (int i = 0; i < numberKnownFields; i++) {
             // see if this entry is in the actual list
-            String name = knownList[i].getName();
-
-            Field actualField = findField(fields, name);
+            String[] names = knownList[i].getNames();
+            Field actualField = null;
+            for (int j = 0; actualField == null && j < names.length; j++) {
+                String name = names[j];
+                actualField = findField(fields, name);
+            }
 
             if (actualField == null) {
-                log.error("ERROR:  MessageContext is missing field [" + name + "]");
+                log.error("ERROR:  MessageContext is missing field [" + Arrays.asList(names)
+ "]");
                 noChange = false;
             } else {
                 String knownType = knownList[i].getType();
                 String actualType = actualField.getType().getName();
 
                 if (!knownType.equals(actualType)) {
-                    log.error("ERROR:  MessageContext field [" + name +
+                    log.error("ERROR:  MessageContext field [" + Arrays.asList(names) +
                             "] expected type [" + knownType + "] does not match actual type
[" +
                             actualType + "]");
                     noChange = false;
@@ -212,9 +216,11 @@
 
     private FieldDescription findFieldDescription(String name) {
         for (int k = 0; k < knownList.length; k++) {
-            String fieldName = knownList[k].getName();
-            if (fieldName.equals(name)) {
-                return knownList[k];
+            String[] fieldName = knownList[k].getNames();
+            for (int i = 0; i < fieldName.length; i++) {
+                if (fieldName[i].equals(name)) {
+                    return knownList[k];
+                }
             }
         }
         return null;
@@ -223,7 +229,7 @@
 
     private class FieldDescription {
         String type = null;
-        String name = null;
+        String[] name = null;
 
         // constructor
         public FieldDescription() {
@@ -232,6 +238,12 @@
         // constructor
         public FieldDescription(String t, String n) {
             type = t;
+            name = new String[]{n};
+        }
+
+        // constructor
+        public FieldDescription(String t, String[] n) {
+            type = t;
             name = n;
         }
 
@@ -239,16 +251,12 @@
             return type;
         }
 
-        public String getName() {
+        public String[] getNames() {
             return name;
         }
 
         public void setType(String t) {
             type = t;
-        }
-
-        public void setName(String n) {
-            name = n;
         }
     }
 



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org


Mime
View raw message