JBossWS SVN: r8611 - stack/cxf/trunk.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2008-10-31 05:07:06 -0400 (Fri, 31 Oct 2008)
New Revision: 8611
Modified:
stack/cxf/trunk/pom.xml
Log:
Updating dependencies
Modified: stack/cxf/trunk/pom.xml
===================================================================
--- stack/cxf/trunk/pom.xml 2008-10-31 09:05:15 UTC (rev 8610)
+++ stack/cxf/trunk/pom.xml 2008-10-31 09:07:06 UTC (rev 8611)
@@ -45,8 +45,8 @@
<!-- Properties -->
<properties>
<jbossws.common.version>1.0.8-SNAPSHOT</jbossws.common.version>
- <jbossws.framework.version>3.0.4.GA</jbossws.framework.version>
- <jbossws.spi.version>1.0.6.GA</jbossws.spi.version>
+ <jbossws.framework.version>3.0.5-SNAPSHOT</jbossws.framework.version>
+ <jbossws.spi.version>1.0.7-SNAPSHOT</jbossws.spi.version>
<jbossws.jboss422.version>3.0.4.GA</jbossws.jboss422.version>
<jbossws.jboss423.version>3.0.4.GA</jbossws.jboss423.version>
<jbossws.jboss424.version>3.0.4.GA</jbossws.jboss424.version>
16 years, 1 month
JBossWS SVN: r8610 - stack/metro/trunk/modules/testsuite.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2008-10-31 05:05:15 -0400 (Fri, 31 Oct 2008)
New Revision: 8610
Modified:
stack/metro/trunk/modules/testsuite/test-excludes-jboss500-JDK6.txt
stack/metro/trunk/modules/testsuite/test-excludes-jboss500.txt
stack/metro/trunk/modules/testsuite/test-excludes-jboss501-JDK6.txt
stack/metro/trunk/modules/testsuite/test-excludes-jboss501.txt
Log:
[JBMETA-141][JBWS-2206] Excluding tests on AS5 till jboss-metadata 1.0.0.CR4 is not available
Modified: stack/metro/trunk/modules/testsuite/test-excludes-jboss500-JDK6.txt
===================================================================
--- stack/metro/trunk/modules/testsuite/test-excludes-jboss500-JDK6.txt 2008-10-30 22:27:51 UTC (rev 8609)
+++ stack/metro/trunk/modules/testsuite/test-excludes-jboss500-JDK6.txt 2008-10-31 09:05:15 UTC (rev 8610)
@@ -10,6 +10,9 @@
# [JBAS-5115] Valid jboss-app.xml file not recognized correctly by jbossxb runtime
org/jboss/test/ws/jaxws/jbws1822/JBWS1822TestCase.*
+# [JBMETA-141] Implement getChildren() in VirtualFileAdaptor
+org/jboss/test/ws/jaxws/jbws2206/**
+
# [JBWS-2127] Cannot generate WSDL for binding "http://www.w3.org/2003/05/soap/bindings/HTTP/"
org/jboss/test/ws/jaxws/binding/**
org/jboss/test/ws/jaxws/handlerscope/**
Modified: stack/metro/trunk/modules/testsuite/test-excludes-jboss500.txt
===================================================================
--- stack/metro/trunk/modules/testsuite/test-excludes-jboss500.txt 2008-10-30 22:27:51 UTC (rev 8609)
+++ stack/metro/trunk/modules/testsuite/test-excludes-jboss500.txt 2008-10-31 09:05:15 UTC (rev 8610)
@@ -7,6 +7,9 @@
# [EJBTHREE-1152] service-ref in ejb-jar.xml is ignored
org/jboss/test/ws/jaxws/samples/serviceref/ServiceRefEJBTestCase.*
+# [JBMETA-141] Implement getChildren() in VirtualFileAdaptor
+org/jboss/test/ws/jaxws/jbws2206/**
+
# [JBWS-2127] Cannot generate WSDL for binding "http://www.w3.org/2003/05/soap/bindings/HTTP/"
org/jboss/test/ws/jaxws/binding/**
org/jboss/test/ws/jaxws/handlerscope/**
Modified: stack/metro/trunk/modules/testsuite/test-excludes-jboss501-JDK6.txt
===================================================================
--- stack/metro/trunk/modules/testsuite/test-excludes-jboss501-JDK6.txt 2008-10-30 22:27:51 UTC (rev 8609)
+++ stack/metro/trunk/modules/testsuite/test-excludes-jboss501-JDK6.txt 2008-10-31 09:05:15 UTC (rev 8610)
@@ -10,6 +10,9 @@
# [EJBTHREE-1537] NPE in org.jboss.ejb3.javaee.JavaEEComponentHelper.createObjectName() method
org/jboss/test/ws/jaxws/jbws1822/JBWS1822TestCase.*
+# [JBMETA-141] Implement getChildren() in VirtualFileAdaptor
+org/jboss/test/ws/jaxws/jbws2206/**
+
# [JBWS-2127] Cannot generate WSDL for binding "http://www.w3.org/2003/05/soap/bindings/HTTP/"
org/jboss/test/ws/jaxws/binding/**
org/jboss/test/ws/jaxws/handlerscope/**
Modified: stack/metro/trunk/modules/testsuite/test-excludes-jboss501.txt
===================================================================
--- stack/metro/trunk/modules/testsuite/test-excludes-jboss501.txt 2008-10-30 22:27:51 UTC (rev 8609)
+++ stack/metro/trunk/modules/testsuite/test-excludes-jboss501.txt 2008-10-31 09:05:15 UTC (rev 8610)
@@ -7,6 +7,9 @@
# [EJBTHREE-1152] service-ref in ejb-jar.xml is ignored
org/jboss/test/ws/jaxws/samples/serviceref/ServiceRefEJBTestCase.*
+# [JBMETA-141] Implement getChildren() in VirtualFileAdaptor
+org/jboss/test/ws/jaxws/jbws2206/**
+
# [JBWS-2127] Cannot generate WSDL for binding "http://www.w3.org/2003/05/soap/bindings/HTTP/"
org/jboss/test/ws/jaxws/binding/**
org/jboss/test/ws/jaxws/handlerscope/**
16 years, 1 month
JBossWS SVN: r8609 - stack/native/trunk.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2008-10-30 18:27:51 -0400 (Thu, 30 Oct 2008)
New Revision: 8609
Modified:
stack/native/trunk/pom.xml
Log:
Update dependencies
Modified: stack/native/trunk/pom.xml
===================================================================
--- stack/native/trunk/pom.xml 2008-10-30 19:57:33 UTC (rev 8608)
+++ stack/native/trunk/pom.xml 2008-10-30 22:27:51 UTC (rev 8609)
@@ -49,8 +49,8 @@
<!-- Properties -->
<properties>
<jbossws.common.version>1.0.8-SNAPSHOT</jbossws.common.version>
- <jbossws.framework.version>3.0.4.GA</jbossws.framework.version>
- <jbossws.spi.version>1.0.6.GA</jbossws.spi.version>
+ <jbossws.framework.version>3.0.5-SNAPSHOT</jbossws.framework.version>
+ <jbossws.spi.version>1.0.7-SNAPSHOT</jbossws.spi.version>
<jbossws.jboss422.version>3.0.4.GA</jbossws.jboss422.version>
<jbossws.jboss423.version>3.0.4.GA</jbossws.jboss423.version>
<jbossws.jboss424.version>3.0.4.GA</jbossws.jboss424.version>
16 years, 1 month
JBossWS SVN: r8608 - stack/metro/trunk/modules/testsuite/metro-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2206.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2008-10-30 15:57:33 -0400 (Thu, 30 Oct 2008)
New Revision: 8608
Modified:
stack/metro/trunk/modules/testsuite/metro-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2206/JBWS2206TestCase.java
Log:
[JBWS-2206][JBWS-2374] Performing a real test in JBWS2206TestCase
Modified: stack/metro/trunk/modules/testsuite/metro-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2206/JBWS2206TestCase.java
===================================================================
--- stack/metro/trunk/modules/testsuite/metro-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2206/JBWS2206TestCase.java 2008-10-30 19:56:13 UTC (rev 8607)
+++ stack/metro/trunk/modules/testsuite/metro-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2206/JBWS2206TestCase.java 2008-10-30 19:57:33 UTC (rev 8608)
@@ -24,12 +24,23 @@
import junit.framework.Test;
import org.jboss.wsf.test.JBossWSTest;
import org.jboss.wsf.test.JBossWSTestSetup;
-import org.jboss.test.ws.jaxws.jbws1871.JBWS1871EndpointImplService;
-import org.jboss.test.ws.jaxws.jbws1871.JBWS1871Endpoint;
+import javax.wsdl.Definition;
+import javax.wsdl.Types;
+import javax.wsdl.extensions.ExtensibilityElement;
+import javax.wsdl.extensions.schema.Schema;
+import javax.wsdl.extensions.schema.SchemaImport;
+import javax.wsdl.factory.WSDLFactory;
+import javax.wsdl.xml.WSDLReader;
import javax.xml.ws.Service;
import javax.xml.namespace.QName;
+
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
+import java.net.HttpURLConnection;
import java.net.URL;
+import java.util.List;
+import java.util.Map;
public class JBWS2206TestCase extends JBossWSTest
{
@@ -40,15 +51,47 @@
public void testClientProxy() throws Exception
{
- Service service = Service.create(
- new URL("http://"+getServerHost()+":8080/jaxws-jbws2206/MetroTestServiceBean?wsdl"),
- new QName("http://com.acme.metroexceptiontest/", "MetroTestService")
- );
+ URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-jbws2206/MetroTestServiceBean?wsdl");
+ Service service = Service.create(wsdlURL, new QName("http://com.acme.metroexceptiontest/", "MetroTestService"));
MetroTestPortType port = service.getPort(MetroTestPortType.class);
String res = port.helloWorld();
assertEquals("HelloWorld", res);
+ }
- System.out.println("FIXME JBWS2206: WSDL imports are not replaced with absolute path");
+ public void testImportedDocument() throws Exception
+ {
+ URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-jbws2206/MetroTestServiceBean?wsdl");
+ WSDLReader wsdlReader = WSDLFactory.newInstance().newWSDLReader();
+ Definition wsdlDefinition = wsdlReader.readWSDL(wsdlURL.toString());
+ assertNotNull(wsdlDefinition);
+ Types types = wsdlDefinition.getTypes();
+ Map<String, List<SchemaImport>> map = null;
+ for (ExtensibilityElement el : (List<ExtensibilityElement>)types.getExtensibilityElements())
+ {
+ if (el instanceof Schema)
+ {
+ map = (Map<String, List<SchemaImport>>)((Schema)el).getImports();
+ }
+ }
+ assertNotNull(map);
+ SchemaImport schemaImport = map.get("http://com.acme.metroexceptiontest/").iterator().next();
+ assertNotNull(schemaImport);
+ String schemaLocation = schemaImport.getSchemaLocationURI();
+ assertNotNull(schemaLocation);
+ assertTrue(schemaLocation.startsWith("http://" + getServerHost())); //check absolute url
+
+
+ HttpURLConnection con = (HttpURLConnection)new URL(schemaLocation).openConnection();
+ BufferedReader isr = new BufferedReader(new InputStreamReader(con.getInputStream()));
+ String s = isr.readLine();
+ StringBuilder sb = new StringBuilder();
+ while (s != null)
+ {
+ sb.append(s);
+ sb.append("\n");
+ s = isr.readLine();
+ }
+ assertTrue(sb.toString().contains("MetroTestFaultInfo"));
}
}
16 years, 1 month
JBossWS SVN: r8607 - stack/metro/trunk.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2008-10-30 15:56:13 -0400 (Thu, 30 Oct 2008)
New Revision: 8607
Modified:
stack/metro/trunk/pom.xml
Log:
Updating dependencies on spi and framework
Modified: stack/metro/trunk/pom.xml
===================================================================
--- stack/metro/trunk/pom.xml 2008-10-30 19:55:30 UTC (rev 8606)
+++ stack/metro/trunk/pom.xml 2008-10-30 19:56:13 UTC (rev 8607)
@@ -46,8 +46,8 @@
<!-- Properties -->
<properties>
<jbossws.common.version>1.0.8-SNAPSHOT</jbossws.common.version>
- <jbossws.framework.version>3.0.4.GA</jbossws.framework.version>
- <jbossws.spi.version>1.0.6.GA</jbossws.spi.version>
+ <jbossws.framework.version>3.0.5-SNAPSHOT</jbossws.framework.version>
+ <jbossws.spi.version>1.0.7-SNAPSHOT</jbossws.spi.version>
<jbossws.jboss422.version>3.0.4.GA</jbossws.jboss422.version>
<jbossws.jboss423.version>3.0.4.GA</jbossws.jboss423.version>
<jbossws.jboss424.version>3.0.4.GA</jbossws.jboss424.version>
16 years, 1 month
JBossWS SVN: r8606 - in stack/metro/trunk/modules/server/src/main/java/org/jboss/wsf/stack/metro: metadata and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2008-10-30 15:55:30 -0400 (Thu, 30 Oct 2008)
New Revision: 8606
Modified:
stack/metro/trunk/modules/server/src/main/java/org/jboss/wsf/stack/metro/DeploymentDescriptorParserExt.java
stack/metro/trunk/modules/server/src/main/java/org/jboss/wsf/stack/metro/metadata/VFSResourceLoader.java
Log:
[JBWS-2374] Now actually collecting docs (imported wsdl and xml) from META-INF/wsdl and WEB-INF/wsdl
Modified: stack/metro/trunk/modules/server/src/main/java/org/jboss/wsf/stack/metro/DeploymentDescriptorParserExt.java
===================================================================
--- stack/metro/trunk/modules/server/src/main/java/org/jboss/wsf/stack/metro/DeploymentDescriptorParserExt.java 2008-10-30 19:50:00 UTC (rev 8605)
+++ stack/metro/trunk/modules/server/src/main/java/org/jboss/wsf/stack/metro/DeploymentDescriptorParserExt.java 2008-10-30 19:55:30 UTC (rev 8606)
@@ -135,34 +135,26 @@
this.loader = loader;
this.container = container;
this.adapterFactory = adapterFactory;
-
- // toggle EJB and WEB deployments
- String resourcePath = "/META-INF/";
+ findDocs("/META-INF/wsdl/");
+ findDocs("/WEB-INF/wsdl/");
+ logger.fine("metadata=" + docs);
+ }
+
+ private void findDocs(String resourcePath)
+ {
try
{
URL resource = loader.getResource(resourcePath);
- InputStream inputStream = null;
- try
+ if (resource != null)
{
- inputStream = resource.openStream();
+ log.debug("Collecting docs from " + resourcePath);
+ collectDocs(resourcePath);
}
- finally
- {
- if(inputStream!=null)
- inputStream.close();
- }
-
- log.warn("bypass collectDocs(), it doesnt work for EJB endpoints");
}
catch (Exception e)
{
- resourcePath = "/WEB-INF/";
- log.debug("Collecting docs from " + resourcePath);
-
- collectDocs(resourcePath+"wsdl/");
- logger.fine("metadata=" + docs);
+ //ignore
}
-
}
/**
Modified: stack/metro/trunk/modules/server/src/main/java/org/jboss/wsf/stack/metro/metadata/VFSResourceLoader.java
===================================================================
--- stack/metro/trunk/modules/server/src/main/java/org/jboss/wsf/stack/metro/metadata/VFSResourceLoader.java 2008-10-30 19:50:00 UTC (rev 8605)
+++ stack/metro/trunk/modules/server/src/main/java/org/jboss/wsf/stack/metro/metadata/VFSResourceLoader.java 2008-10-30 19:55:30 UTC (rev 8606)
@@ -21,24 +21,23 @@
*/
package org.jboss.wsf.stack.metro.metadata;
-import com.sun.xml.ws.transport.http.ResourceLoader;
-import org.jboss.wsf.spi.deployment.UnifiedVirtualFile;
-import org.jboss.logging.Logger;
-
import java.io.File;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
+import java.util.ArrayList;
import java.util.HashSet;
-import java.util.Set;
import java.util.List;
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.jar.JarFile;
-import java.util.jar.JarEntry;
+import java.util.Set;
+import org.jboss.logging.Logger;
+import org.jboss.wsf.spi.deployment.UnifiedVirtualFile;
+
+import com.sun.xml.ws.transport.http.ResourceLoader;
+
/**
* @author Heiko.Braun(a)jboss.com
+ * @author alessio.soldano(a)jboss.com
*/
public class VFSResourceLoader implements ResourceLoader
{
@@ -59,7 +58,8 @@
if(path.startsWith("/"))
path = path.substring(1, path.length());
- return vfs.findChild(path).toURL();
+ UnifiedVirtualFile uvf = vfs.findChild(path);
+ return uvf != null ? uvf.toURL() : null;
}
catch (IOException e)
{
@@ -76,7 +76,7 @@
}
catch (MalformedURLException e)
{
- // ingore
+ // ignore
}
return resource;
}
@@ -84,75 +84,29 @@
public Set<String> getResourcePaths(String path)
{
Set<String> resources = new HashSet<String>();
-
+ resources.addAll(getFileResources(path));
+ return resources;
+ }
+
+ private List<String> getFileResources(String path)
+ {
+ List<String> resources = new ArrayList<String>();
try
{
- URL rootUrl = getResource(path);
- if(rootUrl.getProtocol().equals("jar"))
+ if(path.startsWith("/"))
+ path = path.substring(1, path.length());
+ List<UnifiedVirtualFile> list = vfs.findChild(path).getChildren();
+ for (UnifiedVirtualFile uvf : list)
{
- /*String urlString = rootUrl.toExternalForm();
- String jarRoot = urlString.substring(4, urlString.indexOf("jar!")+3);
-
- File jar = new File(jarRoot);
- assert jar.exists();
- JarFile jarFile = new JarFile(jar);
-
- List<String> jarResources = getJARResources(jarFile, path);
-
- resources.addAll(jarResources);*/
- log.warn("Cannot collect resourcePaths from EJB jar");
+ String name = uvf.getName();
+ if (name != null && (name.endsWith(File.separator) || name.endsWith(".xml") || name.endsWith(".xsd") || name.endsWith(".wsdl")))
+ resources.add(path + uvf.getName());
}
- else
- {
- File root = new File( rootUrl.toURI() );
- List<String> fileResources = getFileResources(root, path);
- resources.addAll(fileResources);
- }
}
- catch (Exception e)
+ catch (Throwable e)
{
log.error("Failed to read resource paths from '"+path+"': ", e);
}
-
return resources;
}
-
- private static List<String> getFileResources(File root, String path)
- {
- List<String> resources = new ArrayList<String>();
-
- if(root.exists())
- {
- File[] files = root.listFiles();
- if (files != null) {
- for( File f : files) {
- if(f.isDirectory()) {
- resources.add(path+f.getName()+'/');
- } else {
- resources.add(path+f.getName());
- }
- }
- }
- }
- return resources;
- }
-
- private static List<String> getJARResources(JarFile jarFile, String path) {
- List<String> resources = new ArrayList<String>();
-
- Enumeration entries = jarFile.entries();
- while (entries.hasMoreElements()) {
- JarEntry entry = (JarEntry) entries.nextElement();
- String entryName = entry.getName();
-
- if (entryName.matches(".*?\\.xml$")
- || entryName.matches(".*?\\.wsdl$")
- || entryName.matches(".*?\\.xsd$"))
- {
- resources.add(entryName);
- }
- }
-
- return resources;
- }
}
16 years, 1 month
JBossWS SVN: r8605 - framework/trunk.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2008-10-30 15:50:00 -0400 (Thu, 30 Oct 2008)
New Revision: 8605
Modified:
framework/trunk/pom.xml
Log:
Updating dependencies on spi and common
Modified: framework/trunk/pom.xml
===================================================================
--- framework/trunk/pom.xml 2008-10-30 19:49:20 UTC (rev 8604)
+++ framework/trunk/pom.xml 2008-10-30 19:50:00 UTC (rev 8605)
@@ -25,8 +25,8 @@
<!-- Properties -->
<properties>
- <jbossws.common.version>1.0.7.GA</jbossws.common.version>
- <jbossws.spi.version>1.0.6.GA</jbossws.spi.version>
+ <jbossws.common.version>1.0.8-SNAPSHOT</jbossws.common.version>
+ <jbossws.spi.version>1.0.7-SNAPSHOT</jbossws.spi.version>
<jboss.common.version>1.2.1.GA</jboss.common.version>
<jbossxb.version>1.0.0.SP1</jbossxb.version>
</properties>
16 years, 1 month
JBossWS SVN: r8604 - in framework/trunk/testsuite/test: resources/jaxws/jbws1841/META-INF/wsdl and 1 other directories.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2008-10-30 15:49:20 -0400 (Thu, 30 Oct 2008)
New Revision: 8604
Modified:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws1841/EndpointInterface.java
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws1841/EndpointService.java
framework/trunk/testsuite/test/resources/jaxws/jbws1841/META-INF/wsdl/TestService.wsdl
framework/trunk/testsuite/test/resources/jaxws/jbws1841/META-INF_4/wsdl/TestService.wsdl
Log:
Minor changes to port name in JBWS-1841 test case to run with Metro with changes due to JBWS-2374 - wip
Modified: framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws1841/EndpointInterface.java
===================================================================
--- framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws1841/EndpointInterface.java 2008-10-30 19:41:10 UTC (rev 8603)
+++ framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws1841/EndpointInterface.java 2008-10-30 19:49:20 UTC (rev 8604)
@@ -32,7 +32,7 @@
* @since 29-Apr-2005
*/
@WebService(
- targetNamespace = "http://www.openuri.org/2004/04/HelloWorld"
+ targetNamespace = "http://www.openuri.org/2004/04/HelloWorld"
)
@SOAPBinding(style = SOAPBinding.Style.RPC)
@Remote
Modified: framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws1841/EndpointService.java
===================================================================
--- framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws1841/EndpointService.java 2008-10-30 19:41:10 UTC (rev 8603)
+++ framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws1841/EndpointService.java 2008-10-30 19:49:20 UTC (rev 8604)
@@ -30,13 +30,13 @@
@WebServiceClient(name="EndpointService", targetNamespace="http://www.openuri.org/2004/04/HelloWorld")
public class EndpointService extends javax.xml.ws.Service
{
- private final static QName TESTENDPOINTPORT = new QName("http://www.openuri.org/2004/04/HelloWorld", "EndpointInterfacePort");
+ private final static QName TESTENDPOINTPORT = new QName("http://www.openuri.org/2004/04/HelloWorld", "EJB3BeanPort");
public EndpointService(URL wsdlLocation, QName serviceName) {
super(wsdlLocation, serviceName);
}
- @WebEndpoint(name = "EndpointInterfacePort")
+ @WebEndpoint(name = "EJB3BeanPort")
public EndpointInterface getEndpointPort() {
return (EndpointInterface)super.getPort(TESTENDPOINTPORT, EndpointInterface.class);
}
Modified: framework/trunk/testsuite/test/resources/jaxws/jbws1841/META-INF/wsdl/TestService.wsdl
===================================================================
--- framework/trunk/testsuite/test/resources/jaxws/jbws1841/META-INF/wsdl/TestService.wsdl 2008-10-30 19:41:10 UTC (rev 8603)
+++ framework/trunk/testsuite/test/resources/jaxws/jbws1841/META-INF/wsdl/TestService.wsdl 2008-10-30 19:49:20 UTC (rev 8604)
@@ -32,7 +32,7 @@
</binding>
<service name='EndpointService'>
- <port binding='tns:EndpointInterfaceBinding' name='EndpointInterfacePort'>
+ <port binding='tns:EndpointInterfaceBinding' name='EJB3BeanPort'>
<soap:address location='http://@jboss.bind.address@:8080/jaxws-jbws1841/EJB3Bean'/>
</port>
</service>
Modified: framework/trunk/testsuite/test/resources/jaxws/jbws1841/META-INF_4/wsdl/TestService.wsdl
===================================================================
--- framework/trunk/testsuite/test/resources/jaxws/jbws1841/META-INF_4/wsdl/TestService.wsdl 2008-10-30 19:41:10 UTC (rev 8603)
+++ framework/trunk/testsuite/test/resources/jaxws/jbws1841/META-INF_4/wsdl/TestService.wsdl 2008-10-30 19:49:20 UTC (rev 8604)
@@ -32,7 +32,7 @@
</binding>
<service name='EndpointService'>
- <port binding='tns:EndpointInterfaceBinding' name='EndpointInterfacePort'>
+ <port binding='tns:EndpointInterfaceBinding' name='EJB3BeanPort'>
<soap:address location='http://@jboss.bind.address@:8080/jaxws-jbws1841/EJB3Bean'/>
</port>
</service>
16 years, 1 month
JBossWS SVN: r8603 - common/trunk.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2008-10-30 15:41:10 -0400 (Thu, 30 Oct 2008)
New Revision: 8603
Modified:
common/trunk/pom.xml
Log:
Updating dependency on spi
Modified: common/trunk/pom.xml
===================================================================
--- common/trunk/pom.xml 2008-10-30 19:40:43 UTC (rev 8602)
+++ common/trunk/pom.xml 2008-10-30 19:41:10 UTC (rev 8603)
@@ -27,7 +27,7 @@
<!-- Properties -->
<properties>
- <jbossws.spi.version>1.0.6.GA</jbossws.spi.version>
+ <jbossws.spi.version>1.0.7-SNAPSHOT</jbossws.spi.version>
<jboss.common.version>2.2.7.GA</jboss.common.version>
<jboss.microcontainer.version>1.0.2</jboss.microcontainer.version>
</properties>
16 years, 1 month
JBossWS SVN: r8602 - in common/trunk/src: test/java/org/jboss/test/ws/common and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2008-10-30 15:40:43 -0400 (Thu, 30 Oct 2008)
New Revision: 8602
Added:
common/trunk/src/test/java/org/jboss/test/ws/common/ResourceLoaderAdapterTestCase.java
common/trunk/src/test/java/org/jboss/test/ws/common/URLLoaderAdapterTestCase.java
Modified:
common/trunk/src/main/java/org/jboss/wsf/common/ResourceLoaderAdapter.java
common/trunk/src/main/java/org/jboss/wsf/common/URLLoaderAdapter.java
Log:
- [JBWS-2375] Adding getChildren and getName to ResourceLoaderAdapter and URLLoaderAdapter
- adding testcases for ResourceLoaderAdapter and URLLoaderAdapter
Modified: common/trunk/src/main/java/org/jboss/wsf/common/ResourceLoaderAdapter.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/common/ResourceLoaderAdapter.java 2008-10-30 19:37:40 UTC (rev 8601)
+++ common/trunk/src/main/java/org/jboss/wsf/common/ResourceLoaderAdapter.java 2008-10-30 19:40:43 UTC (rev 8602)
@@ -25,7 +25,15 @@
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.util.Enumeration;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.jar.JarEntry;
+import java.util.jar.JarFile;
+import org.jboss.logging.Logger;
import org.jboss.wsf.spi.deployment.UnifiedVirtualFile;
/**
@@ -33,12 +41,15 @@
* If no classload is set, the the thread context classloader will be used.
*
* @author Heiko.Braun(a)jboss.org
+ * @author alessio.soldano(a)jboss.com
* @since 25.01.2007
*/
public class ResourceLoaderAdapter implements UnifiedVirtualFile
{
private URL resourceURL;
private ClassLoader loader;
+ private static Logger log = Logger.getLogger(ResourceLoaderAdapter.class);
+ private static final String jarFileSeparator = "/";
public ResourceLoaderAdapter()
{
@@ -112,4 +123,116 @@
throw new IllegalStateException("UnifiedVirtualFile not initialized");
return resourceURL;
}
+
+ public List<UnifiedVirtualFile> getChildren() throws IOException
+ {
+ if (null == this.resourceURL)
+ throw new IllegalStateException("UnifiedVirtualFile not initialized");
+ List<UnifiedVirtualFile> list = new LinkedList<UnifiedVirtualFile>();
+ if (resourceURL.getProtocol().equals("jar"))
+ {
+ String urlString = resourceURL.toExternalForm();
+ String jarRoot = urlString.substring(4, urlString.indexOf("ar!") + 2);
+ String path = urlString.contains("!") ? urlString.substring(urlString.lastIndexOf("!") + 2) : "";
+ if (path.endsWith(jarFileSeparator))
+ path = path.substring(0, path.lastIndexOf(jarFileSeparator));
+
+ try
+ {
+ //get the jar and open it
+ String folder = jarRoot.substring(5,jarRoot.lastIndexOf(File.separator));
+ String filename = jarRoot.substring(jarRoot.lastIndexOf(File.separator)+1);
+ final File jar = new File(folder, filename);
+
+ PrivilegedAction<JarFile> action = new PrivilegedAction<JarFile>()
+ {
+ public JarFile run()
+ {
+ try
+ {
+ return new JarFile(jar);
+ }
+ catch (IOException e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+ };
+ JarFile jarFile = AccessController.doPrivileged(action);
+
+ if (jar.canRead())
+ {
+ Enumeration<JarEntry> entries = jarFile.entries();
+ List<String> pathMatch = new LinkedList<String>();
+ List<String> finalMatch = new LinkedList<String>();
+ while (entries.hasMoreElements())
+ {
+ JarEntry entry = entries.nextElement();
+ String name = entry.getName();
+ //keep entries starting with the current resource path (exclude inner classes and the current file)
+ if (name.startsWith(path + jarFileSeparator) && (name.length() > path.length() + 1) && !name.contains("$"))
+ pathMatch.add(name.substring(path.length() + 1));
+ }
+ for (String s : pathMatch)
+ {
+ //do not go deeper than the current dir
+ if (!s.contains(jarFileSeparator) || s.indexOf(jarFileSeparator) == s.length() - 1)
+ finalMatch.add(s);
+ }
+ for (String s : finalMatch)
+ {
+ URL sUrl = new URL(urlString + jarFileSeparator + s);
+ list.add(new ResourceLoaderAdapter(loader, sUrl));
+ }
+ }
+ }
+ catch (Exception e)
+ {
+ log.error("Cannot get children for resource: " + resourceURL, e);
+ }
+ }
+ else //std file/dir
+ {
+ try
+ {
+ File file = new File(resourceURL.toURI());
+ if (file.exists() && file.isDirectory())
+ {
+ File[] files = file.listFiles();
+ if (files != null)
+ {
+ for (File f : files)
+ {
+ list.add(new ResourceLoaderAdapter(loader, f.toURL()));
+ }
+ }
+ }
+ }
+ catch (Exception e)
+ {
+ log.error("Cannot get children for resource: " + resourceURL, e);
+ }
+ }
+ return list;
+ }
+
+ public String getName()
+ {
+ if (null == this.resourceURL)
+ throw new IllegalStateException("UnifiedVirtualFile not initialized");
+ String name = null;
+ try
+ {
+ String filename = resourceURL.getFile();
+ File f = new File(filename);
+ name = f.getName();
+ if (f.isDirectory() || (resourceURL.getProtocol().equals("jar") && filename.endsWith(jarFileSeparator)))
+ name = name + jarFileSeparator;
+ }
+ catch (Exception e)
+ {
+ log.error("Cannot get name for resource: " + resourceURL);
+ }
+ return name;
+ }
}
Modified: common/trunk/src/main/java/org/jboss/wsf/common/URLLoaderAdapter.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/common/URLLoaderAdapter.java 2008-10-30 19:37:40 UTC (rev 8601)
+++ common/trunk/src/main/java/org/jboss/wsf/common/URLLoaderAdapter.java 2008-10-30 19:40:43 UTC (rev 8602)
@@ -26,7 +26,15 @@
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLClassLoader;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.util.Enumeration;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.jar.JarEntry;
+import java.util.jar.JarFile;
+import org.jboss.logging.Logger;
import org.jboss.wsf.spi.deployment.UnifiedVirtualFile;
/**
@@ -35,6 +43,7 @@
*
*
* @author Heiko.Braun(a)jboss.org
+ * @author alessio.soldano(a)jboss.com
* @since 25.01.2007
*/
public class URLLoaderAdapter implements UnifiedVirtualFile
@@ -42,6 +51,8 @@
private URL rootURL;
private URL resourceURL;
private transient URLClassLoader loader;
+ private static Logger log = Logger.getLogger(URLLoaderAdapter.class);
+ private static final String jarFileSeparator = "/";
public URLLoaderAdapter(URL rootURL)
{
@@ -121,4 +132,116 @@
}
return loader;
}
+
+ public List<UnifiedVirtualFile> getChildren() throws IOException
+ {
+ List<UnifiedVirtualFile> list = new LinkedList<UnifiedVirtualFile>();
+
+ URL url = toURL();
+
+ if (url.getProtocol().equals("jar"))
+ {
+ String urlString = url.toExternalForm();
+ String jarRoot = urlString.substring(4, urlString.indexOf("ar!") + 2);
+ String path = urlString.contains("!") ? urlString.substring(urlString.lastIndexOf("!") + 2) : "";
+ if (path.endsWith(jarFileSeparator))
+ path = path.substring(0, path.lastIndexOf(jarFileSeparator));
+
+ try
+ {
+ String folder = jarRoot.substring(5,jarRoot.lastIndexOf(File.separator));
+ String filename = jarRoot.substring(jarRoot.lastIndexOf(File.separator)+1);
+ final File jar = new File(folder, filename);
+
+ PrivilegedAction<JarFile> action = new PrivilegedAction<JarFile>()
+ {
+ public JarFile run()
+ {
+ try
+ {
+ return new JarFile(jar);
+ }
+ catch (IOException e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+ };
+ JarFile jarFile = AccessController.doPrivileged(action);
+
+ if (jar.canRead())
+ {
+ Enumeration<JarEntry> entries = jarFile.entries();
+ List<String> pathMatch = new LinkedList<String>();
+ List<String> finalMatch = new LinkedList<String>();
+ while (entries.hasMoreElements())
+ {
+ JarEntry entry = entries.nextElement();
+ String name = entry.getName();
+ //keep entries starting with the current resource path (exclude inner classes and the current file)
+ if (name.startsWith(path + jarFileSeparator) && (name.length() > path.length() + 1) && !name.contains("$"))
+ pathMatch.add(name.substring(path.length() + 1));
+ }
+
+ for (String s : pathMatch)
+ {
+ //do not go deeper than the current dir
+ if (!s.contains(jarFileSeparator) || s.indexOf(jarFileSeparator) == s.length() - 1)
+ finalMatch.add(s);
+ }
+ for (String s : finalMatch)
+ {
+ URL sUrl = new URL(urlString + jarFileSeparator + s);
+ list.add(new URLLoaderAdapter(rootURL, loader, sUrl));
+ }
+ }
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ log.error("Cannot get children for resource: " + url);
+ }
+ }
+ else //std file/dir
+ {
+ try
+ {
+ File file = new File(url.toURI());
+ if (file.exists() && file.isDirectory())
+ {
+ File[] files = file.listFiles();
+ if (files != null)
+ {
+ for (File f : files)
+ {
+ list.add(new URLLoaderAdapter(rootURL, loader, f.toURL()));
+ }
+ }
+ }
+ }
+ catch (Exception e)
+ {
+ log.error("Cannot get children for resource: " + url, e);
+ }
+ }
+ return list;
+ }
+
+ public String getName()
+ {
+ String name = null;
+ try
+ {
+ String filename = toURL().getFile();
+ File f = new File(filename);
+ name = f.getName();
+ if (f.isDirectory() || (toURL().getProtocol().equals("jar") && filename.endsWith(jarFileSeparator)))
+ name = name + jarFileSeparator;
+ }
+ catch (Exception e)
+ {
+ log.error("Cannot get name for resource: " + toURL(), e);
+ }
+ return name;
+ }
}
Added: common/trunk/src/test/java/org/jboss/test/ws/common/ResourceLoaderAdapterTestCase.java
===================================================================
--- common/trunk/src/test/java/org/jboss/test/ws/common/ResourceLoaderAdapterTestCase.java (rev 0)
+++ common/trunk/src/test/java/org/jboss/test/ws/common/ResourceLoaderAdapterTestCase.java 2008-10-30 19:40:43 UTC (rev 8602)
@@ -0,0 +1,93 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.common;
+
+import java.io.File;
+import java.util.List;
+
+import junit.framework.TestCase;
+
+import org.jboss.wsf.common.ResourceLoaderAdapter;
+import org.jboss.wsf.spi.deployment.UnifiedVirtualFile;
+
+/**
+ * Test the ResourceLoaderAdapter
+ *
+ * @author alessio.soldano(a)jboss.org
+ * @since 30-Oct-2008
+ */
+public class ResourceLoaderAdapterTestCase extends TestCase
+{
+ public void testWithJar() throws Exception
+ {
+ //Getting the classloader for UnifiedVirtualFile which lives in SPI -> external jar (from the maven repo)
+ ClassLoader cl = UnifiedVirtualFile.class.getClassLoader();
+ ResourceLoaderAdapter ula = new ResourceLoaderAdapter(cl);
+
+ UnifiedVirtualFile deployment = ula.findChild("org/jboss/wsf/spi/deployment/");
+ assertNotNull(deployment);
+ assertTrue(deployment.toURL().toExternalForm().contains("jar!")); //check we got a URL to a jar
+ assertEquals("deployment/", deployment.getName());
+ List<UnifiedVirtualFile> children = deployment.getChildren();
+ assertNotNull(children);
+ assertTrue(children.size() > 0);
+ UnifiedVirtualFile unifiedVirtualFile = null;
+ UnifiedVirtualFile integration = null;
+ for (UnifiedVirtualFile uvf : children)
+ {
+ if (uvf.getName().equals(UnifiedVirtualFile.class.getSimpleName() + ".class"))
+ unifiedVirtualFile = uvf;
+ else if (uvf.getName().equals("integration/"))
+ integration = uvf;
+ }
+ assertNotNull(unifiedVirtualFile);
+ assertNotNull(integration);
+ assertTrue(unifiedVirtualFile.getChildren().size() == 0);
+ }
+
+ public void testWithDir() throws Exception
+ {
+ //Getting the classloader for ResourceLoaderAdapter which lives in COMMON -> target/classes in this project
+ ClassLoader cl = ResourceLoaderAdapter.class.getClassLoader();
+ ResourceLoaderAdapter ula = new ResourceLoaderAdapter(cl);
+
+ UnifiedVirtualFile common = ula.findChild("org/jboss/wsf/common/");
+ assertNotNull(common);
+ assertTrue(common.toURL().toExternalForm().contains("target" + File.separator + "classes")); //check we got a URL to dir
+ assertEquals("common/", common.getName());
+ List<UnifiedVirtualFile> children = common.getChildren();
+ assertNotNull(children);
+ assertTrue(children.size() > 0);
+ UnifiedVirtualFile resourceLoaderAdapter = null;
+ UnifiedVirtualFile utils = null;
+ for (UnifiedVirtualFile uvf : children)
+ {
+ if (uvf.getName().equals(ResourceLoaderAdapter.class.getSimpleName() + ".class"))
+ resourceLoaderAdapter = uvf;
+ else if (uvf.getName().equals("utils/"))
+ utils = uvf;
+ }
+ assertNotNull(resourceLoaderAdapter);
+ assertNotNull(utils);
+ assertTrue(resourceLoaderAdapter.getChildren().size() == 0);
+ }
+}
Property changes on: common/trunk/src/test/java/org/jboss/test/ws/common/ResourceLoaderAdapterTestCase.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: common/trunk/src/test/java/org/jboss/test/ws/common/URLLoaderAdapterTestCase.java
===================================================================
--- common/trunk/src/test/java/org/jboss/test/ws/common/URLLoaderAdapterTestCase.java (rev 0)
+++ common/trunk/src/test/java/org/jboss/test/ws/common/URLLoaderAdapterTestCase.java 2008-10-30 19:40:43 UTC (rev 8602)
@@ -0,0 +1,104 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.common;
+
+import java.io.File;
+import java.net.URL;
+import java.util.List;
+
+import junit.framework.TestCase;
+
+import org.jboss.wsf.common.URLLoaderAdapter;
+import org.jboss.wsf.spi.deployment.UnifiedVirtualFile;
+
+/**
+ * Test the URLLoaderAdapter
+ *
+ * @author alessio.soldano(a)jboss.org
+ * @since 30-Oct-2008
+ */
+public class URLLoaderAdapterTestCase extends TestCase
+{
+ public void testWithJar() throws Exception
+ {
+ //Getting the SPI jar url
+ ClassLoader cl = UnifiedVirtualFile.class.getClassLoader();
+ URL rootURL = getJarUrl(cl.getResource("org/jboss/wsf/spi/"));
+ assertNotNull(rootURL);
+ URLLoaderAdapter ula = new URLLoaderAdapter(rootURL);
+
+ UnifiedVirtualFile deployment = ula.findChild("org/jboss/wsf/spi/deployment/");
+ assertNotNull(deployment);
+ assertTrue(deployment.toURL().toExternalForm().contains("jar!")); //check we got a URL to a jar
+ assertEquals("deployment/", deployment.getName());
+ List<UnifiedVirtualFile> children = deployment.getChildren();
+ assertNotNull(children);
+ assertTrue(children.size() > 0);
+ UnifiedVirtualFile unifiedVirtualFile = null;
+ UnifiedVirtualFile integration = null;
+ for (UnifiedVirtualFile uvf : children)
+ {
+ if (uvf.getName().equals(UnifiedVirtualFile.class.getSimpleName() + ".class"))
+ unifiedVirtualFile = uvf;
+ else if (uvf.getName().equals("integration/"))
+ integration = uvf;
+ }
+ assertNotNull(unifiedVirtualFile);
+ assertNotNull(integration);
+ assertTrue(unifiedVirtualFile.getChildren().size() == 0);
+ }
+
+ public void testWithDir() throws Exception
+ {
+ ClassLoader cl = UnifiedVirtualFile.class.getClassLoader();
+ URL rootURL = cl.getResource("org/jboss/wsf/common/");
+ assertNotNull(rootURL);
+ URLLoaderAdapter ula = new URLLoaderAdapter(rootURL);
+
+ UnifiedVirtualFile common = ula.findChild("org/jboss/wsf/common/");
+ assertNotNull(common);
+ assertTrue(common.toURL().toExternalForm().contains("target" + File.separator + "classes")); //check we got a URL to dir
+ assertEquals("common/", common.getName());
+ List<UnifiedVirtualFile> children = common.getChildren();
+ assertNotNull(children);
+ assertTrue(children.size() > 0);
+ UnifiedVirtualFile urlLoaderAdapter = null;
+ UnifiedVirtualFile utils = null;
+ for (UnifiedVirtualFile uvf : children)
+ {
+ if (uvf.getName().equals(URLLoaderAdapter.class.getSimpleName() + ".class"))
+ urlLoaderAdapter = uvf;
+ else if (uvf.getName().equals("utils/"))
+ utils = uvf;
+ }
+ assertNotNull(urlLoaderAdapter);
+ assertNotNull(utils);
+ assertTrue(urlLoaderAdapter.getChildren().size() == 0);
+ }
+
+ private static URL getJarUrl(URL url) throws Exception
+ {
+ String urlString = url.toExternalForm();
+ String jarRoot = urlString.substring(4, urlString.indexOf("ar!") + 2);
+ return new URL(jarRoot);
+ }
+}
Property changes on: common/trunk/src/test/java/org/jboss/test/ws/common/URLLoaderAdapterTestCase.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
16 years, 1 month