Re: Need help Re: jenkins interop test failing due to PROTON-215 commits?

2013-02-28 Thread Alan Conway

On 02/28/2013 09:49 AM, Alan Conway wrote:

On 02/27/2013 06:31 PM, Keith W wrote:

On 27 February 2013 22:28, Alan Conway acon...@redhat.com wrote:

On Wed, 2013-02-27 at 11:19 +, Phil Harvey wrote:

Hi,

I notice that proton-jni on Jenkins is failing [1] , probably due to the
recent PROTON-215 commits.


[snip]


I've committed a fix, but with a horrible hack:


r1451329 | aconway | 2013-02-28 15:32:31 -0500 (Thu, 28 Feb 2013) | 8 lines

PROTON-215: Fix python test error introduced by previous commits.

In interop.py, after decoding a message, Message.body is of type 'str' under
plain Python or proton-j Jython, but under proton-jni Jython it is a
type 'org.apache.qpid.proton.amqp.Binary'

Check the type and extract the Binary's data as a str if necessary.



The hack is:

body = self.message.body
if str(type(body)) == type 'org.apache.qpid.proton.amqp.Binary':
body = body.array.tostring()
self.decode_data(body)

So is this a bug in JNI Jython that it behaves differently from the other cases?
Or is there another, portable way to extract data from a decoded message that I 
should be using?


Soon as I know I will make it right.

Cheers,
Alan.


Need help Re: jenkins interop test failing due to PROTON-215 commits?

2013-02-27 Thread Alan Conway
On Wed, 2013-02-27 at 11:19 +, Phil Harvey wrote:
 Hi,
 
 I notice that proton-jni on Jenkins is failing [1] , probably due to the
 recent PROTON-215 commits.
 
 The failing test is:
 proton_tests.interop.InteropTest.test_messagehttps://builds.apache.org/view/M-R/view/Qpid/job/Qpid-proton-jni/org.apache.qpid$tests/35/testReport/junit/proton_tests.interop/InteropTest/test_message/
 
 Is someone already looking into this?

Regarding:
https://builds.apache.org/view/M-R/view/Qpid/job/Qpid-proton-jni/org.apache.qpid$tests/37/

I need some help with the JNI code to figure this out. 

I can't reproduce the problem on my fedora box. Can we get information
about the jenkins build system, e.g. version of Java and Python
involved?

Here's a summary of what I think  happens, this is running the
interop.py tests in Jython:

  m = proton.Message()
  d = Proton.Data()
  m.decode(an amqp message read from a file.)
  d.decode(body)
  BANG

We blow up with: TypeError: wrap(): 1st arg can't be coerced to byte[]

This is in python class proton.Data
 
  def decode(self, encoded):
return self._data.decode(ByteBuffer.wrap(encoded))

So it appears that a python Message.body is somehow set to something
that cannot be coerced to byte[]. So I look at JNIMessage.getBody() and
I see it returns a Section. A Section is an empty interface. Huh??

Can someone explain the relationship between a JNI python message body
and this Section interface, and how it is supposed to be converted?

Cheers,
Alan.




Re: Need help Re: jenkins interop test failing due to PROTON-215 commits?

2013-02-27 Thread Rob Godfrey
On 27 February 2013 23:28, Alan Conway acon...@redhat.com wrote:
 On Wed, 2013-02-27 at 11:19 +, Phil Harvey wrote:
 Hi,

 I notice that proton-jni on Jenkins is failing [1] , probably due to the
 recent PROTON-215 commits.

 The failing test is:
 proton_tests.interop.InteropTest.test_messagehttps://builds.apache.org/view/M-R/view/Qpid/job/Qpid-proton-jni/org.apache.qpid$tests/35/testReport/junit/proton_tests.interop/InteropTest/test_message/

 Is someone already looking into this?

 Regarding:
 https://builds.apache.org/view/M-R/view/Qpid/job/Qpid-proton-jni/org.apache.qpid$tests/37/

 I need some help with the JNI code to figure this out.

 I can't reproduce the problem on my fedora box. Can we get information
 about the jenkins build system, e.g. version of Java and Python
 involved?

 Here's a summary of what I think  happens, this is running the
 interop.py tests in Jython:

   m = proton.Message()
   d = Proton.Data()
   m.decode(an amqp message read from a file.)
   d.decode(body)
   BANG

 We blow up with: TypeError: wrap(): 1st arg can't be coerced to byte[]

 This is in python class proton.Data

   def decode(self, encoded):
 return self._data.decode(ByteBuffer.wrap(encoded))

 So it appears that a python Message.body is somehow set to something
 that cannot be coerced to byte[]. So I look at JNIMessage.getBody() and
 I see it returns a Section. A Section is an empty interface. Huh??

 Can someone explain the relationship between a JNI python message body
 and this Section interface, and how it is supposed to be converted?

 Cheers,
 Alan.

So, the Java API more closely matches the AMQP spec than the C API
here... An AMQP Message consists of a number of sections.  The body
may be a Data section, an AmqpValue section or an AmqpSequence
section. So in the Java API getBody() returns a Section object that
may be one of these three types.

-- Rob





Re: Need help Re: jenkins interop test failing due to PROTON-215 commits?

2013-02-27 Thread Keith W
On 27 February 2013 22:28, Alan Conway acon...@redhat.com wrote:
 On Wed, 2013-02-27 at 11:19 +, Phil Harvey wrote:
 Hi,

 I notice that proton-jni on Jenkins is failing [1] , probably due to the
 recent PROTON-215 commits.

 The failing test is:
 proton_tests.interop.InteropTest.test_messagehttps://builds.apache.org/view/M-R/view/Qpid/job/Qpid-proton-jni/org.apache.qpid$tests/35/testReport/junit/proton_tests.interop/InteropTest/test_message/

 Is someone already looking into this?

 Regarding:
 https://builds.apache.org/view/M-R/view/Qpid/job/Qpid-proton-jni/org.apache.qpid$tests/37/

 I need some help with the JNI code to figure this out.

 I can't reproduce the problem on my fedora box.

I'm reproducing using command:

mvn test -Pproton-jni
-Dproton.pythontest.pattern=proton_tests.interop.InteropTest.test_message

 Can we get information
 about the jenkins build system, e.g. version of Java and Python
 involved?

You can see all the output of the build (cmake, make etc) by following
the Console Output link in the Jenkins job view. This includes the
versions numbers you have asked for.

https://builds.apache.org/view/M-R/view/Qpid/job/Qpid-proton-jni/37/console

-- Found SWIG: /usr/bin/swig2.0 (found version 2.0.4)
-- Found PythonLibs: /usr/lib/libpython2.7.so
-- Found Ruby: /usr/bin/ruby (found version 1.8.7)
-- Found Perl: /usr/bin/perl
-- Could NOT find PerlLibs (missing:  PERL_LIBRARY) (found version 5.14.2)
-- Found JNI: /usr/lib/jvm/java-6-openjdk-amd64/jre/lib/amd64/libjawt.so
-- Found PythonInterp: /usr/bin/python (found version 2.7.3)

(I'm also seeing the test fail on Redhat Tikanga with Oracle JDK
1.6.0_39, and on Mac OS X with JDK 1.6.0_37 both with Python 2.7)


 Here's a summary of what I think  happens, this is running the
 interop.py tests in Jython:

   m = proton.Message()
   d = Proton.Data()
   m.decode(an amqp message read from a file.)
   d.decode(body)
   BANG

 We blow up with: TypeError: wrap(): 1st arg can't be coerced to byte[]

 This is in python class proton.Data

   def decode(self, encoded):
 return self._data.decode(ByteBuffer.wrap(encoded))

 So it appears that a python Message.body is somehow set to something
 that cannot be coerced to byte[]. So I look at JNIMessage.getBody() and
 I see it returns a Section. A Section is an empty interface. Huh??

JNIMessage.decodeBody() method that determines the concrete type of
the object returned by getBody().   Adding a couple of
System.out.println(); to this method I see:

proton_tests.interop.InteropTest.test_message ...
in decodeBody()
dataType : BINARY notAmqpValue : false
body is AmqpValue{\xa1\x05hello}
 fail

so _body is of type org.apache.qpid.proton.amqp.messaging.AmqpValue

Hope this helps


 Can someone explain the relationship between a JNI python message body
 and this Section interface, and how it is supposed to be converted?

 Cheers,
 Alan.