On 27 February 2013 22:28, Alan Conway <[email protected]> wrote: > On Wed, 2013-02-27 at 11:19 +0000, 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_message<https://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. > >
