Thanks, Roger.  We've been struggling a bit trying to get these tests
working.  I'm on CentOS5.  Got phantomjs installed, and a newer version of
ant, but don't yet have all of the java stuff set up.  If there is a good
HOWTO, or a linux distro that is particularly well-suited to thrift dev,
please let me know!

The context of this work is, we're preparing a PHP port of TJSONProtocol.
 Here's how we've been testing it "super-manually"

1. thrift -r --gen js:jquery ThriftTest.thrift

to generate the client code

2. thrift -r --gen php:server ThriftTest.thrift

to generate the server code.  Requires patch posted as THRIFT-1479.

3. Create PHP script to function as the server endpoint to wire up the
generated ThriftTestProcessor via the new protocol implementation.

4. Modify test.html to hit the new PHP script, instead of the java server.

5. Load test.html in a browser and load to run tests.

Though not automated, this method has proved useful for testing out our new
code.

Are we missing any steps here?

Thanks!
Andrew



On Fri, Dec 23, 2011 at 2:01 AM, Roger Meier <ro...@bufferoverflow.ch>wrote:

> Yes!
>
> Or just use the integrated testsuite:
>
> lib/js/test$ ant testserver
> for manual test
>
> and
> lib/js/test$ ant test
> with phantomjs
>
> -roger
>
> > -----Ursprüngliche Nachricht-----
> > Von: Andrew Grumet [mailto:aegru...@gmail.com]
> > Gesendet: Freitag, 23. Dezember 2011 10:30
> > An: dev@thrift.apache.org
> > Betreff: Re: Javascript Async tests
> >
> > Ok, answering my own question for future searches.   Callback support
> > requires the jquery option
> >
> > thrift -r --gen js:jquery ThriftTest.thrift
> >
> >
> > On Thu, Dec 22, 2011 at 4:48 PM, Andrew Grumet <aegru...@gmail.com>
> > wrote:
> >
> > >
> > > We're running some tests of the Javascript client
> > > (lib/js/test/test.js) and noticed that the Async tests (
> module("Async")
> ) do
> > not appear to be
> > > running the supplied callbacks.   For example, in this block
> > >
> > >   test("Double", function() {
> > >     expect( 1 );
> > >
> > >     QUnit.stop();
> > >     client.testDouble(3.14159265, function(result) {
> > >       equals(result, 3.14159265);
> > >       QUnit.start();
> > >     });
> > >   });
> > >
> > > the second argument to client.testDouble is not executed.  We can see
> > > the network call and response, and the synchronous call to
> > > client.testDouble passes.
> > >
> > > Checking the generated client code, we don't see evidence of support
> > > for this async mode.  Should it work?
> > >
> > > Andrew
> > >
> > >
> > >
> > >
> > >
>
>

Reply via email to