@@ -0,0 +1,1109 @@
+package com.ikamobile.ikasoa.core.thrift;%0D%0A%0D%0Aimport java.io.IOException;%0D%0Aimport java.net.ServerSocket;%0D%0Aimport java.net.Socket;%0D%0A%0D%0Aimport org.apache.thrift.transport.TTransportException;%0D%0Aimport org.junit.Test;%0D%0A%0D%0Aimport junit.framework.TestCase;%0D%0A%0D%0A/**%0D%0A * Socket%E8%BF%9E%E6%8E%A5%E6%B1%A0%E5%8D%95%E5%85%83%E6%B5%8B%E8%AF%95%0D%0A */%0D%0Apublic class SocketPoolTest extends TestCase %7B%0D%0A%0D%0A%09private static final String HOST = %22localhost%22;%0D%0A%0D%0A%09private static final int PORT = 38001;%0D%0A%0D%0A%09@Test%0D%0A%09public void testBuildThriftSocket() %7B%0D%0A%09%09ThriftSocketThreadTest tstt = new ThriftSocketThreadTest();%0D%0A%09%09tstt.start();%0D%0A%09%09ThriftSocket ts = SocketPool.buildThriftSocket(HOST, PORT);%0D%0A%09%09assertNotNull(ts);%0D%0A%09%09try %7B%0D%0A%09%09%09ts.open();%0D%0A%09%09%09Socket s = ts.getSocket();%0D%0A%09%09%09assertEquals(s.getInetAddress().getHostName(), HOST);%0D%0A%09%09%09assertEquals(s.getPort(), PORT);%0D%0A%09%09%7D catch (TTransportException e) %7B%0D%0A%09%09%09fail();%0D%0A%09%09%7D finally %7B%0D%0A%09%09%09ts.close();%0D%0A%09%09%7D%0D%0A%09%09tstt.interrupt();%0D%0A%09%7D%0D%0A%0D%0A%09private class ThriftSocketThreadTest extends Thread %7B%0D%0A%09%09@SuppressWarnings(%22resource%22)%0D%0A%09%09public void run() %7B%0D%0A%09%09%09try %7B%0D%0A%09%09%09%09new ServerSocket(PORT).accept();%0D%0A%09%09%09%7D catch (IOException e) %7B%0D%0A%09%09%09%7D%0D%0A%09%09%7D%0D%0A%09%7D%0D%0A%0D%0A%7D%0D%0A

add SocketPoolTest.java