package test.xt.hb.task;

import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.Map;
import java.util.Map.Entry;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.test.context.ContextConfiguration;

import com.vividsolutions.jts.geom.Polygon;
import com.xt.hb.data.system.GlobalData;
import com.yuanxd.tools.io.http.HttpResultType;
import com.yuanxd.tools.io.http.HttpUtil;
import com.yuanxd.tools.io.http.RequestBean;
import com.yuanxd.tools.io.http.ResponseBean;

@RunWith(JUnit4ClassRunner.class)
// 配置了@ContextConfiguration注解并使用该注解的locations属性指明spring和配置文件之后，
@ContextConfiguration(locations = { "classpath:spring/spring*.xml" })
public class CbyjServiceTest {

	@Test
	public void shipNameTest() throws UnsupportedEncodingException {
		String name = "ZHU CHUAN 2005";
		name = name.replaceAll(" ", "%20");
		RequestBean rb = new RequestBean(HttpResultType.STRING);
		String url = "http://localhost:9300/dataServer/shipName/" + name;
		System.err.println(url);
		rb.setUrl(url);
		ResponseBean response = HttpUtil.getInstance().execute(rb);
		String result = response.getStringResult();
		System.err.println(result);
	}
}
