axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r648732 - /webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/derived/AbstractDerivedPopulater.java
Date Wed, 16 Apr 2008 16:06:47 GMT
Author: dims
Date: Wed Apr 16 09:06:43 2008
New Revision: 648732

URL: http://svn.apache.org/viewvc?rev=648732&view=rev
Log:
Find the factory class properly, don't relay on the fact that it will always be at index 0

Modified:
    webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/derived/AbstractDerivedPopulater.java

Modified: webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/derived/AbstractDerivedPopulater.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/derived/AbstractDerivedPopulater.java?rev=648732&r1=648731&r2=648732&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/derived/AbstractDerivedPopulater.java
(original)
+++ webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/derived/AbstractDerivedPopulater.java
Wed Apr 16 09:06:43 2008
@@ -46,8 +46,13 @@
         XMLStreamReader reader = StAXUtils.createXMLStreamReader(new ByteArrayInputStream(testString.getBytes()));
         Class clazz = Class.forName(className);
         Class[] declaredClasse = clazz.getDeclaredClasses();
-        //ideally this should be 1
-        Class innerClazz = declaredClasse[0];
+        Class innerClazz = null;
+        for (int i = 0; i < declaredClasse.length; i++) {
+            Class aClass = declaredClasse[i];
+            if(aClass != null && aClass.getCanonicalName().endsWith("Factory")){
+				innerClazz = aClass;
+            }
+        }
         Method parseMethod = innerClazz.getMethod("parse",new Class[]{XMLStreamReader.class});
         Object obj = parseMethod.invoke(null,new Object[]{reader});
         assertNotNull(obj);



---------------------------------------------------------------------
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