rendered paste bodypackage net.geant.edugain.mds.integration;import java.io.File;import java.io.FileInputStream;import java.io.IOException;import java.io.InputStream;import junit.framework.TestCase;import org.apache.commons.httpclient.HttpClient;import org.apache.commons.httpclient.HttpException;import org.apache.commons.httpclient.methods.PostMethod;public class MDSPostTest extends TestCase { public void testPost() throws Exception { HttpClient client = new HttpClient(); PostMethod method = new PostMethod("http://localhost:8080/feide"); File xmlFile = new File("feide-be-metadata.xml"); InputStream iostream = new FileInputStream(xmlFile); method.setRequestBody(iostream); try { int result = client.executeMethod(method); System.out.println(method.getResponseBodyAsString()); } catch (HttpException e) { System.err.println(e); } catch (IOException ioe) { System.err.println(ioe); } finally { method.releaseConnection(); } }}