Subversion Repositories SmartDukaan

Rev

Rev 1946 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1946 chandransh 1
package in.shop2020.payment.service;
2
 
3
import in.shop2020.payments.PaymentException;
4
import in.shop2020.payments.PaymentService.Client;
5
 
6
import org.apache.thrift.TException;
7
import org.apache.thrift.protocol.TBinaryProtocol;
8
import org.apache.thrift.protocol.TProtocol;
9
import org.apache.thrift.transport.TFramedTransport;
10
import org.apache.thrift.transport.TSocket;
11
import org.apache.thrift.transport.TTransport;
12
import org.apache.thrift.transport.TTransportException;
13
 
14
public class TestPaymentServer {
15
	private static final int SOCKET_TIMEOUT = 1000 * 60 * 5;
16
 
17
	public static void main(String[] args){
18
		TSocket socket = new TSocket("localhost", 9012);
19
		socket.setTimeout(SOCKET_TIMEOUT);
20
 
21
		TTransport transport = new TFramedTransport(socket);
22
		TProtocol protocol = new TBinaryProtocol(transport);
23
		Client client = new Client(protocol);
24
		try {
25
			transport.open();
26
		} catch (TTransportException e) {
27
			e.printStackTrace();
28
		}
29
 
30
		try {
6052 amit.gupta 31
			client.createPayment(3333, 2700.0, 1, 3456, false);
1946 chandransh 32
		} catch (PaymentException e) {
33
			e.printStackTrace();
34
		} catch (TException e) {
35
			e.printStackTrace();
36
		}
37
 
38
	}
39
 
40
}