Author: veithen
Date: Wed Sep 29 14:27:53 2010
New Revision: 1002654

URL: http://svn.apache.org/viewvc?rev=1002654&view=rev
Log:
Enable inclusion of the XLXP implementation from WAS 6.1 (with WS feature pack) 
in the dialect test suite.

Added:
    
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/resources/org/apache/axiom/util/stax/dialect/com.ibm.ws.runtime_6.1.0.properties
      - copied unchanged from r1002552, 
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/resources/org/apache/axiom/util/stax/dialect/com.ibm.ws.runtime.properties
Modified:
    webservices/commons/trunk/modules/axiom/modules/axiom-api/pom.xml
    
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/util/stax/dialect/ParentLastURLClassLoader.java

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-api/pom.xml
URL: 
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-api/pom.xml?rev=1002654&r1=1002653&r2=1002654&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-api/pom.xml (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-api/pom.xml Wed Sep 
29 14:27:53 2010
@@ -224,8 +224,46 @@
     <profiles>
         <profile>
             <!-- This profile adds IBM's XLXP StAX implementation to the 
dialect test suite
+                 if the was61.root property is set to the root directory of a 
WAS 6.1
+                 installation that includes the Web Services feature pack -->
+            <id>was61</id>
+            <activation>
+                <property>
+                    <name>was61.root</name>
+                </property>
+            </activation>
+            <build>
+                <plugins>
+                    <plugin>
+                        <artifactId>maven-resources-plugin</artifactId>
+                        <executions>
+                            <execution>
+                                <id>copy-xlxp-from-was61</id>
+                                <phase>generate-test-resources</phase>
+                                <goals>
+                                    <goal>copy-resources</goal>
+                                </goals>
+                                <configuration>
+                                    
<outputDirectory>${project.build.directory}/parsers</outputDirectory>
+                                    <resources>
+                                        <resource>
+                                            
<directory>${was61.root}/plugins</directory>
+                                            <includes>
+                                                
<include>com.ibm.ws.runtime_6.1.0.jar</include>
+                                            </includes>
+                                        </resource>
+                                    </resources>
+                                </configuration>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+        <profile>
+            <!-- This profile adds IBM's XLXP StAX implementation to the 
dialect test suite
                  if the was7.root property is set to the root directory of a 
WAS 7.0 installation -->
-            <id>test-xlxp</id>
+            <id>was7</id>
             <activation>
                 <property>
                     <name>was7.root</name>
@@ -237,7 +275,7 @@
                         <artifactId>maven-resources-plugin</artifactId>
                         <executions>
                             <execution>
-                                <id>copy-xlxp</id>
+                                <id>copy-xlxp-from-was7</id>
                                 <phase>generate-test-resources</phase>
                                 <goals>
                                     <goal>copy-resources</goal>

Modified: 
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/util/stax/dialect/ParentLastURLClassLoader.java
URL: 
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/util/stax/dialect/ParentLastURLClassLoader.java?rev=1002654&r1=1002653&r2=1002654&view=diff
==============================================================================
--- 
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/util/stax/dialect/ParentLastURLClassLoader.java
 (original)
+++ 
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/util/stax/dialect/ParentLastURLClassLoader.java
 Wed Sep 29 14:27:53 2010
@@ -35,17 +35,21 @@ public class ParentLastURLClassLoader ex
     }
 
     protected synchronized Class loadClass(String name, boolean resolve) 
throws ClassNotFoundException {
-        Class c = findLoadedClass(name);
-        if (c == null) {
-            try {
-                c = findClass(name);
-            } catch (ClassNotFoundException e) {
-                c = getParent().loadClass(name);
+        if (name.startsWith("javax.")) {
+            return super.loadClass(name, resolve);
+        } else {
+            Class c = findLoadedClass(name);
+            if (c == null) {
+                try {
+                    c = findClass(name);
+                } catch (ClassNotFoundException e) {
+                    c = getParent().loadClass(name);
+                }
             }
+            if (resolve) {
+                resolveClass(c);
+            }
+            return c;
         }
-        if (resolve) {
-            resolveClass(c);
-        }
-        return c;
     }
 }


Reply via email to