import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.List;

import org.apache.http.HttpResponse;
import org.apache.http.NameValuePair;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.HttpClient;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.message.BasicNameValuePair;
import org.junit.Test;


public class TestClient {
	
	@Test
	public void testPost() throws IOException{
		String url = "http://localhost:8080/SRU-WS/";
		HttpClient client = HttpClients.createDefault();
		HttpPost post = new HttpPost(url);
		 
		List<NameValuePair> urlParameters = new ArrayList<NameValuePair>();
		urlParameters.add(new BasicNameValuePair("query", "rot"));
		urlParameters.add(new BasicNameValuePair("maximumRecords", "5"));
		urlParameters.add(new BasicNameValuePair("endpoint", "korap"));
		post.setEntity(new UrlEncodedFormEntity(urlParameters));
		
		HttpResponse response = client.execute(post);
		//System.out.println("Sending 'POST' request to URL : " + url);
		//System.out.println("Post parameters : " + post.getEntity());
		//System.out.println("Response Code : " + 
		//		response.getStatusLine().getStatusCode());
		if (response.getStatusLine().getStatusCode() != 200){
			System.out.println("Response Code : " + 
					response.getStatusLine().getReasonPhrase());
		}
		
	}	
}
