Package org.apache.thrift.async

Source Code of org.apache.thrift.async.TestTAsyncClient

package org.apache.thrift.async;

import junit.framework.TestCase;

import org.apache.thrift.TException;

import thrift.test.Srv;
import thrift.test.Srv.AsyncClient;

public class TestTAsyncClient extends TestCase {
  public void testRaisesExceptionWhenUsedConcurrently() throws Exception {
    TAsyncClientManager mockClientManager = new TAsyncClientManager() {
      @Override
      public void call(TAsyncMethodCall method) throws TException {
        // do nothing
      }
    };

    Srv.AsyncClient c = new AsyncClient(null, mockClientManager, null);
    c.Janky(0, null);
    try {
      c.checkReady();
      fail("should have hit an exception");
    } catch (Exception e) {
      // awesome
    }
  }
}
TOP

Related Classes of org.apache.thrift.async.TestTAsyncClient

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.