You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commons-dev@ws.apache.org by ve...@apache.org on 2009/02/01 12:22:43 UTC

svn commit: r739741 - in /webservices/commons/trunk/modules/tcpmon/modules: tcpmon-core/src/main/java/org/apache/ws/commons/tcpmon/core/ tcpmon-eclipse-plugin/src/main/java/org/apache/ws/commons/tcpmon/eclipse/ui/ tcpmon-ui/src/main/java/org/apache/ws/...

Author: veithen
Date: Sun Feb  1 11:22:39 2009
New Revision: 739741

URL: http://svn.apache.org/viewvc?rev=739741&view=rev
Log:
Moved the proxy configuration code to a better place.

Modified:
    webservices/commons/trunk/modules/tcpmon/modules/tcpmon-core/src/main/java/org/apache/ws/commons/tcpmon/core/Configuration.java
    webservices/commons/trunk/modules/tcpmon/modules/tcpmon-core/src/main/java/org/apache/ws/commons/tcpmon/core/Connection.java
    webservices/commons/trunk/modules/tcpmon/modules/tcpmon-eclipse-plugin/src/main/java/org/apache/ws/commons/tcpmon/eclipse/ui/Listener.java
    webservices/commons/trunk/modules/tcpmon/modules/tcpmon-ui/src/main/java/org/apache/ws/commons/tcpmon/Listener.java

Modified: webservices/commons/trunk/modules/tcpmon/modules/tcpmon-core/src/main/java/org/apache/ws/commons/tcpmon/core/Configuration.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/tcpmon/modules/tcpmon-core/src/main/java/org/apache/ws/commons/tcpmon/core/Configuration.java?rev=739741&r1=739740&r2=739741&view=diff
==============================================================================
--- webservices/commons/trunk/modules/tcpmon/modules/tcpmon-core/src/main/java/org/apache/ws/commons/tcpmon/core/Configuration.java (original)
+++ webservices/commons/trunk/modules/tcpmon/modules/tcpmon-core/src/main/java/org/apache/ws/commons/tcpmon/core/Configuration.java Sun Feb  1 11:22:39 2009
@@ -28,6 +28,21 @@
     private int httpProxyPort;
     private SlowLinkSimulator slowLink;
     
+    public void configProxyFromSystemProperties() {
+        String host = System.getProperty("http.proxyHost");
+        if (host != null && host.length() > 0) {
+            httpProxyHost = host;
+            String port = System.getProperty("http.proxyPort");
+            if (port != null && port.length() > 0) {
+                httpProxyPort = Integer.parseInt(port);
+            } else {
+                httpProxyPort = 80;
+            }
+        } else {
+            httpProxyHost = null;
+        }
+    }
+    
     public int getListenPort() {
         return listenPort;
     }

Modified: webservices/commons/trunk/modules/tcpmon/modules/tcpmon-core/src/main/java/org/apache/ws/commons/tcpmon/core/Connection.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/tcpmon/modules/tcpmon-core/src/main/java/org/apache/ws/commons/tcpmon/core/Connection.java?rev=739741&r1=739740&r2=739741&view=diff
==============================================================================
--- webservices/commons/trunk/modules/tcpmon/modules/tcpmon-core/src/main/java/org/apache/ws/commons/tcpmon/core/Connection.java (original)
+++ webservices/commons/trunk/modules/tcpmon/modules/tcpmon-core/src/main/java/org/apache/ws/commons/tcpmon/core/Connection.java Sun Feb  1 11:22:39 2009
@@ -101,23 +101,6 @@
             active = true;
             String HTTPProxyHost = config.getHttpProxyHost();
             int HTTPProxyPort = config.getHttpProxyPort();
-            if (HTTPProxyHost == null) {
-                HTTPProxyHost = System.getProperty("http.proxyHost");
-                if ((HTTPProxyHost != null) && HTTPProxyHost.equals("")) {
-                    HTTPProxyHost = null;
-                }
-                if (HTTPProxyHost != null) {
-                    String tmp = System.getProperty("http.proxyPort");
-                    if ((tmp != null) && tmp.equals("")) {
-                        tmp = null;
-                    }
-                    if (tmp == null) {
-                        HTTPProxyPort = 80;
-                    } else {
-                        HTTPProxyPort = Integer.parseInt(tmp);
-                    }
-                }
-            }
             String fromHost;
             if (inSocket != null) {
                 fromHost = (inSocket.getInetAddress()).getHostName();

Modified: webservices/commons/trunk/modules/tcpmon/modules/tcpmon-eclipse-plugin/src/main/java/org/apache/ws/commons/tcpmon/eclipse/ui/Listener.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/tcpmon/modules/tcpmon-eclipse-plugin/src/main/java/org/apache/ws/commons/tcpmon/eclipse/ui/Listener.java?rev=739741&r1=739740&r2=739741&view=diff
==============================================================================
--- webservices/commons/trunk/modules/tcpmon/modules/tcpmon-eclipse-plugin/src/main/java/org/apache/ws/commons/tcpmon/eclipse/ui/Listener.java (original)
+++ webservices/commons/trunk/modules/tcpmon/modules/tcpmon-eclipse-plugin/src/main/java/org/apache/ws/commons/tcpmon/eclipse/ui/Listener.java Sun Feb  1 11:22:39 2009
@@ -617,8 +617,12 @@
                 config.setXmlFormat(xmlFormatBox.getSelection());
             }
         });
-        config.setHttpProxyHost(HTTPProxyHost);
-        config.setHttpProxyPort(HTTPProxyPort);
+        if (HTTPProxyHost == null) {
+            config.configProxyFromSystemProperties();
+        } else {
+            config.setHttpProxyHost(HTTPProxyHost);
+            config.setHttpProxyPort(HTTPProxyPort);
+        }
         config.setSlowLink(slowLink);
         return config;
     }

Modified: webservices/commons/trunk/modules/tcpmon/modules/tcpmon-ui/src/main/java/org/apache/ws/commons/tcpmon/Listener.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/tcpmon/modules/tcpmon-ui/src/main/java/org/apache/ws/commons/tcpmon/Listener.java?rev=739741&r1=739740&r2=739741&view=diff
==============================================================================
--- webservices/commons/trunk/modules/tcpmon/modules/tcpmon-ui/src/main/java/org/apache/ws/commons/tcpmon/Listener.java (original)
+++ webservices/commons/trunk/modules/tcpmon/modules/tcpmon-ui/src/main/java/org/apache/ws/commons/tcpmon/Listener.java Sun Feb  1 11:22:39 2009
@@ -594,8 +594,12 @@
         config.setTargetPort(Integer.parseInt(tPortField.getText()));
         config.setProxy(isProxyBox.isSelected());
         config.setXmlFormat(xmlFormatBox.isSelected());
-        config.setHttpProxyHost(HTTPProxyHost);
-        config.setHttpProxyPort(HTTPProxyPort);
+        if (HTTPProxyHost == null) {
+            config.configProxyFromSystemProperties();
+        } else {
+            config.setHttpProxyHost(HTTPProxyHost);
+            config.setHttpProxyPort(HTTPProxyPort);
+        }
         config.setSlowLink(slowLink);
         return config;
     }



Re: Markup from annotations not returned with XmlSchema 1.4.3

Posted by Benson Margulies <bi...@gmail.com>.
THanks, I'll look at this tonight.

On Wed, Feb 4, 2009 at 1:20 PM, Fady Moussallam <fa...@legsem.com> wrote:

> I have opened WSCOMMONS-436 and attached simple tests.
>
> I was incorrect in the second issue mentioned. Once the source attribute is
> added, the markup is complete.
>
> Thanks for your help.
>
> Fady
>
> -----Message d'origine-----
> De : Benson Margulies [mailto:bimargulies@gmail.com]
> Envoyé : mercredi 4 février 2009 16:56
> À : commons-dev@ws.apache.org
> Objet : Re: Markup from annotations not returned with XmlSchema 1.4.3
>
> Looks like you found a bug. I don't suppose you could contribute a unit
> test
> that fails as a result of this? Please open a JIRA in any case, and I'll
> look to make a fix.
>
> On Wed, Feb 4, 2009 at 10:53 AM, Andreas Veithen
> <an...@gmail.com>wrote:
>
> > Can you open a JIRA issue for this problem?
> >
> > Andreas
> >
> > On Wed, Feb 4, 2009 at 09:21, Fady Moussallam <fa...@legsem.com> wrote:
> > > Hello,
> > >
> > > I am seeing a regression between the previous version of XmlSchema I
> was
> > using (1.4) and the latest (1.4.3).
> > >
> > > I have an XML schema where the schema element has these annotations:
> > >
> > > <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
> > > targetNamespace="http://legstar.com/test/coxb/lsfileae"
> > > xmlns="http://legstar.com/test/coxb/lsfileae"
> > > xmlns:xsns="http://legstar.com/test/coxb/lsfileae"
> > > xmlns:cb="http://www.legsem.com/xml/ns/coxb"
> > > xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
> > > jaxb:version="2.0"
> > > jaxb:extensionBindingPrefixes="cb"
> > > elementFormDefault="qualified">
> > >  <xs:annotation><xs:appinfo>
> > >  <jaxb:schemaBindings>
> > >  <jaxb:package  name="com.legstar.test.coxb.lsfileae"/>
> > >  </jaxb:schemaBindings>
> > >  </xs:appinfo></xs:annotation>
> > >
> > > On return from reading the file, the XmlSchema has an
> XmlSchemaAnnotation
> > but with no content.
> > >
> > > This is due to this code in SchemaBuilder#handleAppInfo(Element
> content):
> > >
> > >                if (!content.hasAttribute("source")) {
> > >                        return null;
> > >                }
> > >
> > > This pretty much forces the appinfo element to hold a source attribute.
> > But I don't believe the source attribute is mandatory. In 1.4, the code
> was
> > like this:
> > >
> > >                if (!content.hasAttribute("source")
> > >                                && (markup == null || markup.getLength()
> > <= 0)) {
> > >                        return null;
> > >                }
> > >
> > > This is not the only issue. Even if I set a source attribute, I still
> > don't get the markup completely. This is due to the fact that you
> replaced
> > this code from 1.4:
> > >
> > >            NodeList markup = getChildren(content);
> > >
> > > With this code (1.4.3):
> > >
> > >            NodeList markup = new DocumentFragmentNodeList(content);
> > >
> > > The issue is that DocumentFragmentNodeList doesn't process the appinfo
> > children recursively, it just processes direct children of appinfo. In my
> > case, the markup would contain jaxb:schemaBindings but not jaxb:package.
> > >
> > > Any ideas or advice would be greatly appreciated.
> > >
> > > Fady
> > >
> > >
> > >
> > >
> > >
> > >
> >
>
>

RE: Markup from annotations not returned with XmlSchema 1.4.3

Posted by Fady Moussallam <fa...@legsem.com>.
I have opened WSCOMMONS-436 and attached simple tests.

I was incorrect in the second issue mentioned. Once the source attribute is added, the markup is complete.

Thanks for your help.

Fady

-----Message d'origine-----
De : Benson Margulies [mailto:bimargulies@gmail.com] 
Envoyé : mercredi 4 février 2009 16:56
À : commons-dev@ws.apache.org
Objet : Re: Markup from annotations not returned with XmlSchema 1.4.3

Looks like you found a bug. I don't suppose you could contribute a unit test
that fails as a result of this? Please open a JIRA in any case, and I'll
look to make a fix.

On Wed, Feb 4, 2009 at 10:53 AM, Andreas Veithen
<an...@gmail.com>wrote:

> Can you open a JIRA issue for this problem?
>
> Andreas
>
> On Wed, Feb 4, 2009 at 09:21, Fady Moussallam <fa...@legsem.com> wrote:
> > Hello,
> >
> > I am seeing a regression between the previous version of XmlSchema I was
> using (1.4) and the latest (1.4.3).
> >
> > I have an XML schema where the schema element has these annotations:
> >
> > <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
> > targetNamespace="http://legstar.com/test/coxb/lsfileae"
> > xmlns="http://legstar.com/test/coxb/lsfileae"
> > xmlns:xsns="http://legstar.com/test/coxb/lsfileae"
> > xmlns:cb="http://www.legsem.com/xml/ns/coxb"
> > xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
> > jaxb:version="2.0"
> > jaxb:extensionBindingPrefixes="cb"
> > elementFormDefault="qualified">
> >  <xs:annotation><xs:appinfo>
> >  <jaxb:schemaBindings>
> >  <jaxb:package  name="com.legstar.test.coxb.lsfileae"/>
> >  </jaxb:schemaBindings>
> >  </xs:appinfo></xs:annotation>
> >
> > On return from reading the file, the XmlSchema has an XmlSchemaAnnotation
> but with no content.
> >
> > This is due to this code in SchemaBuilder#handleAppInfo(Element content):
> >
> >                if (!content.hasAttribute("source")) {
> >                        return null;
> >                }
> >
> > This pretty much forces the appinfo element to hold a source attribute.
> But I don't believe the source attribute is mandatory. In 1.4, the code was
> like this:
> >
> >                if (!content.hasAttribute("source")
> >                                && (markup == null || markup.getLength()
> <= 0)) {
> >                        return null;
> >                }
> >
> > This is not the only issue. Even if I set a source attribute, I still
> don't get the markup completely. This is due to the fact that you replaced
> this code from 1.4:
> >
> >            NodeList markup = getChildren(content);
> >
> > With this code (1.4.3):
> >
> >            NodeList markup = new DocumentFragmentNodeList(content);
> >
> > The issue is that DocumentFragmentNodeList doesn't process the appinfo
> children recursively, it just processes direct children of appinfo. In my
> case, the markup would contain jaxb:schemaBindings but not jaxb:package.
> >
> > Any ideas or advice would be greatly appreciated.
> >
> > Fady
> >
> >
> >
> >
> >
> >
>


Re: Markup from annotations not returned with XmlSchema 1.4.3

Posted by Benson Margulies <bi...@gmail.com>.
Looks like you found a bug. I don't suppose you could contribute a unit test
that fails as a result of this? Please open a JIRA in any case, and I'll
look to make a fix.

On Wed, Feb 4, 2009 at 10:53 AM, Andreas Veithen
<an...@gmail.com>wrote:

> Can you open a JIRA issue for this problem?
>
> Andreas
>
> On Wed, Feb 4, 2009 at 09:21, Fady Moussallam <fa...@legsem.com> wrote:
> > Hello,
> >
> > I am seeing a regression between the previous version of XmlSchema I was
> using (1.4) and the latest (1.4.3).
> >
> > I have an XML schema where the schema element has these annotations:
> >
> > <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
> > targetNamespace="http://legstar.com/test/coxb/lsfileae"
> > xmlns="http://legstar.com/test/coxb/lsfileae"
> > xmlns:xsns="http://legstar.com/test/coxb/lsfileae"
> > xmlns:cb="http://www.legsem.com/xml/ns/coxb"
> > xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
> > jaxb:version="2.0"
> > jaxb:extensionBindingPrefixes="cb"
> > elementFormDefault="qualified">
> >  <xs:annotation><xs:appinfo>
> >  <jaxb:schemaBindings>
> >  <jaxb:package  name="com.legstar.test.coxb.lsfileae"/>
> >  </jaxb:schemaBindings>
> >  </xs:appinfo></xs:annotation>
> >
> > On return from reading the file, the XmlSchema has an XmlSchemaAnnotation
> but with no content.
> >
> > This is due to this code in SchemaBuilder#handleAppInfo(Element content):
> >
> >                if (!content.hasAttribute("source")) {
> >                        return null;
> >                }
> >
> > This pretty much forces the appinfo element to hold a source attribute.
> But I don't believe the source attribute is mandatory. In 1.4, the code was
> like this:
> >
> >                if (!content.hasAttribute("source")
> >                                && (markup == null || markup.getLength()
> <= 0)) {
> >                        return null;
> >                }
> >
> > This is not the only issue. Even if I set a source attribute, I still
> don't get the markup completely. This is due to the fact that you replaced
> this code from 1.4:
> >
> >            NodeList markup = getChildren(content);
> >
> > With this code (1.4.3):
> >
> >            NodeList markup = new DocumentFragmentNodeList(content);
> >
> > The issue is that DocumentFragmentNodeList doesn't process the appinfo
> children recursively, it just processes direct children of appinfo. In my
> case, the markup would contain jaxb:schemaBindings but not jaxb:package.
> >
> > Any ideas or advice would be greatly appreciated.
> >
> > Fady
> >
> >
> >
> >
> >
> >
>

Re: Markup from annotations not returned with XmlSchema 1.4.3

Posted by Andreas Veithen <an...@gmail.com>.
Can you open a JIRA issue for this problem?

Andreas

On Wed, Feb 4, 2009 at 09:21, Fady Moussallam <fa...@legsem.com> wrote:
> Hello,
>
> I am seeing a regression between the previous version of XmlSchema I was using (1.4) and the latest (1.4.3).
>
> I have an XML schema where the schema element has these annotations:
>
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
> targetNamespace="http://legstar.com/test/coxb/lsfileae"
> xmlns="http://legstar.com/test/coxb/lsfileae"
> xmlns:xsns="http://legstar.com/test/coxb/lsfileae"
> xmlns:cb="http://www.legsem.com/xml/ns/coxb"
> xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
> jaxb:version="2.0"
> jaxb:extensionBindingPrefixes="cb"
> elementFormDefault="qualified">
>  <xs:annotation><xs:appinfo>
>  <jaxb:schemaBindings>
>  <jaxb:package  name="com.legstar.test.coxb.lsfileae"/>
>  </jaxb:schemaBindings>
>  </xs:appinfo></xs:annotation>
>
> On return from reading the file, the XmlSchema has an XmlSchemaAnnotation but with no content.
>
> This is due to this code in SchemaBuilder#handleAppInfo(Element content):
>
>                if (!content.hasAttribute("source")) {
>                        return null;
>                }
>
> This pretty much forces the appinfo element to hold a source attribute. But I don't believe the source attribute is mandatory. In 1.4, the code was like this:
>
>                if (!content.hasAttribute("source")
>                                && (markup == null || markup.getLength() <= 0)) {
>                        return null;
>                }
>
> This is not the only issue. Even if I set a source attribute, I still don't get the markup completely. This is due to the fact that you replaced this code from 1.4:
>
>            NodeList markup = getChildren(content);
>
> With this code (1.4.3):
>
>            NodeList markup = new DocumentFragmentNodeList(content);
>
> The issue is that DocumentFragmentNodeList doesn't process the appinfo children recursively, it just processes direct children of appinfo. In my case, the markup would contain jaxb:schemaBindings but not jaxb:package.
>
> Any ideas or advice would be greatly appreciated.
>
> Fady
>
>
>
>
>
>

Markup from annotations not returned with XmlSchema 1.4.3

Posted by Fady Moussallam <fa...@legsem.com>.
Hello,

I am seeing a regression between the previous version of XmlSchema I was using (1.4) and the latest (1.4.3).

I have an XML schema where the schema element has these annotations:

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://legstar.com/test/coxb/lsfileae"
xmlns="http://legstar.com/test/coxb/lsfileae"
xmlns:xsns="http://legstar.com/test/coxb/lsfileae"
xmlns:cb="http://www.legsem.com/xml/ns/coxb"
xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
jaxb:version="2.0"
jaxb:extensionBindingPrefixes="cb"
elementFormDefault="qualified">
 <xs:annotation><xs:appinfo>
 <jaxb:schemaBindings>
 <jaxb:package  name="com.legstar.test.coxb.lsfileae"/>
 </jaxb:schemaBindings>
 </xs:appinfo></xs:annotation>

On return from reading the file, the XmlSchema has an XmlSchemaAnnotation but with no content.

This is due to this code in SchemaBuilder#handleAppInfo(Element content):

		if (!content.hasAttribute("source")) {
			return null;
		}
 
This pretty much forces the appinfo element to hold a source attribute. But I don't believe the source attribute is mandatory. In 1.4, the code was like this:

		if (!content.hasAttribute("source")
				&& (markup == null || markup.getLength() <= 0)) {
			return null;
		}

This is not the only issue. Even if I set a source attribute, I still don't get the markup completely. This is due to the fact that you replaced this code from 1.4:

            NodeList markup = getChildren(content);

With this code (1.4.3):

            NodeList markup = new DocumentFragmentNodeList(content);

The issue is that DocumentFragmentNodeList doesn't process the appinfo children recursively, it just processes direct children of appinfo. In my case, the markup would contain jaxb:schemaBindings but not jaxb:package.

Any ideas or advice would be greatly appreciated.

Fady